				
				//copiado del creatives.js añadiendo "_13" a las id,nombres y nombres de función
				
				
				
				var fechaActual = new Date();
				var iniAnio = String(fechaActual.getFullYear());
				var iniMes = String(fechaActual.getMonth()+1);
				var iniDay = String(fechaActual.getDate()-1); 				
	
	function dinsOP_13(wacha,QUI,QuinSelect){
				form=(!document.frsv01_13)?document.getElementById('dasize_13').getElementsByTagName('form')[0]:document.frsv01_13;
				var newElement = document.createElement('option');
				newElement.setAttribute('value',QUI);
				document.frsv01_13.elements[QuinSelect].appendChild(newElement);
				newElement.innerHTML = wacha;
				if(QUI.indexOf(',,,,')!=-1) newElement.style.color='#CC0000';
				if(QUI.substring(QUI.indexOf(',')+1)=='AZlist'){
					newElement.innerHTML = wacha.substring(13);
					newElement.style.color='#0099CC';}
				}
				
	function Month(month,ani){
				 var days;
				 if ((month==1)||(month==3)||(month==5)||(month==7)||(month==8)||(month==10)||(month==12)) days=31;
				 else if ((month==4) || (month==6) || (month==9) || (month==11)) days=30;
				 else if (month==2){ 
				  var a=isLeap(ani);
				  if (a)days=29;
				  else days=28;
				  }
				  return (days);
				  }
	function isLeap (Year){
				 if ( ((Year % 4)==0) & ((Year % 100)!=0) || ((Year % 400)==0) )return (true);
				 else  return (false);
				 }
	function doItRight_13(){
		if((parseFloat(iniDay)+14)>=days){
			BBday=(parseFloat(iniDay)+14)-days;
			document.frsv01_13.mesE_13.options[document.frsv01_13.mesE_13.selectedIndex+1].selected=true;putDaDay_13('diaE_13',document.frsv01_13.mesE_13);	
			document.frsv01_13.mesS_13.options[document.frsv01_13.mesE_13.selectedIndex].selected=true;putDaDay_13('diaS_13',document.frsv01_13.mesS_13);
			document.frsv01_13.diaE_13.options[BBday].selected=true;		
			}
		else{ BBday=(parseFloat(iniDay)+14);
			  document.frsv01_13.diaE_13.options[BBday].selected=true;}
		if((BBday+3)>=days){
			Fday=(parseFloat(BBday)+3)-days;
			if(document.frsv01_13.mesS_13.selectedIndex<document.frsv01_13.mesE_13.selectedIndex){ document.frsv01_13.mesS_13.selectedIndex=document.frsv01_13.mesE_13.selectedIndex;putDaDay_13('diaS_13',document.frsv01_13.mesS_13);}
			else document.frsv01_13.mesS_13.options[document.frsv01_13.mesE_13.selectedIndex+1].selected=true;putDaDay_13('diaS_13',document.frsv01_13.mesS_13);
			document.frsv01_13.diaS_13.options[Fday].selected=true;
			}
		else {Fday=(parseFloat(BBday)+3);
			 document.frsv01_13.diaS_13.options[Fday].selected=true;}
			} 
	function monthOK_13(){if(document.frsv01_13.mesS_13.selectedIndex<document.frsv01_13.mesE_13.selectedIndex) document.frsv01_13.mesS_13.selectedIndex=document.frsv01_13.mesE_13.selectedIndex;}
	function putDaDay_13(wachaD,wachaM){
		mes=parseFloat(wachaM.value.substring(4));
		any=parseFloat(wachaM.value.substring(0,4));
		elQtoca=parseFloat(document.getElementById(wachaD).value)-1;
		days=Month(mes,any);
		document.getElementById(wachaD).innerHTML='';
		for (o=1;o<=days;o++){
		JDay=(o<10)? '0'+o:String(o);
		dinsOP_13(JDay,JDay,wachaD);
		}
		document.getElementById(wachaD).options[elQtoca].selected=true;
		} 
	
		compat= new Array('com*hus','ie*hie','co.uk*huk','es*hes','fr*hfr','de*hde','nl*hnl','it*hit','com*wgrav');
			
	function goToSearch_13(){fdest_13=document.frsv01_13.destino_13.value;
		if(!XvX){
		for(i=0;i<compat.length;i++){
			if(compat[i].substring(compat[i].indexOf('*')+1)==b){
			document.frsv01_13.action="http://www.hotelopia."+compat[i].substring(0,compat[i].indexOf('*'))+"/search.jsp";
			document.frsv01_13.codWeb.value=b; break;}
			}} 
		if(fdest_13.indexOf('AZlist')!=-1) {document.frsv01_13.action='http://www.hotelopia.'+compat[i].substring(0,compat[i].indexOf('*'))+'/az_list.jsp?let=A&country=All';document.frsv01_13.submit();document.frsv01_13.action=''; return;}
		if(document.frsv01_13.mesE_13.selectedIndex > document.frsv01_13.mesS_13.selectedIndex || (document.frsv01_13.diaE_13.selectedIndex>=document.frsv01_13.diaS_13.selectedIndex && document.frsv01_13.mesE_13.selectedIndex == document.frsv01_13.mesS_13.selectedIndex)) { alert(wrongDates); return;}
		if(fdest_13=='000') { alert(noDest);document.frsv01_13.destino_13.focus(); return;}
		if(fdest_13.indexOf(',,,,')!=-1) { alert(wrongDest);document.frsv01_13.destino_13.focus(); return;}
		cargardestino_13(form,fdest_13);
		document.getElementById('mesE_13').style.color='#FFFFFF';
		document.getElementById('mesS_13').style.color='#FFFFFF';
		document.frsv01_13.target='_blank';
		
		//arreglando zanox
		document.frsv01_13.destino_13.name = "destino";
		document.frsv01_13.diaE_13.name = "diaE";
		document.frsv01_13.mesE_13.name = "mesE";
		document.frsv01_13.diaS_13.name = "diaS";
		document.frsv01_13.mesS_13.name = "mesS";
		document.frsv01_13.nhab_13.name = "nhab";
		document.frsv01_13.nad_13.name = "nad";
		document.frsv01_13.nnins_13.name = "nnins";
		
		document.frsv01_13.submit();
		document.frsv01_13.mesE_13.value=String(parseInt(document.frsv01_13.mesE_13.value));
		document.frsv01_13.mesS_13.value=String(parseInt(document.frsv01_13.mesS_13.value));
		document.getElementById('mesE_13').style.color='#000000';
		document.getElementById('mesS_13').style.color='#000000';
        document.frsv01_13.destino_13.selectedIndex=0;
		}
		
	function goToSearchradio(){fdest_13=document.frsv01_13.destino_13.value; 
		for(i=0;i<compat.length;i++){
			if(compat[i].substring(compat[i].indexOf('*')+1)==b){
			document.frsv01_13.action="http://www.hotelopia."+compat[i].substring(0,compat[i].indexOf('*'))+"/search.jsp";
			document.frsv01_13.codWeb.value=b; break;}
			} 
		if(fdest_13.indexOf('AZlist')!=-1) {document.frsv01_13.action='http://www.hotelopia.'+compat[i].substring(0,compat[i].indexOf('*'))+'/az_list.jsp?let=A&country=All';document.frsv01_13.submit();document.frsv01_13.action=''; return;}
		if(document.frsv01_13.mesE_13.selectedIndex > document.frsv01_13.mesS_13.selectedIndex || (document.frsv01_13.diaE_13.selectedIndex>=document.frsv01_13.diaS_13.selectedIndex && document.frsv01_13.mesE_13.selectedIndex == document.frsv01_13.mesS_13.selectedIndex)) { alert(wrongDates); return;}
		
		if(document.frsv01_13.radioDest.checked){ fdest_13 = document.frsv01_13.radioDest.value; }
		for (var i=0; i<document.frsv01_13.radioDest.length; i++) { if (document.frsv01_13.radioDest[i].checked){	fdest_13 = document.frsv01_13.radioDest[i].value; break; } }
		
		if(fdest_13=='000') { alert(noDest);document.frsv01_13.destino_13.focus(); return;}
		if(fdest_13.indexOf(',,,,')!=-1) { alert(wrongDest);document.frsv01_13.destino_13.focus(); return;}
		cargardestino_13(form,fdest_13);
		document.getElementById('mesE_13').style.color='#FFFFFF';
		document.getElementById('mesS_13').style.color='#FFFFFF';
		document.frsv01_13.target='_blank';
		
		
		document.frsv01_13.destino_13.name = "destino";
		document.frsv01_13.mesE_13.name = "mesE";
		document.frsv01_13.mesS_13.name = "mesS";
		document.frsv01_13.diaE_13.name = "diaE";
		document.frsv01_13.diaS_13.name = "diaS";
		document.frsv01_13.nhab_13.name = "nhab";
		document.frsv01_13.nad_13.name = "nad";
		document.frsv01_13.nnins_13.name = "nnins";
		
		document.frsv01_13.submit();
		document.frsv01_13.mesE_13.value=String(parseInt(document.frsv01_13.mesE_13.value));
		document.frsv01_13.mesS_13.value=String(parseInt(document.frsv01_13.mesS_13.value));
		document.getElementById('mesE_13').style.color='#000000';
		document.getElementById('mesS_13').style.color='#000000';
        document.frsv01_13.destino_13.selectedIndex=0;		
		}
		
		function cargardestino_13(Qform, destinoCompacto){
			document.frsv01_13.codagrdest.value=""; document.frsv01_13.coddest.value=""; document.frsv01_13.codagrzon.value=""; document.frsv01_13.codzon.value="";
			arraydestino = destinoCompacto.split(',');
			if(arraydestino.length < 2){ return false; } document.frsv01_13.nomdest.value =arraydestino[0]; 
			if(arraydestino[1]!=""){ document.frsv01_13.codagrdest.value = arraydestino[1]; return true; }
			if(arraydestino.length >= 3){
				if(arraydestino[2]!=""){
					document.frsv01_13.coddest.value = arraydestino[2];
					if(arraydestino.length >= 4 && arraydestino[3]!=""){ document.frsv01_13.codagrzon.value = arraydestino[3]; }
					if(arraydestino.length == 5 && arraydestino[4]!=""){ document.frsv01_13.codzon.value =  arraydestino[4]; }
					return true;
				}
			}
			return false;
		}
		
		function goToGate(){
		for(i=0;i<compat.length;i++){
			if(compat[i].substring(compat[i].indexOf('*')+1)==b){
			document.frsv01_13.action="http://www.hotelopia."+compat[i].substring(0,compat[i].indexOf('*'))+"/home/destinations/gateways.jsp";
			document.frsv01_13.codWeb.value=b;}
			}
		if(document.frsv01_13.destino_13.value=='000') {alert(noDest); return}
		nomDEgat = document.frsv01_13.destino_13.options[document.frsv01_13.destino_13.selectedIndex].value;
		nomDEgat=nomDEgat.toLowerCase();
		document.frsv01_13.gateway.value=nomDEgat;
		document.frsv01_13.target='_blank';
		
		//arreglando zanox
		document.frsv01_13.destino_13.name = "destino";
		
		document.frsv01_13.submit();
		}
		
		function clearRadioDest(form) { document.frsv01_13.radioDest.checked = false;
		for (var i=0; i<document.frsv01_13.radioDest.length; i++) { document.frsv01_13.radioDest[i].checked = false; } }
