<!--
function ventana(pagina,nombreventana) {
	myWin=open(pagina,nombreventana,'width=510,height=340,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no');
}
function muestraFoto(foto) {

	myWin=open('mostrarImagen.asp?imagen=' + foto.src ,"imagen",'width=,height=,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no');

}

function MM_jumpMenuNavegacion(targ,selObj,restore){ //v3.0
  if (selObj.options[selObj.selectedIndex].value != 0 && selObj.options[selObj.selectedIndex].value.substring(0,10) != "javascript")
  {
 	 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  }else{
   		if (selObj.options[selObj.selectedIndex].value.substring(0,10) == "javascript" ){
		eval(selObj.options[selObj.selectedIndex].value);
		}
  }
  if (restore) selObj.selectedIndex=0;
}


var msgJSRellenarCampos = "Ha de rellenar bien todos los campos";

	 function  verificaFormulario(){
//		var retorno = verificaEmail(document.formRegistro.email.value) && verificaPassword() && contenidos("formRegistro");
		var retorno = verificaEmail(document.formRegistro.email.value) && contenidos("formRegistro") && verificaPassword() ;
		return retorno;
	}// end fun
	function contenidos(formulario){
		var retorno = true;
		
		for (i=0;i < document[formulario].elements.length;i++){
			
			if ((document[formulario].elements[i].type == "text" || document[formulario].elements[i].type == "textarea" || document[formulario].elements[i].type == "select-one" ) && document[formulario].elements[i].name != "fax" && document[formulario].elements[i].name != "telefono"){

				if (document[formulario].elements[i].value == "" ){
					retorno= false;
					document[formulario].elements[i].focus();
				}
			}
		}
		if (retorno == false) alert ("<%=msgJSRellenarCampos%>");
		return retorno;
	}
 	function  borraFormulario(formulario){

		for (i=0;i < document[formulario].elements.length;i++){

			if(document[formulario].elements[i].type == "text" || document[formulario].elements[i].type == "textarea" )
			document[formulario].elements[i].value = "";
			else if (document[formulario].elements[i].type == "checkbox")
			document[formulario].elements[i].checked = 0;
			else if (document[formulario].elements[i].type == "password")
			document[formulario].elements[i].value = "";
			}
	//alert(document[formulario].elements[i].type);
	}// end fun
	function verificaPassword(){
		if ((document.formRegistro.pass1.value != document.formRegistro.pass2.value) || document.formRegistro.pass1.value == "" ){
		
			alert("<%=msgCoincidirPass%>");
			return false;
		}
	}//end fun
	function verificaEmail(texto){

    var mailres = true;            
    var cadena = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890@._-";
    
    var arroba = texto.indexOf("@",0);
    if ((texto.lastIndexOf("@")) != arroba) arroba = -1;
    
    var punto = texto.lastIndexOf(".");
                
     for (var contador = 0 ; contador < texto.length ; contador++){
        if (cadena.indexOf(texto.substr(contador, 1),0) == -1){
            mailres = false;
            break;
     }
    }

    if ((arroba > 1) && (arroba + 1 < punto) && (punto + 1 < (texto.length)) && (mailres == true) && (texto.indexOf("..",0) == -1))
     mailres = true;
    else
	alert("<%=getEtiqueta('email No valido')");
     mailres = false;
                
    return mailres;
} 	
	function campoLetras(){
		//alert(event.keyCode)
		if ((event.keyCode < 65 || event.keyCode > 90) && (event.keyCode < 97 || event.keyCode > 122) && event.keyCode != 32 && event.keyCode != 241 && event.keyCode != 39)  {
			alert("<%=msgJSCharEspace%>")
			event.returnValue = false;
		}
	}
	function campoNumerosLetras(){
		//alert(event.keyCode)
				if ((event.keyCode < 65 || event.keyCode > 90) && (event.keyCode < 97 || event.keyCode > 122) && (event.keyCode < 48 || event.keyCode > 57) && event.keyCode != 241)  {
			alert("<%=msgJSCharNumber%>")
			event.returnValue = false;
		}
	}
	function campoNumerosGuion(){
		if ((event.keyCode < 48 || event.keyCode > 57) && event.keyCode != 45 )  {
			alert("<%=msgJSNumberGuion%>")
			event.returnValue = false;
		}
	}
	function campoEmail(){
		//@=64;.=46;_=95_;-=45;
		//alert(event.keyCode)
		if ((event.keyCode < 64 || event.keyCode > 90) && (event.keyCode < 97 || event.keyCode > 122) && (event.keyCode < 48 || event.keyCode > 57) && event.keyCode != 45 && event.keyCode != 46 && event.keyCode != 95)  {
			alert("<%=msgJSEmail%>")
			event.returnValue = false;
		}
	}
	function longitudCadena(cadena,longitud){
	var cadenaLen = cadena.length;
		if (cadenaLen >= longitud){
		
			alert("<%=msgJSMaxChar%>" + longitud + "<%=etiJSCaracter%>");
			event.returnValue = false;
		}
	}
//-->

/* ----------------------------------------------------------------
addClass(element, value)
	
Función para añadir una clase CSS, (atributo className),
teniendo en cuenta si ya tenía previamente una clase o no.
Si es así la concatena, quedando del estilo:
	
class="clase1 clase2"
	
Parámetros:
	- element:  Elemento al que se añadirá la clase.
	- value:    Valor para la nueva clase.

Ejemplos de uso:
	- Añadimos la clase "bar" al elemento con "id" igual
	  a "foo".
		
	  var foo = document.getElementById("foo");
	  addClass(foo, "bar");
---------------------------------------------------------------- */
function addClass(element, value) {
	if (!element.className) {
		element.className = value;
	} else {
		var newClassName = element.className;
		newClassName += " ";
		newClassName += value;
		element.className = newClassName;
	}
}
function removeClass(obj,cName) {
	if (!hasClass(obj,cName)) return false;
	var rep=obj.className.match(' '+cName)?' '+cName:cName;
	obj.className=obj.className.replace(rep,'');
	return true;
	}