var titulopordefecto = ":: Modiseño - Imágenes"; //Si no se especifica un título al llamar a la función colocará el que se especifique aquí
var ventana;
var cont=0;

function openPopUp(foto,titulo)
{
	if(cont==1){ventana.close();ventana=null;}
	if(titulo==null){titulo=titulopordefecto;}
	ventana=window.open('','ventana','resizable=yes,scrollbars=no');
	ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="http://modiseno2.smartec2.com/www/administrador/www/ftp/'+ foto +'" onLoad="opener.redimensionar(this.width, this.height)" />');
	ventana.document.close();
	cont++;
}
function redimensionar(ancho, alto)
{
	ventana.resizeTo(ancho+12,alto+28);
	ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2); //centra la ventana. Eliminar si no se quiere centrar el popup
}
function resize(ancho,alto,id){
	if(ancho > 76){
		nAncho = 76;
		nAlto = (alto*nAncho)/ancho;
		document.getElementById("img_"+id).width= nAncho;
		document.getElementById("img_"+id).height= nAlto;
	}
}
function resize1(ancho,alto,id){
	if(ancho > 50 && ancho>alto){
		nAncho = 50;
		nAlto = (alto*nAncho)/ancho;
		document.getElementById("img_p"+id).width= nAncho;
		document.getElementById("img_p"+id).height= nAlto;
	}else if(alto > 50 && alto>ancho){
		nAlto = 50;
		nAncho = (ancho*nAlto)/alto;
		document.getElementById("img_p"+id).width= nAncho;
		document.getElementById("img_p"+id).height= nAlto;		
	}
}
var bucle = 0;
function showSection(ver,ocultar,loadMC){
	if(loadMC != ""){
		flashProxy.call('fromJS', loadMC);
	}
	if(ver == "myPHP"){
		document.getElementById('myHead').style.display = "block";
		document.getElementById('myMenu').style.display = "block";
	}else if(ocultar == "myPHP"){
		document.getElementById('myHead').style.display = "none";
		document.getElementById('myMenu').style.display = "none";
	}
	document.getElementById(ver).style.display = "block";
	document.getElementById(ocultar).style.display = "none";
}
function printProyecto(){
	ancho = 570;
	alto = screen.height-100;
	contenido = document.getElementById("listadoProyecto").innerHTML;
	imprimir=window.open('miProyecto.php?id=&accn=4','ventana','width='+ancho+', height='+alto+',resizable=yes,scrollbars=yes');
}
function gotoTuProyecto(){
	showSection('myFlash','myPHP','5');
}
function downloadPDF(id){
	ancho = screen.width;
	alto = screen.height-5;
	window.open("crearPDF.php?id="+id,'PDF','width='+ancho+', height='+alto+',resizable=yes,scrollbars=yes');
}
function open360(n){
	if(n == 1){
		window.open('360_1/index.html','ventana79','width=587,height=285,status=no,toolbar=no,menubar=no');
	}else if(n == 2){
		window.open('360_2/index.html','ventana79','width=580,height=552,status=no,toolbar=no,menubar=no');		
	}else if(n == 3){
		window.open('360_3/index.html','ventana79','width=580,height=552,status=no,toolbar=no,menubar=no');
	}
}

function presentacion(archivo){
	W = screen.width/2;
	H = screen.height/2;
	
	ntop = W - 512;
	nleft = H - 343;
	window.open('popups/' + archivo,'presentacion','top=' + ntop +',left=' + nleft +',width=1024,height=685,scrollbars=yes');	
}
