//	POPUP --------------------------------------------------
function irA(cadena){
	window.document.flash.SetVariable("seccion", cadena);
	window.document.flash.TCallLabel("/","cambiar");
}

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";

	var ah = (window.screen)?(window.screen.availHeight - 30):770;
	var aw = (window.screen)?(window.screen.availWidth - 10):590;
	str += ",height=" + ah;
	str += ",innerHeight=" + ah;
	str += ",width=" + aw;
	str += ",innerWidth=" + aw;
	str += ",location";
	str += ",resizable";

	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(bSentido) {
	var vIframe = document.getElementById("detector");
	vIframe.style.display = bSentido?"":"none";
	vIframe.style.height = bSentido?"12px":"1px";
}

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";
	}
}


// parametros
function traerParametro(nombre){
	var strURL = String(document.location);
	var listaSplit = strURL.split("?")
	if(listaSplit.length > 1) {
		var params = listaSplit[1];
		var buscamos = nombre + "=";
		if (params.length > 0) {
			if (nombre == undefined) return(params);
			i = params.indexOf(buscamos);
			if (i != -1) {
				i += buscamos.length;
				j = params.indexOf("&", i);
				if (j == -1)
				j = params.length;
				return (params.substring(i,j));
			}else{
				return -1
			}
		}else{
			return -1
		}
	}else{
		return -1
	}
}