$(document).ready(function(){
    if($("#errorLogin").length > 0){
        $("#errorLogin").click();
    }
});

var lang = idiomaXbasic;

function menuleftOver(id) {
	document.getElementById("menuleft"+id).style.backgroundColor = "#e5e5e5";
	document.getElementById("menuleft"+id).style.cursor = "pointer";
}

function menuleftOut(id) {
	document.getElementById("menuleft"+id).style.backgroundColor = "#ffffff";
}

function menuleftClick(id) {
	switch(id)	{
		case 1:
			//document.location = "";
			break;
		case 2:
			//document.location = "";
			break;
		case 3:
			//document.location = "";
			break;
		case 4:
			//document.location = "";
			break;
		case 5:
			//document.location = "";
			break;
	}
}

function optOver(elem) {
	elem.style.backgroundColor='#e5e5e5'
	elem.style.cursor = "pointer";
}

function optOut(elem) {
	elem.style.backgroundColor='#ffffff'
}

function optClick(address) {
	myBaseHREF(address);
}

function mnOver(id) {
	//document.getElementById(id).src='images/home/mn_'+id+'_on.gif';
	document.getElementById(id).src='images/'+lang+'/menutop/mn_'+id+'_on.gif';
	document.getElementById('options_'+id).style.display='block';
}

function mnOut(id) {
	document.getElementById('options_'+id).style.display='none';
	document.getElementById(id).src='images/'+lang+'/menutop/mn_'+id+'.gif';
}

function optsOver(id) {
	document.getElementById('options_'+id).style.display='block';
	document.getElementById(id).src='images/'+lang+'/menutop/mn_'+id+'_on.gif';
}

function optsOut(id) {
	document.getElementById(id).src='images/'+lang+'/menutop/mn_'+id+'.gif';
	document.getElementById('options_'+id).style.display='none';
}

function selectIdioma(param) {
	if (param.length==2) {
		myBaseHREF('changeIdioma.aspx?code='+param)
	} else {
		popup2(param,(screen.width/1.5),(screen.height/1.5));
	}
}

function popup(direccion,w,h) {
		var posx = (screen.width-w)/2;
		var posy = (screen.height-h)/2;
		var opciones = "fullscreen=0" + 
                 ",toolbar=0" + 
                 ",location=0" + 
                 ",status=0" + 
                 ",menubar=0" + 
                 ",scrollbars=1" + 
                 ",resizable=1" + 
                 ",width="+w + 
                 ",height="+h + 
                 ",left="+posx + 
                 ",top="+posy; 
     	var ventana = window.open(direccion,"popup",opciones); 
}

function popup2(direccion,w,h) {
		var posx = (screen.width-w)/2;
		var posy = (screen.height-h)/2;
		var opciones = "fullscreen=1" + 
                 ",toolbar=1" + 
                 ",location=1" + 
                 ",status=1" + 
                 ",menubar=1" + 
                 ",scrollbars=1" + 
                 ",resizable=1" + 
                 ",width="+w + 
                 ",height="+h + 
                 ",left="+posx + 
                 ",top="+posy; 
     	var ventana = window.open(direccion,"popup",opciones); 
}


function key(event) {
	if (event.keyCode==13) {
		return true;
	} else {
		return false;
	}
}

function las10diferencias() {
	var direccion = "flex/Las_10_diferencias/deploy/las-10-diferencias.html";
	var w = 580;
	var h = 635;
	
		var posx = (screen.width-w)/2;
		var posy = (screen.height-h)/2;
		var opciones = "fullscreen=0" + 
                 ",toolbar=0" + 
                 ",location=0" + 
                 ",status=0" + 
                 ",menubar=0" + 
                 ",scrollbars=0" + 
                 ",resizable=0" + 
                 ",width="+w + 
                 ",height="+h + 
                 ",left="+posx + 
                 ",top="+posy; 
     	var ventana = window.open(direccion,"popup",opciones); 

}

function las10diferenciasEN() {
	var direccion = "flex/Las_10_diferencias/deploy/las-10-diferencias_en.html";
	var w = 580;
	var h = 635;
	
		var posx = (screen.width-w)/2;
		var posy = (screen.height-h)/2;
		var opciones = "fullscreen=0" + 
                 ",toolbar=0" + 
                 ",location=0" + 
                 ",status=0" + 
                 ",menubar=0" + 
                 ",scrollbars=0" + 
                 ",resizable=0" + 
                 ",width="+w + 
                 ",height="+h + 
                 ",left="+posx + 
                 ",top="+posy; 
     	var ventana = window.open(direccion,"popup",opciones); 

}

function las10diferenciasPL() {
	var direccion = "flex/Las_10_diferencias/deploy/las-10-diferencias_pl.html";
	var w = 580;
	var h = 635;
	
		var posx = (screen.width-w)/2;
		var posy = (screen.height-h)/2;
		var opciones = "fullscreen=0" + 
                 ",toolbar=0" + 
                 ",location=0" + 
                 ",status=0" + 
                 ",menubar=0" + 
                 ",scrollbars=0" + 
                 ",resizable=0" + 
                 ",width="+w + 
                 ",height="+h + 
                 ",left="+posx + 
                 ",top="+posy; 
     	var ventana = window.open(direccion,"popup",opciones); 

}


function las10diferenciasFR() {
	var direccion = "flex/Las_10_diferencias/deploy/las-10-diferencias_fr.html";
	var w = 580;
	var h = 635;
	
		var posx = (screen.width-w)/2;
		var posy = (screen.height-h)/2;
		var opciones = "fullscreen=0" + 
                 ",toolbar=0" + 
                 ",location=0" + 
                 ",status=0" + 
                 ",menubar=0" + 
                 ",scrollbars=0" + 
                 ",resizable=0" + 
                 ",width="+w + 
                 ",height="+h + 
                 ",left="+posx + 
                 ",top="+posy; 
     	var ventana = window.open(direccion,"popup",opciones); 

}

function facebook() {
	var direccion = "http://www.facebook.com/aplipaper?ref=ts";
	var w = 800;
	var h = 600;
	
		var posx = (screen.width-w)/2;
		var posy = (screen.height-h)/2;
		var opciones = "fullscreen=0" + 
                 ",toolbar=1" + 
                 ",location=1" + 
                 ",status=1" + 
                 ",menubar=1" + 
                 ",scrollbars=1" + 
                 ",resizable=1" + 
                 ",width="+w + 
                 ",height="+h + 
                 ",left="+posx + 
                 ",top="+posy; 
     	var ventana = window.open(direccion,"fb",opciones); 
}
