function openIT(theURL,W,H,X,Y, wname,titulo) {
	CLOSEdwn 		= "/imagenes/close_dwn.gif"
	CLOSEup 		= "/imagenes/close_up.gif"
	CLOSEovr 		= "/imagenes/close_ovr.gif"
	MINIdwn 		= "/imagenes/mini_dwn.gif"
	MINIup 			= "/imagenes/mini_up.gif"
	MINIovr 		= "/imagenes/mini_ovr.gif"
	NONEgrf 		= "/imagenes/none.gif"
	CLOCKgrf		= "/imagenes/clock.gif"
	titHTML 	    	= "<font face=verdana size=1>" + titulo + "</font>"
	titWIN			= titulo
	winBORDERCOLOR   	= "#CC3333"
	winBORDERCOLORsel	= "#FFFFFF"
	winBGCOLOR    		= "#CC3333"
	winBGCOLORsel 		= "#0F0050"
	return openchromeless(theURL, wname, W, H, X, Y, NONEgrf, CLOSEdwn, CLOSEup, CLOSEovr, MINIdwn, MINIup, MINIovr, CLOCKgrf, titHTML, titWIN, winBORDERCOLOR, winBORDERCOLORsel, winBGCOLOR, winBGCOLORsel)
}

hoy=new Date();

function vector() {
longitud=vector.arguments.length
 for (var i=0;i<longitud;i++) {
  this[i+1] = vector.arguments[i];
  	}
}

var Meses=new vector("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
var Dias= new vector("Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo");
Dias[0]="Domingo";
	
function fecha(hoy) {
var anno = hoy.getYear()
if (anno < 2000) {
	anno = anno + 1900
	}
return Dias[hoy.getDay()]+", día "+hoy.getDate()+" de "+Meses[hoy.getMonth()+1]+" de "+anno
}	

function mes(hoy) {
var anno = hoy.getYear()
if (anno < 2000) {
	anno = anno + 1900
	}
return Meses[hoy.getMonth()+1] + " " + anno
}	


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
var randomnumber=Math.floor(Math.random()*4)
// donde 4 es el intervalo del numero a generar (0-3).
var aux1 = "Mensaje"+randomnumber

var Mensaje
if (aux1=="Mensaje0") { Mensaje="Suscríbete a nuestro boletín y recibe nuestro resumen de prensa diariamente en tu correo."; }
if (aux1=="Mensaje1") { Mensaje="Envía tus sugerencias a sugerencias@vistazoalaprensa.com y ayúdanos a mejorar."; }
if (aux1=="Mensaje2") { Mensaje="Colabora con nosotros; escríbenos a colaboraciones@vistazoalaprensa.com."; }
if (aux1=="Mensaje3") { Mensaje="Si quieres anunciarte en Vistazoalaprensa.com, escríbenos a publicidad@vistazoalaprensa.com."; }

var place=1;
function scrollIn() {
window.status=Mensaje.substring(0, place);
if (place >= Mensaje.length) {
place=1;
window.setTimeout("scrollOut()",300); 
} else {
place++;
window.setTimeout("scrollIn()",50); 
   } 
}
function scrollOut() {
window.status=Mensaje.substring(place, Mensaje.length);
if (place >= Mensaje.length) {
place=1;
window.setTimeout("scrollIn()", 100);
} else {
place++;
window.setTimeout("scrollOut()", 50);}
}

function formatnumber(number)   // 1.- It rounds the number up two decimals:  ( 1.234 ==> 1.23 ) and ( 1.456 ==> 1.46 )
{				// 2.- It adds a 0 before the point, if there is not any one:  ( .12 ==> 0.12 )
 var i = 0;			// 3.- It formats the two decimals: ( 1 ==> 1.00 ) and ( 1.2 ==> 1.20 )
 var result = "";
 var limit = 0;

 num = (Math.round(number*100))/100;	// ROUND THE NUMBER UP TWO DECIMALS
 num = num + "";

 var len = num.length;
 var posit = num.indexOf(".");

 if (num == "NaN")			// CONTROL OF THE MISTAKES
     result = "...";
 else{
     if (posit == "-1")
        result = num + ".00";
     else{
	if (posit == "0")		// ADD THE 0 BEFORE THE POINT
	   result = "0";
	
        limit = posit;
         
        if ((len-posit) >= 3)
            result = result + num;
        else{
            for (i=0; i<limit; i++)                 // ADD THE CHARS FROM THE 0 UNTIL THE CHAR BEFORE THE POINT
                result = result + num.charAt(i);
    
            result = result + ".";
            if ((len-posit) == 2)
                result = result + num.charAt(limit+1) + "0";
            else
                if ((len-posit) == 1)
                    result = result + "00";
           }
        }
     }
 
 return(result);
}

function convert(country, currency)
{
  var euros;

  if (country != "EUR"){
     eval("euros = document.cal." + country + ".value/" + currency + ";");
     eval("document.cal.EUR.value = formatnumber(euros);");
    }
  else{
     euros = document.cal.EUR.value;
     //document.cal.EUR.value = formatnumber(document.cal.EUR.value);
    }
  
  if (country != "ESP")  document.cal.ESP.value = formatnumber(euros*166.386);
};

function vota()   {
	if (document.encuesta.op1.checked==true) {
		document.encuesta.op1.checked=false;
		window.open ('http://www.vistazoalaprensa.com/encuesta.asp?op=1','Vistazoalaprensa','width=500,height=585'); }
	if (document.encuesta.op2.checked==true) {
		document.encuesta.op2.checked=false;
		window.open ('http://www.vistazoalaprensa.com/encuesta.asp?op=2','Vistazoalaprensa','width=500,height=585'); }
	if (document.encuesta.op3.checked==true) {
		document.encuesta.op3.checked=false;
		window.open ('http://www.vistazoalaprensa.com/encuesta.asp?op=3','Vistazoalaprensa','width=500,height=585'); }
}

function PopUpEnvAm(url_pop)
{
	enviar=window.open(url_pop,'Enviar','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width=420,height=650,left=100,top=100');
}
function PopUpEnc(url_pop)
{
	enviar=window.open(url_pop,'Encuesta','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width=500,height=585,left=100,top=100');
}
function PopUpFichAut(url_pop)
{
	enviar=window.open(url_pop,'Ficha_Autor','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=yes,width=500,height=500,left=100,top=100');
}
