<!--

function celda_over(elmto,color){
	//elmto.style.backgroundColor = "#466085";
	elmto.style.backgroundColor = color;
}
		
function celda_out(elmto,color){
	//elmto.style.backgroundColor = "#62799A";
	elmto.style.backgroundColor = color;
}

function dar_foco(form){
	form.txtbuscar.focus();
	form.txtbuscar.value = '';
}

	// Array de los meses
var monthNames = new makeArray(12);
monthNames[0] = "Enero";
monthNames[1] = "Febrero";
monthNames[2] = "Marzo";
monthNames[3] = "Abril";
monthNames[4] = "Mayo";
monthNames[5] = "Junio";
monthNames[6] = "Julio";
monthNames[7] = "Agosto";
monthNames[8] = "Septiembre";
monthNames[9] = "Octubre";
monthNames[10] = "Noviembre";
monthNames[11] = "Diciembre";

// Array de los días

var dayNames = new makeArray(7);
dayNames[0] = "Domingo";
dayNames[1] = "Lunes";
dayNames[2] = "Martes";
dayNames[3] = "Mi&eacute;rcoles";
dayNames[4] = "Jueves";
dayNames[5] = "Viernes";
dayNames[6] = "S&aacute;bado";

var now = new Date();
var year = now.getYear();

if (year < 2000) year = year + 1900;

function makeArray(len) 
{
for (var i = 0; i < len; i++) this[i] = null;
this.length = len;
}

function abrir_ventana(pagina,height,width)
{
	var opciones = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + width + ",height=" + height + ",top=0,left=30";
	window.open(pagina,"",opciones);
}

function Detalle(Codigo)
{
	window.location.href="noticias.asp?id=" + Codigo;
}


function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


function MM_findObj(n, d) { 
  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 validar_formulario_contacto(form)
   {
   	 var nombre = form.nombre.value;
	 var email = form.email.value;
	 var sugerencias = form.sugerencias.value;
     if (nombre.length == 0) {
        alert("Debe rellenar los campos obligatorios");           
     } 
	 else if (!email.match("@")){
	 	alert("Debe rellenar el email o verifique que sea correcto!");
		form.email.value="";
	 }
	 else if (sugerencias.length == 0) {
        alert("Debe rellenar los campos obligatorios");           
     } 
	 else { 
        form.action="enviar_email.php?form=contacto";
        form.submit();
     }                                                                          
   } 


function validar_formulario_empleo(form,ventana)
   {
     var nombre = form.nombre.value;
     var apellidos = form.apellidos.value;
	 var telefono = form.telefono.value;
	 var email = form.email.value;
	 if (nombre.length == 0  || apellidos.length == 0 || telefono.length == 0) {
        alert("Debe rellenar los campos obligatorios");           
        form.nombre.value="";                                                    
        form.apellidos.value=""; 
		form.telefono.value="";                                                   
     } 
	 else { 
        form.action="enviar_email.php?form=" + ventana;
        form.submit();
     }                                                                          
   } 


function validar_acceso(form)
   {
     var llogin = form.usuario.value;
     var lpass = form.pwd.value;
     if (llogin.length == 0  || lpass.length == 0) {
        alert("Debe introducir el Usuario y Contraseña");           
        form.usuario.value="";                                                    
        form.pwd.value="";                                                     
     } else { 
        form.action="index.php?navegacion=soporte";
        form.submit();
     }                                                                          
   } 


function cambiar_fecha(fecha)
{
	var ano;var mes; var dia; 
	ano = fecha.substring(4,0);
	mes = fecha.substring(7,5);
	dia = fecha.substring(10,8);
	return( ano + '/' + mes + '/' + dia);
}	

function confirmar(intcodigo)
	{
		return confirm("Desea borrar la noticia " + intcodigo + "?");
	}

function campos(){
	if (form2.titulo.value.length > 250)
	{	
		alert('Campo título demasiado largo');
		return false;
	}
	//if (form2.noticia.value.length > 1000)
	//{
	//	alert('Campo noticia demasiado largo');
	//	return false;
	//}
	a=0
	Msg= "Campo requerido: "
	comprobar(form2.titulo.value, "Título");
	comprobar(form2.fecha.value, "Fecha");
	if (a == 0)
		return true;
	else
	{
		alert(Msg);
		return false;
	}
}
	
function comprobar(strCampo, strMsg)
{
	if (strCampo == "")
	{
		Msg=Msg + ", " + strMsg;
		a = 1;
	}
}


function into(td,color)
	{
		td.style.cursor='default';td.bgColor=color;
	}
	
function outoff(td,color)
	{
		td.style.cursor='default';td.bgColor=color;
	}

var shownsection = 0;
function faqswitch(idnum)
{
	if(document.getElementById){
		if(document.getElementById("faqdiv"+idnum)){
			var elem = document.getElementById("faqdiv"+idnum);
			var hdr = document.getElementById("faqHeader"+idnum)
			if(elem == null) { return; }
			if(elem.style.display == "none")
			{
				if(hdr != null)	{	hdr.className="faqHeaderOpen";	}
				elem.style.display = "block";
				if(document.getElementById("faqplus"+idnum)){document.getElementById("faqplus"+idnum).style.display = "none";}
				if(document.getElementById("faqminus"+idnum)){document.getElementById("faqminus"+idnum).style.display = "";}
				if(document.getElementById("chevdown"+idnum)){document.getElementById("chevdown"+idnum).style.display = "none";}
				if(document.getElementById("chevup"+idnum)){document.getElementById("chevup"+idnum).style.display = "";}
			}
			else
			{
				elem.style.display = "none";
				if(hdr != null)	{	hdr.className="faqHeaderClosed";	}
				if(document.getElementById("faqplus"+idnum)){document.getElementById("faqplus"+idnum).style.display = "";}
				if(document.getElementById("faqminus"+idnum)){document.getElementById("faqminus"+idnum).style.display = "none";}
				if(document.getElementById("chevdown"+idnum)){document.getElementById("chevdown"+idnum).style.display = "";}
				if(document.getElementById("chevup"+idnum)){document.getElementById("chevup"+idnum).style.display = "none";}
			}
		}
		if (navigator.appName != "Netscape") //due to bug 7993, cancelBubble could make netscape hang, so do not use it in netscape. IE is fine.
			window.event.cancelBubble = true;
		return false;
	}
}
//-->