/**************************************
? TMTFactory
**************************************/

var w="";

function openInfo(codigo)
{
	Xlen=500;
	Ylen=500;
	/*
	if (parseInt(navigator.appVersion)>3) 
	{
 		if (navigator.appName=="Netscape") 
		{
  			X = window.innerWidth;
  			Y = window.innerHeight;
 		}
	 	if (navigator.appName.indexOf("Microsoft")!=-1) 
		{
  			X = document.body.offsetWidth;
	  		Y = document.body.offsetHeight;
 		}
	}
	Xpos=(X/2)-(Xlen/2); 
	Ypos=(Y/2)-(Ylen/2); 
	*/
	Xpos=(screen.width/2)-(Xlen/2);
	Ypos=(screen.height/2)-(Ylen/2);
	w = window.open("infoAgencia.do?codigo=" + codigo, "info", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left = '+Xpos+',top = '+Ypos); 
}

function openInfoNacexShop(codigo)
{
	Xlen=500;
	Ylen=650;
	Xpos=(screen.width/2)-(Xlen/2);
	Ypos=(screen.height/2)-(Ylen/2);
	w = window.open("infoPuntoNacexShop.do?codigo=" + codigo, "info", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left = '+Xpos+',top = '+Ypos); 
}

/*function closeInfo()
{
    if (detalle && detalle.open && !detalle.closed) 
	   detalle.close();
}*/

function openPolitica(valor){
	Xlen=500;
	Ylen=500;
	Xpos=(screen.width/2)-(Xlen/2);
	Ypos=(screen.height/2)-(Ylen/2);
	w = window.open("irPolitica.do?valor="+ valor, "info", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left = '+Xpos+',top = '+Ypos); 
}

function openMercancia(){
	Xlen=500;
	Ylen=500;
	Xpos=(screen.width/2)-(Xlen/2);
	Ypos=(screen.height/2)-(Ylen/2);
	w = window.open("irMercancia.do", "info", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left = '+Xpos+',top = '+Ypos); 
}

function openBusquedaCP(parametros){
	Xlen=580;
	Ylen=540;
	Xpos=(screen.width-Xlen)/2;
	Ypos=(screen.height-Ylen)/2 - 10; 
	w = window.open("irBuscarCP.do?"+ parametros, "info", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left='+Xpos+',top='+Ypos); 
}

function openMapa(codigo){
	Xlen=650;
	Ylen=450;
	Xpos=(screen.width/2)-(Xlen/2);
	Ypos=(screen.height/2)-(Ylen/2);
	w = window.open("infoMapa.do?codigo=" + codigo, "info", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left = '+Xpos+',top = '+Ypos); 
}

function openGMapa(latitud,longitud,delegacion,print,direccion){
	Xlen=650;
	Ylen=450;
	Xpos=(screen.width/2)-(Xlen/2);
	Ypos=(screen.height/2)-(Ylen/2);
	w = window.open("infoMapa.do?latitud=" +latitud+"&longitud="+longitud+"&codigo="+delegacion+"&print="+print+"&direccion="+direccion, "info", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left = '+Xpos+',top = '+Ypos); 
}

function openFuncionesUsuario(formulario,usuario,metodo){
	Xlen=500;
	Ylen=510;
	Xpos=(screen.width-Xlen)/2;
	Ypos=(screen.height-Ylen)/2 - 10; 
	w = window.open(formulario + "?usuario=" + usuario+ "&method="+metodo, "info", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left='+Xpos+',top='+Ypos); 
}

function openManualUsuario(manual){
	Xlen=1000;
	Ylen=800;
	Xpos=(screen.width-Xlen)/2;
	Ypos=(screen.height-Ylen)/2 - 10; 
	w = window.open(manual, "Man", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+Xlen+',height='+Ylen+',left='+Xpos+',top='+Ypos); 
}
function close(){
    if (w && !w.closed) w.close() ;
}

