//	POPUP --------------------------------------------------
function pop(a,w,h){ 
	l=(window.screen.availWidth-w)/2; 
	t=(window.screen.availHeight-h)/2;
	property="scrollbars=yes,width="+w+",height="+h+",top="+t+",left="+l+",resizable";
	window.open(a,"_blank",property); 
}

//	REDIMENCIONAR VENTANA AL CENTRO --------------------------
function resizeWin(w, h) {
	window.moveTo(0,0);
	window.resizeTo(w, h);
	window.moveTo((window.screen.availWidth - w) / 2, (window.screen.availHeight - h) / 2);
}

//	FULLSCREEN ------------------------------------------------
function launchFull(url,name) {
	var str = "scrollbars=yes,left=0,screenX=0,top=0,screenY=0,fullscreen";
	if (window.screen) {
	  var ah = window.screen.availHeight;
	  var aw = window.screen.availWidth;
	  str += ",height=" + ah;
	  str += ",width=" + aw;
	  str += ",resizable";
	} 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=auto");
	popup.focus();
	popup.moveTo((screen.width - ancho) / 2, (screen.height - (alto + 50)) / 2);
	shake_xy(10,popup)
}

function ampliarIframe(bSentido) {
	var vIframe = document.getElementById("detector");
	vIframe.style.display = bSentido?"":"none";
	vIframe.style.height = bSentido?"24px":"1px";
}

function enfocarFlash(){
	if (document.all || navigator.userAgent.indexOf("Safari")!= -1 ){
		var oFlash = document.getElementById('objectFlash');
		if (oFlash != undefined) oFlash.focus();
	}
}

function cargarFoto(urlFoto){
	//document.getElementById("div_foto").innerHTML = "<img id='img_foto' src='' onLoad='dimensionarAFoto(this);' border='0'>";
	document.getElementById("div_foto").innerHTML = "<img id='img_foto' src='' border='0'>";
	var vFoto = document.getElementById("img_foto");
	vFoto.src = urlFoto;
}

/*
function dimensionarAFoto(vFoto){
	vAncho = vFoto.width+80;
	vAlto = vFoto.height+220;
	this.resizeWin(vAncho, vAlto);
}*/
