function popup2(name,w,h){
        posX=((screen.availWidth-w)/2);
        posY=((screen.availHeight-h)/2);
        window.open(name,"popup", "toolbar=0,location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width="+w+", height="+h+",left="+posX+",top="+posY);
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	var ancho = screen.width;
	var alto = screen.height;
	var posx=0;
	var posy=0;
	if(alto>643 && ancho>819){
		posx=(ancho-819)/2;
		posy=(alto-643)/2;
	}
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=819,height=643,left = " + posx + ",top = " + posy + "');");
}

$(document).ready(function(e) { 
	$(function(){
		var alto = screen.height;
		var posy=0;
		if(alto>643){
			posy=(alto-643)/2;
		}
		if (window.innerHeight){
			//navegadores basados en mozilla
			espacio_pagina = window.innerHeight
		}else{
			//Navegadores basados en IExplorer, es que no tengo innerheight
			espacio_pagina = document.body.clientHeight
		} 
		var margen_arr = screen.height - espacio_pagina;
		var distancia=posy-margen_arr+270;
		if(distancia>0){
			//alert(screen.height + " -- " + espacio_pagina + " -- " + distancia + " -- " + posy);
			$('#filete').css('top',distancia);
		}
	});
}); 
