function getDate() {
// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','Sabado');

// Array list of months.
var months = new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Sept','Octubre','Noviembre','Diciembre');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
//today =  days[now.getDay()] + " " + date + " de " +         months[now.getMonth()] + " de " + (fourdigits(now.getYear())) ;
today =  days[now.getDay()] + " " + date + " " +         months[now.getMonth()] + " " + (fourdigits(now.getYear())) ;

// Print out the data.
document.write(today);

//  End -->
}

function NewWindow(mypage, args, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+scroll;

	mypage += escape(args);
	
	win = window.open(mypage, myname, winprops);	
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus();
	 }
	
}

function NewWindowPrint(mypage, args, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+scroll+',menubar=yes';

	mypage += escape(args);
	
	win = window.open(mypage, myname, winprops);	
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus();
	 }
	
}

// Radio Button Validation
function valButton(btn) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
   if (btn[i].checked) {cnt = i; i = -1;}
   }
if (cnt > -1) return btn[cnt].value;
else return null;
}

function searchForm(form,strBase) {
if (form.keyword.value=='BUSCAR') 
	alert('Especifique una palabra clave');
else {

		document.frmGoogle.q.value = form.keyword.value;
		//document.frmGoogle.action = '../template/resultadosbusquedagoogle.aspx';    			
		document.frmGoogle.submit();
	}
}

function triviaForm(form) {
var btn = valButton(form.RadioTrivia);
if (btn == null) 
alert('Seleccione una respuesta.');
else {
	  NewWindow('../template/triviapopup.aspx?intTriviaId=' + form.tv.value + '&intAnswerId=' + btn,'','winTrivia','580','300','yes');
	}
}


function voteForm(form,strBase) {
var btn = valButton(form.RadioSondeo);
if (btn == null) 
alert('Seleccione una respuesta.');
else {
    //form.action='../template/sondeo.aspx';
    form.action= strBase + 'encuesta';
	form.submit();
	}
}

function voteFormArtista(form,artista) {
var btn = valButton(form.RadioSondeo);
if (btn == null) 
alert('Seleccione una respuesta.');
else {
    form.action='../template/artistasondeo.aspx?ar='+artista;
	form.submit();
	}
}

function verHoroscopo(targ,selObj,restore){ //v3.0
if (selObj.options[selObj.selectedIndex].value!=0){
  eval(targ+".location='/Xstatic/primerahora/template/horoscopo.aspx#"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}  
}

function tv(form) {	
		parent.document.location.href='../template/tv.aspx?zipcode=' + form.zipcode.value;
}

function cine(form) {	
		parent.document.location.href='../template/cine.aspx?zipcode=' + form.zipcode.value;
}

function selectCalendario(combo,strBase){  
	if (combo.options[combo.selectedIndex].value!=0)
	//	document.location.href='calendario.aspx?se=' + combo.options[combo.selectedIndex].value;
	document.location.href= strBase + combo.options[combo.selectedIndex].value + '/eventos' ;
}

function onFocusEmail(emailField, valor)
{
    if (emailField.value == valor)
    {
        emailField.value = '';
    }
    return true;
}
function onBlurEmail(emailField, valor)
{
    if (emailField.value == '')
    {
        emailField.value = valor;
    }
    return true;
}
function onFocusPassword(textDisplayPasswordFieldId, passwordFieldId)
{
    passwordField = document.getElementById(passwordFieldId);
    textDisplayPasswordField = document.getElementById(textDisplayPasswordFieldId);   

    passwordField.style.display = 'block';
    textDisplayPasswordField.style.display = 'none';
    passwordField.focus();    
    return true;
}
function onBlurPassword(textDisplayPasswordFieldId, passwordFieldId)
{
    passwordField = document.getElementById(passwordFieldId);
    textDisplayPasswordField = document.getElementById(textDisplayPasswordFieldId);
    
    if (passwordField.value == '')
    {
        passwordField.style.display = 'none';
        textDisplayPasswordField.style.display = 'block';
    }    
    return true;
}

function onFocusBuscador(busqueda)
{
    if (busqueda.value == 'BUSCAR')
    {
        busqueda.value = '';
    }
    return true;
}
function onBlurBuscador(busqueda)
{
    if (busqueda.value == '')
    {
        busqueda.value = 'BUSCAR';
    }
    return true;
}
// CargaDivURL
function cargaDivURL(strDiv,strLink,strFuncion)
{
	$(document).ready(function() 
	{
		if (strFuncion == '') {
		$('#' + strDiv).load(strLink);
		}
		else
		{
		$('#' + strDiv).load(strLink, function() { strFuncion });
		}
		$('#' + strDiv).html('<div><img src="../images/icons/ajax-loader3.gif"/></div>');	
	});
}
function onFocusInput(campo,texto)
{
    if (campo.value == texto)
    {
        campo.value = '';
    }
    return true;
}
function onBlurInput(campo,texto)
{
    if (campo.value == '')
    {
        campo.value = texto;
    }
    return true;
}

