/**********************************************************************************************************************/
/*									                                              */
/*			          Funciones de AQUILANDIA ( Juegoslandia )			                      */
/*									                                              */
/**********************************************************************************************************************/

/****************************************************************************/

function resolucion(){

var screen_width = null;
var screen_height = null;
screen_width = screen.width;
screen_height = screen.height;

if (screen_width && screen_height) 
  if (screen_width <= 800)
    return("800");
   else if (screen_width <= 1024)
    return("1024");
  else
 	 return("1152");


}

/***********************************************************************/
// estas dos funciones calculan a que posicion se debe colocar la ventana flotante nueva (formularios)

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 makeArray(n){
  this.length = n;
  for (i=1;i<=n;i++){
    this[i]=0;
  }
  return this;
}
/****************************************************************************/

function displayDate() {
  var this_month = new makeArray(12);
    this_month[0]  = "Enero";
    this_month[1]  = "Febrero";
    this_month[2]  = "Marzo";
    this_month[3]  = "Abril";
    this_month[4]  = "Mayo";
    this_month[5]  = "Junio";
    this_month[6]  = "Julio";
    this_month[7]  = "Agosto";
    this_month[8]  = "Septiembre";
    this_month[9]  = "Octubre";
    this_month[10] = "Noviembre";
    this_month[11] = "Diciembre";
  var today = new Date();
  var day   = today.getDate();
  var month = today.getMonth();
  var year  = today.getYear();
  if (year < 1900) {
    year += 1900;
  }

 return(day + "&nbsp;de&nbsp;"+ this_month[month] +"&nbsp;de&nbsp;"+ year);
}

/*************************************************************************/
function calculax(ventanax){                                      

var venx;	
	venx = screen.width;
	venx = (venx/2) - (ventanax/2);

 return(venx);

}

function calculay(ventanay){
var veny;
	veny = screen.height;
	veny = (veny/2) -(ventanay/2);
	 return(veny);
}


/****************************************************************************/

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();	
		}
}

/***********************************************************************/
function linkinterno_frame(lan,sl,t,c)
 {
 lan=parseInt(lan.substring(1,sl.length));
 sl=parseInt(sl.substring(2,sl.length));

 if ((sl == 4) && (t.toUpperCase() == 'NOT') && (c == 6))
         var miniland = window.open("default.asp?Pv_Juego=1","MinilandiaJuego","scrollbars=0,channelmode=0,resizable=0,fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,statusbar=0,width=640,height=545,screenX=coorx,screenY=coory");
 else
          window.location.href="desarrollo.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+c;
 }

/******************************************************/

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_grupos(lan,sl,t,c,pag){

	 lan=parseInt(lan.substring(1,sl.length));
	 sl=parseInt(sl.substring(2,sl.length));
	
	 window.location.href="desarrollo.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+c+"&Pv_Pagina="+pag;
}

/*************************************************************/

function volver(){
	
	window.location="default_aux.htm"
}

/***********************************************************************/


function enviarnoticia(lan,sl,t,c)
{
	xx = 359;
	yy = 284;

	var ventenviaamigo = window.open("envialoamigo.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+c,"Ventanaenviar","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 = 520;

	var ventimprimenoticia = window.open("impre.asp?Pv_Landia="+lan+"&Pv_Sublandia="+sl+"&Pv_IDTipo="+t+"&Pv_Contenido="+c,"Ventanaimprimir","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();
//alert("EE");

}



/********************/
function linkInterno_Window(nombre, opcion) 
 {
		
	var xx;
	var yy;

	imagen = nombre;		

	//alert(imagen);
	imagen=imagen.substring(1,imagen.length);
	imagen = "/landias/"+imagen;
	//alert(imagen);


	//preload("foto",imagen);

	xx = 585;
	yy = 650;
		
   	var vent = window.open("verimg.htm","Imagen","scrollbars=1,channelmode=0,resizable=0,fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,statusbar=0,width="+xx+",height="+yy+",screenX=0,screenY=0");

	var coorx = calculax(xx);
	var coory = calculay(yy);
	vent.moveTo(coorx,coory);
	vent.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 ir_a(enla){

	var vent = window.open("registros.asp?Pv_Tipo=3&Pv_Enlace="+enla);
}


/************************************************************************/
 
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 linkexterno_window(url)
{
var vent = window.open("registros.asp?Pv_Tipo=312&Pv_Enlace="+url);

vent.focus();
}
