	//popup de fotos desde fichas de robot o coche canal futuro
	function openPopupFoto(idFoto, nombre){
		url = "/executables/fut.popupfotoficha.asp?idf=" + idFoto + "&n=" + nombre
		title = ""
		params = "width=720,height=500,locationbars=no"
		window.open(url,title,params);
	}
	
	function openPopupFelicitacion(){
		window.open("/appexternas/felicitaciones_navidenas/index.asp","","width=740,height=424,menubar=0,locationbar=0")
	}
	
/************************
	Funciones utilizadas
	en todo el web	
	*********************/
	function _trim(bMinimoEspacio) {
	
	   var retValue = this;
	   var ch = retValue.substring(0, 1);
	   while (ch == " ") {
		  retValue = retValue.substring(1, retValue.length);
		  ch = retValue.substring(0, 1);
	   }
	   ch = retValue.substring(retValue.length-1, retValue.length);
	   while (ch == " ") {
		  retValue = retValue.substring(0, retValue.length-1);
		  ch = retValue.substring(retValue.length-1, retValue.length);
	   }
	   
	   if (bMinimoEspacio){
		   while (retValue.indexOf("  ") != -1) { 
			  retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
		   }
	   }
	   return retValue;
	} 
	String.prototype.trim = _trim;	
	
	//Trimea todos los campos de texto de un formulario
	function trimForm(refForm){
		for (var c = 0; c < refForm.length; c++){
			if (refForm[c].type == "text" || refForm[c].type == "textarea")
				refForm[c].value = refForm[c].value.trim();
		}
	}
	
		
	function compEmail (correo){
		var filter  = /^([a-zA-Z0-9_\.\-%%])+\@(([a-zA-Z0-9\-%%])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(correo))
			return true;
		else 
			return false;
	}

	//Abre ventana centrada respecto a monitor
	//Si otrosParams != NULL, se adjunta a 3º param de window.open	
	function popupCentrado(url,anchoVent,altoVent,titVent,otrosParams){
		posX = (screen.width /2) -  (anchoVent/2)
		posY = (screen.height /2) -  (altoVent/2)
		if (titVent == null || titVent == "")
			titVent = "Toyota"
			
		params = "top=" + posY + ",left=" + posX + ",width=" + anchoVent+ ",height=" + altoVent
		if (otrosParams != null) 
			params += "," + otrosParams
		window.open(url,titVent,params)	
	}	
	
	function popupSubirFoto(){
		popupCentrado("/modulos/globales/uploadFotos/subirfoto.asp",780,500,"Introduce_tu_Foto","status=1")
	}
	
	function popupSubirFotoAlta(){
		popupCentrado("/modulos/globales/uploadFotos/subirFoto_altas.asp",780,300,"Introduce_tu_Foto","status=1")
	}	
	
	function toggleCapaDebug(){
		alert('si')
		cNomCapa = prompt("Introduce nombre de capa")
		valorDisplayActual = eval("document.all.capaDebug" + cNomCapa + ".style.display")
		nuevoValor = ""
		if (valorDisplayActual == "none") 
			nuevoValor = "block"
		else
			nuevoValor = "none"
		
		eval("document.all.capaDebug" + cNomCapa + ".style.display = '" + nuevoValor+ "'")
		
	
	}	