﻿//POP UP
function popup(url, w, h,scrolling) {
	
	var wid = 600;
	var hi = 476;
	
	if (w != null) wid = w; 
	if (h != null) hi  = h; 
	
	var scroll = true;
	
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	
	new_spec = wid + "_" + hi + scroll;
	scrolling = scroll? "yes": "no";
	if (scroll && document.all && (navigator.userAgent.indexOf("Mac") > -1)) wid = wid+17;
	newwin=window.open(url,new_spec,"WIDTH=" + wid + ",HEIGHT=" + hi + ",scrollBars=" + scrolling + ",resizable=no,screenX="+winl+",screenY="+wint+",left="+winl+",top="+wint);
	newwin.focus();
}
//Ventana
function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
	var myLeft = (screen.width-myWidth)/2;
	var myTop = (screen.height-myHeight)/2;
	features+=(features!='')?',':'';
	features+=',left='+myLeft+',top='+myTop;}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

//Obtener el tama?o que necesita el flash
function getHeight(){
	var limit = 1360;
	if(document.body.clientHeight > limit){
	return document.body.clientHeight;
	} else{
		return limit;
	}
	}
function getWidth(){
	var limit = 1010;
	if(document.body.clientWidth > limit){
		//return document.body.clientWidth;
		return "100%";
	} else{
		return limit+"px";
	}
	}
	//para mostrar/ocultar el scroll en IE explorer de acuerdo al tama?o 
	function setScrollIE(){	
	document.body.scroll=(document.body.clientHeight <1360 || document.body.clientWidth<1010)? "yes" : "no";
	}
	function setFlashSize(){
	document.getElementById('rincones').style.height = getHeight()+"px";
	document.getElementById('rincones').style.width = getWidth();	
	setScrollIE();	
}
