//	POPUP --------------------------------------------------
function irA(cadena){
	window.document.flash.SetVariable("seccion", cadena);
	window.document.flash.TCallLabel("/","cambiar");
}

function pop(a,w,h,t){ 
	l=(screen.width-w)/2; 
	t=(screen.height-h)/2;
	if (t==undefined) t="_blank";
	property="width="+w+",height="+h+",top="+t+",left="+l+",resizable,scrollbars=yes"; 
	var vPopup = window.open(a,t,property);
	if (vPopup == undefined) alert("No se pudo abrir la ventana.\nAsegúrate de no tener un bloqueador de ventanas habilitado.");
	vPopup.focus();
}

//	REDIMENSIONAR VENTANA AL CENTRO --------------------------
function resizeWin(w, h) {
	window.resizeTo(w, h);
	window.moveTo((screen.width - w) / 2, (screen.height - (h + 28)) / 2);
}

//	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);
}

// 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
	}
}


function enfocarFlash(){
	if (document.all || navigator.userAgent.indexOf("Safari")!= -1 ){
		var oFlash = document.getElementById('flash');
		if (oFlash != undefined) oFlash.focus();
	}
}

function cargarFoto(){
	var vUrlFoto = traerParametro("urlFoto");	
	document.getElementById("div_foto").innerHTML = "<img id='img_foto' onLoad='dimensionarAFoto(this);' >";
	var vFoto = document.getElementById("img_foto");
	vFoto.src = vUrlFoto;
}
function dimensionarAFoto(vFoto){
	vAncho = vFoto.width+60;
	vAlto = vFoto.height+150;
	this.resizeWin(vAncho, vAlto);
}