// JavaScript Document

var ns4 = (document.layers); 
var ie4 = (document.all && !document.getElementById); 
var ie5 = (document.all && document.getElementById); 
var ns6 = (!document.all && document.getElementById); 
function attach(id)
{
 var obj
  if(ns4) obj = document.layers[id];
  else if(ie4) obj = document.all[id];
   else if(ie5 || ns6) obj = document.getElementById(id);
  return obj
} 

function goUrl(url){
	window.location=url;
}

function validaDel(id,nombre,url){
	msg="¿Desea borrar "+ nombre +"?\n Los datos no se podran recuperar.";
	if (confirm(msg)){
		window.location=url+"?ac=borrar&id="+id;
		}
}
function w_validaDel_invisahotel(id_hotel,id_usuario,nombre,url){
	msg="¿Desea borrar "+ nombre +"?\n Los datos no se podran recuperar.";
	if (confirm(msg)){
		window.location=url+"?ac=borrar&id_hotel="+id_hotel+"&id_usuario="+id_usuario;
		}
}

//mostrar u ocultar elementos (layers, imagenes,....)
function XTClst(element){
	if (document.getElementById(element).style.visibility=='hidden'){
		document.getElementById(element).style.visibility = 'visible';
	}else{document.getElementById(element).style.visibility = 'hidden';}
}

//mostrar u ocultar elementos (layers, imagenes,....)
function XTCmostrar(element,estat){
	document.getElementById(element).style.visibility=estat;
}
//camvi css enllaços noticies OnMouseover
function lnknotiOver(id){
	//alert(obj  );
	var obj;
	if (document.getElementById('txnoti'+id)){
		document.getElementById('txnoti'+id).className= 'txt-noticias2';
		document.getElementById('hnoti'+id).className= 'tit-noticias2';
		document.getElementById('noti'+id).className= 'tit-noticias2';
	}else{
		obj='txnoti'+id;obj.className='txt-noticias2';
		obj='hnoti'+id;obj.className='tit-noticias2';
		obj='noti'+id;obj.className='tit-noticias2';
	}
}

//camvi css enllaços noticies OnMouseover
function lnknotiOut(id){
	//alert(obj  );
	if (document.getElementById('txnoti'+id)){
		document.getElementById('txnoti'+id).className= 'txt-noticias';
		document.getElementById('hnoti'+id).className= 'tit-noticias';
		document.getElementById('noti'+id).className= 'tit-noticias';
	}else{
		//obj.className=clase;
		obj='txnoti'+id;obj.className='txt-noticias';
		obj='hnoti'+id;obj.className='tit-noticias';
		obj='noti'+id;obj.className='tit-noticias';
	}
}


function act_idioma(nom_idioma,nom_desti,texte,lloc){
//alert(nom_idioma);
var camp=nom_idioma+nom_desti;
//alert(camp);
document.frm.elements[camp].value=texte.value;
XTCmsg(texte.value.length+" caracteres",lloc);
window.status=document.frm.elements[camp].value;
}

function idiomalang(nom_idioma2,idioma){
//alert(nom_idioma);
nom_idioma=idioma;
//alert(idioma);
//alert(nom_idioma);
}

function lnk(obj,clase){
//alert(obj  );
	if (document.getElementById(obj)){
		document.getElementById(obj).className= clase;
	}else{
		obj.className=clase;
	}
	//alert("ass");
}

function XTCtrans(cur,which){
	strength=(which==0)? 0.70 : 1
		if (cur.style.MozOpacity)
			cur.style.MozOpacity=strength
		else if (cur.filters)
			cur.filters.alpha.opacity=strength*100
}

function XTCbgcolor(objNom,color){
document.getElementById(objNom).style.backgroundColor=color;
}
function XTCbg(objNom,color){
		//alert(color);
document.getElementById(objNom).background=color;
}

function XTClnktaula(obj,clase){obj.className=clase;}

function XTCmsg(msg,lloc){
	if (document.all||document.getElementById){
	      if (document.getElementById) {
			document.getElementById(lloc).innerHTML = ""+msg+" ";
  			}
         else {
			lloc.innerHTML = ""+msg+" ";	
			}
   } 
}


lang='es';
var promptOn = true;




function capturaTecla(frm) 
    {
        if(document.all)
            tecla=event.keyCode;
        else
        {
            tecla=e.which; 
        }
     if(tecla==13)
        {
            //alert("a");//
			frm.value+="<br>";
        }
    }  
   // if ()
	//document.onkeydown = capturaTecla;


function AddMessageCode(code, promptText, InsertText, NombreTextarea) {
	if (code != "") {
		if (promptOn == true){
			insertCode = prompt(promptText + "\n<" + code + ">xxx</" + code + ">", InsertText);
				if ((insertCode != null) && (insertCode != "")){
					cadena="document.frm."+ NombreTextarea +  ".value +=\"<" + code + ">" + insertCode + "</" + code + ">\"";
					//alert(cadena);
					eval(cadena);
				}
		}
		else{
			//document.frmNews.NombreTextarea.value += "<" + code + "></" + code + ">";
			
			cadena="document.frm."+ NombreTextarea +  ".value +=\"<" + code + "></" + code + ">\"";
			eval(cadena);
		}
	}
				
	//document.frmNews.NombreTextarea.focus();
	cadena="document.frm."+ NombreTextarea +  ".focus()";
	eval(cadena);
}


function AddCode(code, NombreTextarea) {

	//Añadir un link a la pagina
	if ((code != "") && (code == "URL")) {
		insertText = prompt("Introduzca el texto del enlace (texto que se pulsará)", "");
			
			if ((insertText != null) && (insertText != "") && (code == "URL")){
				insertCode = prompt("Introduzca la URL (direccion web) a la que llevará el enlace.", "http://");
					
					if ((insertCode != null) && (insertCode != "") && (insertCode != "http://")){					
						//document.frmNews.NombreTextarea.value += '<a href="%27%20+%20insertCode%20+%20%27">' + insertText + '</a>';
						cadena="document.frm."+ NombreTextarea +  ".value +=\"<a href='%22%20+%20insertCode%20+%20%22' target='_blank' class='texto_normal'>" + insertText + "</a>\"";
						eval(cadena);
					}
			}
	}
	
	//Añadir email a la pagina
	if ((code != "") && (code == "EMAIL")) {
		insertText = prompt("Introduzca el texto del email (texto que se pulsará)", "");
			
			if ((insertText != null) && (insertText != "")){
				insertCode = prompt("Introduzca el E-mail (xxxx@yyy.zz) al que llevará el enlace.", "");
					
					if ((insertCode != null) && (insertCode != "")){					
					//document.frmNews.NombreTextarea.value += '<a href="mailto:' + insertCode + '">' + insertText + '</a>';
					cadena="document.frm."+ NombreTextarea +  ".value +=\"<a href='mailto:" + insertCode + "' target='_blank' class='texto_normal'>" + insertText + "</a>\"";
					//cadena="document.frmNews."+ NombreTextarea +  ".value +=\"<a href=\"mailto:" + insertCode + "\">" + insertText + "</a>\"";
					eval(cadena);
				}
			}
	}
	
	//Comentarios en verde en las páginas
	if ((code != "") && (code == "BLOQUE")) {
		insertText = prompt("Introduzca el título del comentario", "");
			
			if ((insertText != null) && (insertText != "")){
				insertCode = prompt("Introduzca el texto del comentario.", "");
					
					if ((insertCode != null) && (insertCode != "")){					
					//document.frmNews.NombreTextarea.value += '<a href="mailto:' + insertCode + '">' + insertText + '</a>';
					cadena="document.frm."+ NombreTextarea +  ".value +=\"<br><br><span class='tverd'><b>" + insertText + "</b><br><br>" + insertCode + "</span><br>\"";
					//cadena="document.frmNews."+ NombreTextarea +  ".value +=\"<a href=\"mailto:" + insertCode + "\">" + insertText + "</a>\"";
					eval(cadena);
				}
			}
	}
}






/////////////////////////////

function damunt(Imatge,img,lay,w,h,step_h,step_v,count_lay,num_lay) { 
	if (document.images) {  
		document[Imatge].src=img; 
		//rttreterte/
		//alert(lay);
		temp_Obj = attach(lay);
		//step_h = 10;
		//step_v = 10;
		//temp_Obj = attach(id); 
		if(ns4) { temp_Obj.visibility = "hidden";temp_Obj.zIndex = parseInt(3);document.parent.zIndex = parseInt(15);temp_Obj.top = parseInt(temp_Obj.top) - step_v; temp_Obj.left = parseInt(temp_Obj.left) - step_h; temp_Obj.visibility = "visible";
		}
		else {temp_Obj.style.visibility = "hidden";temp_Obj.style.zIndex = parseInt(100);temp_Obj.style.top = parseInt(temp_Obj.style.top) - step_v; temp_Obj.style.left = parseInt(temp_Obj.style.left) - step_h; temp_Obj.style.visibility = "visible";
				//*****************************************
				for (x=0;x<count_lay;x++){
				if(x==num_lay){
				document.getElementById("parent_"+x).style.zIndex=100;
				document.getElementById("lay_"+x).style.zIndex=101;
				}else{
					document.getElementById("parent_"+x).style.zIndex=x;
					document.getElementById("lay_"+x).style.zIndex=x;
					}
				}
				//window.status=lay+"-"+parent_1.style.zIndex;
				//*******************************************
		}
		document[Imatge].width=w;  
		document[Imatge].height=h;  
		//alert(temp_Obj.style.zIndex);
	} 
return temp_Obj;} 

function fora(Imatge,lay,w,h,step_h,step_v,count_lay) {  
	if (document.images) { 
		temp_Obj = attach(lay);
		//step_h = 10;
		//step_v = 10;
		//temp_Obj = attach(id);
		if(ns4) {temp_Obj.zIndex = parseInt(1);temp_Obj.top = parseInt(temp_Obj.top) + step_v; temp_Obj.left = parseInt(temp_Obj.left) + step_h; }
		else {temp_Obj.style.zIndex = parseInt(1);temp_Obj.style.top = parseInt(temp_Obj.style.top) + step_v; temp_Obj.style.left = parseInt(temp_Obj.style.left) + step_h; }
				//*****************************************
				for (x=0;x<count_lay;x++){
				
					document.getElementById("parent_"+x).style.zIndex=x;
					document.getElementById("lay_"+x).style.zIndex=x;
					
				}
	 			//window.status=lay+"-"+parent_1.style.zIndex;
				//*******************************************
		document[Imatge].width=w;
		document[Imatge].height=h;    
	} 
 return temp_Obj;} 



function popUpWindow(imag, left, top, width, height)
{
  popUpWin = open("../imagen.php?imag="+imag+"&w="+width+"&h="+height, 'popUpWin', 'scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin.focus();
}
function popUpWindow2(src, left, top, width, height)
{
  popUpWin2 = open(src, 'popUpWin2', 'scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin2.focus();
}

function mapa(urlmapa){
var windowX = (screen.width/2)-(800/2);
var windowY = (screen.height/2)-(600/2);
var localitzar = window.open(urlmapa,"imatge","width=798,height=550,scrollbars=yes,resizable=yes");
localitzar.moveTo(windowX,windowY);
localitzar.focus();
}



seleccionada='';

	
	var es=new Image(); 
	var esb=new Image(); 
	es.src="../_misc/es1.gif";
	esb.src="../_misc/es2.gif";
	
	var it=new Image(); 
	var itb=new Image(); 
	it.src="../_misc/it1.gif";
	itb.src="../_misc/it2.gif";
	
	var en=new Image(); 
	var enb=new Image(); 
	en.src="../_misc/en1.gif";
	enb.src="../_misc/en2.gif";
	
	var de=new Image(); 
	var deb=new Image(); 
	de.src="../_misc/de1.gif";
	deb.src="../_misc/de2.gif";
	
	var fr=new Image(); 
	var frb=new Image(); 
	fr.src="../_misc/fr1.gif";
	frb.src="../_misc/fr2.gif";
	
	/*var elpinar=new Image(); 
	var elpinarb=new Image(); 
	
	var losangeles=new Image(); 
	var losangelesb=new Image(); 
	
	var lasirena=new Image(); 
	var lasirenab=new Image(); 
	
	var ofertas=new Image(); 
	var ofertasb=new Image(); 
	
	var reservas=new Image(); 
	var reservasb=new Image(); 
	
	var ofertasmini=new Image(); 
	var ofertasminib=new Image(); 
	
	var reservasmini=new Image(); 
	var reservasminib=new Image(); */

//Camvia una imatge per una altre
function XTCrollIni(imatge,nova){
	document.getElementById(imatge).src=nova;
}

//Camvia una imatge per una altre
function XTCroll(imatge,nova){
	if (seleccionada!=imatge) document.getElementById(imatge).src=nova;
}

function XTCmenu(seleccionat){
	
	
	
	
	/*elpinar.src="../misc/elpinar1.jpg";
	elpinarb.src="../misc/elpinar2.jpg";
	
	losangeles.src="../misc/losangeles1.jpg";
	losangelesb.src="../misc/losangeles2.jpg";
	
	lasirena.src="../misc/lasirena1.jpg";
	lasirenab.src="../misc/lasirena2.jpg";
	
	ofertas.src="../misc/ofertas1_"+idioma+".jpg";
	ofertasb.src="../misc/ofertas2_"+idioma+".jpg";
	
	reservas.src="../misc/reservas1_"+idioma+".jpg";
	reservasb.src="../misc/reservas2_"+idioma+".jpg";
	
	ofertasmini.src="../misc/ofertasmini1_"+idioma+".jpg";
	ofertasminib.src="../misc/ofertasmini2_"+idioma+".jpg";
	
	reservasmini.src="../misc/reservasmini1_"+idioma+".jpg";
	reservasminib.src="../misc/reservasmini2_"+idioma+".jpg";*/
	
	
	
	
	
	
	/*seleccionada=seleccionat;
	if (seleccionat!="blaupark"){XTCrollIni('img_blaupark',blaupark.src);}else{XTCrollIni('img_blaupark',blauparkb.src);}
	if (seleccionat!="elpinar"){XTCrollIni('img_elpinar',elpinar.src);}else{XTCrollIni('img_elpinar',elpinarb.src);}
	if (seleccionat!="losangeles"){XTCrollIni('img_losangeles',losangeles.src);}else{XTCrollIni('img_losangeles',losangelesb.src);}
	if (seleccionat!="lasirena"){XTCrollIni('img_lasirena',lasirena.src);}else{XTCrollIni('img_lasirena',lasirenab.src);}*/
	
}


function validare_form(){
	var falta = "";
	var falta_entre="";
	var i,i_tmp,arg=validare_form.arguments; 
	for(i=2; i<arg.length; i=i+2){
		//alert(eval('document.toto.'+arg[i]+'.value'));
		temp_Obj = attach(arg[i+1]);
		//alert(typeof('document.'+arg[0]+'.'+arg[i+1]));
		//if(typeof('document.'+arg[0]+'.'+arg[i+1])!="undefined"  ){
		//
		if(arg[i]=='num'){
		//alert(eval('document.'+arg[0]+'.'+arg[i+1]+'.value'));
		//alert(!isNaN(eval('document.'+arg[0]+'.'+arg[i+1]+'.value')));
			var val_num= eval('document.'+arg[0]+'.'+arg[i+1]+'.value');
			//val_num = val_num.replace(' ','');
			val_num = val_num.replace('.','');
			//val_num = val_num.replace(',','');
			if(isNaN(val_num) || eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == '') {
				falta += "algo";//alert();
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
		else if(arg[i]=='ad_mail'){// (mail.indexOf("@")>=0) && (mail.indexOf(".")>=0)
			if((eval('document.'+arg[0]+'.'+arg[i+1]+'.value').indexOf("@")==-1) || (eval('document.'+arg[0]+'.'+arg[i+1]+'.value').indexOf(".")==-1)) {
				falta += "algo";
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
		else if(arg[i]=='uno_entre'){ //'uno_entre','Numero_campos_dependente','val_verif_campo_dependente','Nombre_campo_dependente',...
			var campos_dependente= arg[i+1];
			i=i+2;
			i=i+(2*campos_dependente);
			/* i_tmp=i;
			
			for(var cpt1=0;cpt1<campos_dependente;cpt1++){
				//temp_Obj = attach(arg[i+1]);
				if(eval('document.'+arg[0]+'.'+arg[i_tmp+1]+'.value') == arg[i_tmp]) {
					falta_entre += "algo";
				}
				i_tmp=i_tmp+2;
			}
			
			
				for(var cpt2=0;cpt2<campos_dependente;cpt2++){
					temp_Obj = attach(arg[i+1]);
					if(falta_entre != "") {
						//falta += "algo";
						if(ns4) { temp_Obj.color = 'red'; }
						else {temp_Obj.style.color = 'red'; }
					}
					else {
						if(ns4) { temp_Obj.color = 'black'; }
						else {temp_Obj.style.color = 'black'; }
					}
					i=i+2;
				} */
		}
		// multi mira la existencia de un campo, antes de verificar los demas
		else if(arg[i]=='multi'){//'multi','Numero_campos_dependente','val_verif_campo_master','nombre_campo_master','','nb_adulto',
			var campos_dependente= arg[i+1];
			//alert('document.'+arg[0]+'.'+arg[i+1]);
			i=i+2;
			temp_Obj = attach(arg[i+1]);
			if(eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == arg[i]) {
				falta += "algo";
				//alert('document.'+arg[0]+'.'+arg[i+1]+" "+i);
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
				//i=i+2;
				i=i+(2*campos_dependente);
				//alert('document.'+arg[0]+'.'+arg[i+1]+' '+campos_dependente);
			}
			else {
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
				//i=i+2;
				//temp_Obj = attach(arg[i+1]);
				for(var cpt=0;cpt<campos_dependente;cpt++){
					i=i+2;
					temp_Obj = attach(arg[i+1]);
					if(eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == arg[i]) {
						falta += "algo";
						if(ns4) { temp_Obj.color = 'red'; }
						else {temp_Obj.style.color = 'red'; }
					}
					else {
						if(ns4) { temp_Obj.color = 'black'; }
						else {temp_Obj.style.color = 'black'; }
					}
				}
			}
		}
		else if(arg[i]=='radio'){
			//alert(arg[i]);
			var flag_radio_ok=0;//alert(eval('document.'+arg[0]+'.'+arg[i+1]+'.length'));
			for(var q=0;q<eval('document.'+arg[0]+'.'+arg[i+1]+'.length');q++){
				if(eval('document.'+arg[0]+'.'+arg[i+1]+'['+q+'].checked')){
					flag_radio_ok=1;
				}
			}
			if(flag_radio_ok==0) {
				falta += "algo";
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
			//alert('document.'+arg[0]+'.'+arg[i+1]+" "+i);
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
		else if(arg[i]=='spe_bravo'){//'spe_bravo','Numero_campos_dependente','val_verif_campo_master','nombre_campo_master','val_campos_dependente','nombre_campos_dependente',
		
//'spe_bravo','4','checked','entrega','','entrega_aero_value','','entrega_hot_value','0','entrega_ofi_value','','entrega_otro_value'
			var campos_dependente= arg[i+1];
			//alert('document.'+arg[0]+'.'+arg[i+1]);
			i=i+2;
			temp_Obj = attach(arg[i+1]);
			
			
			var flag_radio_ok=0;//alert(eval('document.'+arg[0]+'.'+arg[i+1]+'.length'));
			var value_radio_ok="";
			for(var q=0;q<eval('document.'+arg[0]+'.'+arg[i+1]+'.length');q++){
				if(eval('document.'+arg[0]+'.'+arg[i+1]+'['+q+'].checked')){
					flag_radio_ok=1;
					//alert(eval('document.'+arg[0]+'.'+arg[i+1]+'['+q+'].value'));
					value_radio_ok=eval('document.'+arg[0]+'.'+arg[i+1]+'['+q+'].value');
					
				}
			}
			if(flag_radio_ok==0) {
				falta += "algo";
				//alert('document.'+arg[0]+'.'+arg[i+1]+" "+i);
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
				//i=i+2;
				i=i+(2*campos_dependente);
				//alert('document.'+arg[0]+'.'+arg[i+1]+' '+campos_dependente);
			}
			else {
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
				//i=i+2;
				//temp_Obj = attach(arg[i+1]);
				for(var cpt=0;cpt<campos_dependente;cpt++){
					i=i+2;
					temp_Obj = attach(arg[i+1]);
					//alert(+'');
					if((arg[i+1]=='entrega_'+value_radio_ok+'_value') && eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == arg[i]) {
						falta += "algo";
						if(ns4) { temp_Obj.color = 'red'; }
						else {temp_Obj.style.color = 'red'; }
					}
					else {
						if(ns4) { temp_Obj.color = 'black'; }
						else {temp_Obj.style.color = 'black'; }
					}
				}
			}
		}
		else{
			//alert(arg[i]);
			if(eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == arg[i]) {
				falta += "algo";
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
			//alert('document.'+arg[0]+'.'+arg[i+1]+" "+i);
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
	}
	if (falta != "") {
		falta =' '+arg[1]+' ';
		alert(falta);
		return false;
	}
	else {
		return true;
	}
}




function validare_form_submit(){
	var falta = "";
	var falta_entre="";
	var i,i_tmp,arg=validare_form_submit.arguments; 
	for(i=2; i<arg.length; i=i+2){
		//alert(eval('document.toto.'+arg[i]+'.value'));
		temp_Obj = attach(arg[i+1]);
		//alert(typeof('document.'+arg[0]+'.'+arg[i+1]));
		//if(typeof('document.'+arg[0]+'.'+arg[i+1])!="undefined"  ){
		//
		if(arg[i]=='num'){
		//alert(eval('document.'+arg[0]+'.'+arg[i+1]+'.value'));
		//alert(!isNaN(eval('document.'+arg[0]+'.'+arg[i+1]+'.value')));
			var val_num= eval('document.'+arg[0]+'.'+arg[i+1]+'.value');
			//val_num = val_num.replace(' ','');
			val_num = val_num.replace('.','');
			//val_num = val_num.replace(',','');
			if(isNaN(val_num) || eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == '') {
				falta += "algo";//alert();
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
		else if(arg[i]=='ad_mail'){// (mail.indexOf("@")>=0) && (mail.indexOf(".")>=0)
			if((eval('document.'+arg[0]+'.'+arg[i+1]+'.value').indexOf("@")==-1) || (eval('document.'+arg[0]+'.'+arg[i+1]+'.value').indexOf(".")==-1)) {
				falta += "algo";
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
		// multi mira la existencia de un campo, antes de verificar los demas
		else if(arg[i]=='multi'){//'multi','Numero_campos_dependente','val_verif_campo_master','nombre_campo_master','','nb_adulto',
			var campos_dependente= arg[i+1];
			//alert('document.'+arg[0]+'.'+arg[i+1]);
			i=i+2;
			temp_Obj = attach(arg[i+1]);
			if(eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == arg[i]) {
				falta += "algo";
				//alert('document.'+arg[0]+'.'+arg[i+1]+" "+i);
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
				//i=i+2;
				i=i+(2*campos_dependente);
				//alert('document.'+arg[0]+'.'+arg[i+1]+' '+campos_dependente);
			}
			else {
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
				//i=i+2;
				//temp_Obj = attach(arg[i+1]);
				for(var cpt=0;cpt<campos_dependente;cpt++){
					i=i+2;
					temp_Obj = attach(arg[i+1]);
					if(eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == arg[i]) {
						falta += "algo";
						if(ns4) { temp_Obj.color = 'red'; }
						else {temp_Obj.style.color = 'red'; }
					}
					else {
						if(ns4) { temp_Obj.color = 'black'; }
						else {temp_Obj.style.color = 'black'; }
					}
				}
			}
		}
		else if(arg[i]=='radio'){
			//alert(arg[i]);
			var flag_radio_ok=0;//alert(eval('document.'+arg[0]+'.'+arg[i+1]+'.length'));
			for(var q=0;q<eval('document.'+arg[0]+'.'+arg[i+1]+'.length');q++){
				if(eval('document.'+arg[0]+'.'+arg[i+1]+'['+q+'].checked')){
					flag_radio_ok=1;
				}
			}
			if(flag_radio_ok==0) {
				falta += "algo";
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
			//alert('document.'+arg[0]+'.'+arg[i+1]+" "+i);
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
		else{
			//alert(arg[i]);
			if(eval('document.'+arg[0]+'.'+arg[i+1]+'.value') == arg[i]) {
				falta += "algo";
				if(ns4) { temp_Obj.color = 'red'; }
				else {temp_Obj.style.color = 'red'; }
			}
			else {
			//alert('document.'+arg[0]+'.'+arg[i+1]+" "+i);
				if(ns4) { temp_Obj.color = 'black'; }
				else {temp_Obj.style.color = 'black'; }
			}
		}
	}
	if (falta != "") {
		falta =' '+arg[1]+' ';
		alert(falta);
		return false;
	}
	else {
		eval('document.'+arg[0]+'.submit()');
		return true;
	}
}

