
function calculax(ventanax){                                      
	
	venx = screen.width;
	venx = (venx/2) - (ventanax/2);

 return(venx);

}

function calculay(ventanay){

	veny = screen.height;
	veny = (veny/2) -(ventanay/2);
	 return(veny);
}







function linkinterno_frame(lan,sl,t,c,v)
 {
 lan=parseInt(lan.substring(1,sl.length));
 sl=parseInt(sl.substring(2,sl.length));

  
//if (v != '') && (v != null)
//	c = c + "&v=2"; // para que haga bien el volver
   window.location.href="default.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+c;

 }




function esNumerico(valor)
{
	if (valor == "") // no ha enviado nada
		return (false);
	 	var valid = "0123456789"
	var temp;

	for (var i=0; i<valor.length; i++)
	{
		temp = "" + valor.substring(i, i+1);
		if (valid.indexOf(temp) == "-1" ) return (false);
	}
	return (true);
}


/***********************************************************************/

function enviarnoticia(lan,sl,t,c)
{
	xx = 371;
	yy = 284;

	var ventenviaamigo = window.open("envialoamigo.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+c,"Ventenviaamigo","scrollbars=0,channelmode=0,resizable=0,fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,statusbar=0,width="+xx+",height="+yy+",screenX=coorx,screenY=coory");
	ventenviaamigo.focus();

		var coorx = calculax(xx);
		var coory = calculay(yy);
		ventenviaamigo.moveTo(coorx,coory);
		ventenviaamigo.focus();

}

/*************************************************************************/

function imprimirnoticia(lan,sl,t,c)
{

	xx = 640;
	yy = 500;
	var ventimprimenoticia = window.open("impresion.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+c,"VentimprimeMe","scrollbars=1,channelmode=0,resizable=0,fullscreen=0,location=0,directories=0,menubar=0,toolbar=1,statusbar=0,width="+xx+",height="+yy+",screenX=coorx,screenY=coory");
	ventimprimenoticia.focus();


		var coorx = calculax(xx);
		var coory = calculay(yy);

		ventimprimenoticia.moveTo(coorx,coory);

		ventimprimenoticia.focus();

}	




/********************************/

function abretiempo()
 {

  var xx=779;
  var yy=770;

  var coorx = calculax(xx);
  var coory = calculay(yy);

  var tiempo = window.open("registros.asp?Pv_Tipo=3&Pv_Enlace=http://www.aquilandia.com/landias/default_tiempo.htm","Tiempo","scrollbars=0,channelmode=0,resizable=1,fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,statusbar=0,width="+xx+",height="+yy+",screenX=0,screenY=0");   
  tiempo.moveTo(coorx,coory);	
  tiempo.focus();

}

/*************************************/

function mapaweb(idportalprimero)
{
	window.location.href="default.asp?Pv_Landia=21&Pv_IDPortalPrimero="+idportalprimero+"&MapaWeb=1";
}

/************************************************/


/*********************************************/

function ir_a(enla,codigotipoaccion){

	if (codigotipoaccion) // si codigotipoaccion contiene algo..
	  tipoaccion = codigotipoaccion;
	else
	  tipoaccion = "312";
	  
  	var ven = window.open("registros.asp?Pv_Tipo="+tipoaccion+"&Pv_Enlace="+enla);
//	var vent = window.open("registros.asp?Pv_Tipo="+tipoaccion+"&Pv_Enlace="+enla);

	ven.focus();
}


/******************************************************/

function abremail(){

	var ventmail = window.open('http://www.aquilandia.com/mail/default.htm',"Ventanaemail","scrollbars=0,channelmode=0,resizable=0,fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,statusbar=0,width=325,height=123,screenX=coorx,screenY=coory");
	ventmail.focus();

}		

/******************************************************/

function abreforos(){

	var ventforos = window.open('http://foros.aquilandia.com',"Ventanaforos","scrollbars=0,channelmode=0,resizable=0,fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,statusbar=0,width=625,height=400,screenX=coorx,screenY=coory");
	ventforos.focus();

}

/***********************************************************************/
function linkinterno_somos(lan,sl,t,cont)
 {
 lan=parseInt(lan.substring(1,sl.length));
 sl=parseInt(sl.substring(2,sl.length));


	window.location.href="default.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+cont+"&Pv_Somos=1";
 }
 
 /***********************************************************************/



 /************************************************************************/
 
function LinkExternoParametrizado(portal,Lan,Sublan,IDTip,IDCont,Home,Pagina,Categoria,SubCategoria,Letra,Tabla,SubCatEnlace,Inicial,Top,Formulario,Restringido,Continente,Pais,Comunidad,Ciudad)
{
 if (portal == "trueques") {
 	strEnlace = "http://www.truequeslandia.com/df.asp"
	strEnlace = strEnlace + "?Pv_Landia=" + Lan;
	strEnlace = strEnlace + "&Pv_Categoria="  + Categoria;
	strEnlace = strEnlace + "&Pv_OfertaDemanda=" + IDTip;
	strEnlace = strEnlace + "&Pv_Restringido=" + Restringido;
	if (Sublan != "")
		strEnlace = strEnlace + "&Pv_IDentificador=" + Sublan;
	if (Pagina != "")
		strEnlace = strEnlace + "&Pv_Pagina=" + Pagina;
	if (IDCont != "")
		strEnlace = strEnlace + "&Pv_Numero=" + IDCont;
	if (Home != "")
		strEnlace = strEnlace + "&Pv_Orden=" + Home;
    }
 else
   if (portal == "10") {
	 	strEnlace = "http://www.10landia.com/topten/index.asp"
		strEnlace = strEnlace + "?Pv_Categoria="  + Categoria;
		strEnlace = strEnlace + "&Pv_SubCategoria=" + SubCategoria;
		strEnlace = strEnlace + "&Pv_NomDesc=" + IDTip; }
   else{	
	     strEnlace = ""
	     strEnlace = "http://www."+portal+"landia.com/df.asp"
		strEnlace = strEnlace + "?Pv_Landia=" + Lan;
		strEnlace = strEnlace + "&Pv_Sublandia=" + Sublan;
		strEnlace = strEnlace + "&Pv_IDTipo=" + IDTip;
		strEnlace = strEnlace + "&Pv_Contenido=" + IDCont;
		if (Home != "")
			strEnlace = strEnlace + "&Pv_Home=" + Home;
		if (Letra != "")
			strEnlace = strEnlace + "&Pv_Letra=" + Letra;
		if (Tabla != "")
			strEnlace = strEnlace + "&Pv_Tabla=" + Tabla;
		if (SubCatEnlace != "")
			strEnlace = strEnlace + "&Pv_SubCatEnlace=" + SubCatEnlace;
		if (Pagina != "")
			strEnlace = strEnlace + "&Pv_Pagina=" + Pagina;
		if (Categoria != "")
			strEnlace = strEnlace + "&Pv_Categoria=" + Categoria;
		if (SubCategoria != "")
			strEnlace = strEnlace + "&Pv_SubCategoria=" + SubCategoria;
		if (Inicial != "")
			strEnlace = strEnlace + "&Pv_Inicial=" + Inicial;
		if (Top != "")
			strEnlace = strEnlace + "&Pv_Top=" + Top;
		if (Formulario != "")
			strEnlace = strEnlace + "&Pv_Formulario=" + Formulario;
		if (Continente != "")
			strEnlace = strEnlace + "&Pv_Continente=" + Continente;
		if (Pais != "")
			strEnlace = strEnlace + "&Pv_Pais=" + Pais;
		if (Comunidad != "")
			strEnlace = strEnlace + "&Pv_Comunidad=" + Comunidad;
		if (Ciudad != "")
			strEnlace = strEnlace + "&Pv_Ciudad=" + Ciudad;
  }
	var vent = window.open("registros.asp?Pv_Tipo=2&Pv_Enlace="+strEnlace);
	vent.focus();
}

/****/


/****************************************************************************/

function linkmailto(cont,tip)
{
	if (tip==0)	   // mailto:
		window.location = "mailto:"+cont;
	else
	     if (tip==1){
		if (cont == "23abril"){
			xx = 794;
			yy = 600;
			var ventform = window.open("Formularios/F_23abril.asp","","scrollbars=1,channelmode=0,resizable=0,fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,statusbar=0,width=794,height=600");			
			}
		var coorx = calculax(xx);
		var coory = calculay(yy);
		ventform.moveTo(coorx,coory);
		ventform.focus();	
		}
}



/********************************************************/


