function cambiocolor(obj){
	obj.style.backgroundColor = "#FFFFFF"
}
function quitocolor(obj){
	obj.style.backgroundColor = "#EBEBEB"
}
function cambiocolor1(obj){
	obj.style.backgroundColor = "#FFFFFF"
}
function quitocolor1(obj){
	obj.style.backgroundColor = "#FFF8D9"
}


function salta(destino,seleccion,restore){
	  
  if (seleccion.options[seleccion.selectedIndex].value != 0) {
		  
	  eval(destino+".location='"+seleccion.options[seleccion.selectedIndex].value+"'");
	  if (restore) seleccion.selectedIndex=0;
		}
}

function IsDigit()
{
	return (((event.keyCode >= 48) && (event.keyCode <= 57)) ||  (event.keyCode == 37))
}

function AbrirVentana(theURL,winName,features,ancho,alto)
{
   
	neu=window.open(theURL,winName,features);
	neu.focus()
	neu.moveTo(Math.round((screen.availWidth-ancho)/2),Math.round((screen.availHeight-alto)/2))  
}
 function Arroba(sString)
		{
			var str = sString.value
			
			if (str != ''){
				// Return false if e-mail field does not contain a '@' and '.' .   
				if (str.indexOf ('@',0) == -1 || str.indexOf ('.',0) == -1)
				{
					alert('Introduzca correctamente el E-mail')
					sString.focus()
					return false;     
				}else{
					return true;      
				}
			}else{
				return true;
			}
		}


// Si es vacio devuelve FALSE
function compruebavacio(contenido)  {
     if (contenido.length==0) {
	      return false;
	   } else {
		   for (var i=0; i<contenido.length; ++i) {
		   	  if (contenido.charAt(i)!=' ' )
		         {
				   return true;
		         } 
		   }
	   }
	   return false; 
}
function LMax(obj,num){
	if(obj.value.length>num){
		obj.value = obj.value.substring(0,num);
		alert ("EL TEXTO TIENE QUE SER UN MAXIMO DE "+num+" CARACTERES.");
		return false
	}else{
		return true;
	}
}

function LongitudTextoArea(elemento, longitud) {
	longitud_maxima = longitud;
    longitud_texto = elemento.value.length;
    if (longitud_texto > longitud_maxima) {
	  elemento.value = elemento.value.substring(0,longitud_maxima);
	  alert ("EL TEXTO TIENE QUE SER UN MAXIMO DE 250 CARACTERES.");
		  return false
	 } else {
		  return true;
	 }
}
