//	POPUP --------------------------------------------------
function pop(a,w,h){ 
	l=(screen.width-w)/2; 
	t=(screen.height-h)/2; 
	property="scrollbars=no,width="+w+",height="+h+",top="+t+",left="+l; 
	window.open(a,"_blank",property); 
}

//	REDIMENCIONAR VENTANA AL CENTRO --------------------------
function resizeWin(w, h) {
	window.moveTo((screen.width - w) / 2, (screen.height - (h + 28)) / 2);
	window.resizeTo(w, h);
}

//	FULLSCREEN ------------------------------------------------
function launchFull(url,name) {
	//alert(name);
	var str = "scrollbars=no,left=0,screenX=0,top=0,screenY=0,fullscreen";

	if (window.screen) {
	  var ah = window.screen.availHeight - 30;
	  var aw = window.screen.availWidth - 10;
	  str += ",height=" + ah;
	  str += ",innerHeight=" + ah;
	  str += ",width=" + aw;
	  str += ",innerWidth=" + aw;
	  str += ",resizable=0";
	} else {
	  str += ",resizable"; // so the user can resize the window manually
	}/**/
	ventanaFull = window.open(url, name, str);
	ventanaFull.focus()	
			
}

//	ABRE POPUP EN EL OPENER -----------------------------------
function popupOpener(URLtoOpen,ancho,alto) {
	var popup = window.open(URLtoOpen, "popup", "resizeable=0,status=0,width=" + ancho + ",height=" + alto + ",scrollbars=no");
	popup.focus();
	popup.moveTo((screen.width - ancho) / 2, (screen.height - (alto + 50)) / 2);
	shake_xy(10,popup)
}


//	SHAKES DE VENTANA -----------------------------------------
function shake_xy(n,quien) {
	if (quien==null) quien = window;
	if (quien.moveBy) {
		for (i = n; i> 0; i--) {
			quien.moveBy(0,i);
			quien.moveBy(i,0);
			quien.moveBy(0,-i);
			quien.moveBy(-i,0);
		}
	}
}

function ampliarIframe() {
	var vIframe = document.getElementById("detector");
	vIframe.style.height="32px";
}

function detectarFlash() {
	var vIframe = document.getElementById("detector");
	var vLocation = vIframe.contentWindow.document.location;
	if (String(vLocation).indexOf("flash_no.htm") != -1){
		vIframe.style.height="0px";
		vIframe.src = "htm/detector.htm";
	}
}