// JavaScript Document
function fecha() {
var months = new Array();
months[0] = 'Enero';
months[1] = 'Febrero';
months[2] = 'Marzo';
months[3] = 'Abril';
months[4] = 'Mayo';
months[5] = 'Junio';
months[6] = 'Julio';
months[7] = 'Agosto';
months[8] = 'Septiembre';
months[9] = 'Octubre';
months[10] = 'Noviembre';
months[11] = 'Diciembre';
var days = new Array();
days[0] = 'Domingo';
days[1] = 'Lunes';
days[2] = 'Martes';
days[3] = 'Miércoles';
days[4] = 'Jueves';
days[5] = 'Viernes';
days[6] = 'Sábado';
now = new Date();
var dayname = days[now.getDay()];
var monthname = months[now.getMonth()];
var dayofmonth =now.getDate();
var year = now.getYear();
if (year < 1000) year += 1900;
document.write(dayname + ' ' + dayofmonth + ' ' + monthname + ' ' + year);	
}

function fecha_en() {
var months = new Array();
months[0] = 'January';
months[1] = 'February';
months[2] = 'March';
months[3] = 'April';
months[4] = 'May';
months[5] = 'June';
months[6] = 'July';
months[7] = 'August';
months[8] = 'September';
months[9] = 'October';
months[10] = 'November';
months[11] = 'December';
var days = new Array();
days[0] = 'Sunday';
days[1] = 'Monday';
days[2] = 'Tuesday';
days[3] = 'Wednesday';
days[4] = 'Thursday';
days[5] = 'Friday';
days[6] = 'Saturday';
now = new Date();
var dayname = days[now.getDay()];
var monthname = months[now.getMonth()];
var dayofmonth =now.getDate();
var year = now.getYear();
if (year < 1000) year += 1900;
document.write(dayname + ' ' + dayofmonth + ' ' + monthname + ' ' + year);	
}




// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use

var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"

var bouncelimit=32 //(must be divisible by 8)
//var direction="up"

function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("adv").style : ie? document.all.adv : document.adv
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
//crossobj.top=scroll_top-250+calunits
crossobj.top=370
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function dropornot(){
if (get_cookie("droppedin")==""){
window.onload=initbox
document.cookie="droppedin=yes"
}
}

// Set Netscape up to run the "captureMousePosition" function whenever
// the mouse is moved. For Internet Explorer and Netscape 6, you can capture
// the movement a little easier.
if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has 
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position 
        // reflects the position from the top/left of the screen the 
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no 
        // matter if the user has scrolled or not.
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard 
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
	//window.status = "xMousePos=" + xMousePos + ", yMousePos=" + yMousePos + ", xMousePosMax=" + xMousePosMax + ", yMousePosMax=" + yMousePosMax;
}


function WM_checkIn(id) {

/*
Usage: WM_checkIn('id')
*/

  // This function checks for DOM strategy, then 
  // returns an object reference.
  if (document.all) {
    return document.all[id].style;
  } else if(document.layers) {
    return document.layers[id];
  }
}

// set hidden/visible vars for Netscape 4 compatibility
if (document.layers) {
  var hidden = "hide";
  var visible = "show";
} else {
  var hidden = "hidden";
  var visible = "visible";
}
var toggle = "toggle";

function WM_changeVisibility() {
  if (document.layers || document.all) {
    var inc, endInc=arguments.length;
    // run through the args (objects) and set the visibility of each
    for (inc=0; inc<endInc; inc+=2) {
      // get a good object reference
      var daObj = WM_checkIn(arguments[inc]);
      if (arguments[inc+1] == hidden) {
        // hide the object
        daObj.visibility = hidden;
      } else if (arguments[inc+1] == visible) {
        // show the object
        daObj.visibility = visible;
      } else if (arguments[inc+1] == toggle) {
        // toggle the object's visibility
        if (daObj.visibility == visible) {
          daObj.visibility = hidden;
        } else if (daObj.visibility == hidden) {
          daObj.visibility = visible;
        }
      }
    }
  }
}


function temp(){
var txa = tempx.split(",");
var tnh = tempn.split(",");
var x = 0;
for ( x = 0; x < 1; x++)
	{
	document.write ('');
	if ( txa[x] == 'S/I' )
	{
		document.write ('<span class="tmax">M&aacute;x: '+txa[13]+' &deg;C </span>- ');
	}
	else
    {	document.write ('<span class="tmax">M&aacute;x: '+txa[13]+' &deg;C - </span>');}
	
	 if ( tnh[x] == 'S/I' )
	{
		document.write ('<span class="tmin">M&iacute;n: '+tnh[13]+' &deg;C</span>');
	}
	else
	{	document.write ('<span class="tmin">M&iacute;n: '+tnh[13]+' &deg;C</span>');
	}
	document.write ('');
	}
	
}
function temp_en(){
var txa = tempx.split(",");
var tnh = tempn.split(",");
var x = 0;
for ( x = 0; x < 1; x++)
	{
	document.write ('');
	if ( txa[x] == 'S/I' )
	{
		document.write ('<span class="tmax">Max: '+txa[13]+' &deg;C </span>- ');
	}
	else
    {	document.write ('<span class="tmax">Max: '+txa[13]+' &deg;C - </span>');}
	
	 if ( tnh[x] == 'S/I' )
	{
		document.write ('<span class="tmin">Min: '+tnh[13]+' &deg;C</span>');
	}
	else
	{	document.write ('<span class="tmin">Min: '+tnh[13]+' &deg;C</span>');
	}
	document.write ('');
	}
	
}