//top.window.moveTo(0,0);
//if(document.all){top.window.resizeTo(screen.availWidth,screen.availHeight);}
//else if(document.layers||document.getElementById){if(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){top.window.outerHeight=screen.availHeight;top.window.outerWidth=screen.availWidth;}}



/*Funcion para mover el Iframe dentro del swf*/
function moveIFrame(x,y,w,h) {	
    	var frameRef=document.getElementById("myFrame");
    	frameRef.style.left=x+"px";
   	frameRef.style.top=y+"px";

    	var iFrameRef=document.getElementById("myIFrame");	
	iFrameRef.width=w+"px";
	iFrameRef.height=h+"px";
}

/*Funcion para ocultar el Iframe dentro del swf*/
function hideIFrame(){
	
	document.getElementById("myFrame").focus();

	var iFrameRef=document.getElementById("myIFrame");	
	iFrameRef.width=0;
	iFrameRef.height=0;
	
	document.getElementById("myIFrame").style.visibility="hidden";
    	document.getElementById("myFrame").style.visibility="hidden";	
}

/*Funcion para presentar el Iframe deltro del swf*/	
function showIFrame(){

    	document.getElementById("myFrame").style.visibility="visible";
	document.getElementById("myIFrame").style.visibility="visible";
}

/*Funcion para leer el Iframe dentro del swf*/
function loadIFrame(url){
	document.getElementById("myFrame").innerHTML = "<iframe id='myIFrame' class='clientArea' src='" + url + "'frameborder='0'></iframe>";
}

var b = h = null;
var oldData = '';
var resizeCount = 0;
var objWindow = null;

onload = function() {

	h = document.getElementsByTagName('html')[0];
	b = document.getElementsByTagName('body')[0];	    
	onresize();
	window.focus();
	
	
	//document.getElementsByTagName('formFlash').focus();
}


/*Funcion para activar el auto-resize*/
onresize = function() {

	var tempData = h.offsetHeight + ' ' + h.scrollHeight + ' ' + h.clientHeight + ' ' + b.offsetHeight + ' ' + b.scrollHeight + ' ' + b.clientHeight;
	if (oldData != tempData) {
		oldData = tempData;
		window.status = 'Resize called ' + (++resizeCount) + ' times' + ' - ' + h.clientWidth + ' - ' + h.clientHeight;
	}
	var objTemp = document.getElementById('videochat');

	if(objTemp!=undefined)
		objWindow = objTemp;
	
	var minWidth = "980px";
	var minW = 980;
	if(screen.width >1024)
	{
		minWidth = "1100px";
		minW = 1100;
		
	}
	
	
	if(h.clientHeight>570)
		objWindow.style.height = h.clientHeight+"px";
	else		
		objWindow.style.height = "570px"; 
	
	if(h.clientWidth >minW)
		objWindow.style.width = h.clientWidth+"px";
	else
		objWindow.style.width = minWidth;	

};

