if(typeof DOLTRONIC=="undefined"||!DOLTRONIC){
	var DOLTRONIC={}
}

DOLTRONIC.DOM=function(){
	if(!document.getElementById)
		return 0
};

DOLTRONIC.DOM.prototype.tag=function(_tag,id){
	try{
		return(id?id:doc).getElementsByTagName(_tag)
	}catch(e){
		var debug=new DOLTRONIC.DEBUG(true);
		debug.log("ERROR: no such element exists, TAG = "+_tag+" in ID = "+id)
	}
};

DOLTRONIC.DOM.prototype.cL=function(pointer,style_dir,style_file,baseUrl,url){
	var newCSSLink=style_dir?baseUrl+style_dir+"/"+style_file:url;
	var found=false;
	var base=location.href.substring(0,location.href.lastIndexOf('/'));
	var newBaseCSSLink="";
	if(newCSSLink[0]==="."){
		newBaseCSSLink=base+newCSSLink.substring(1)
	}else{
		newBaseCSSLink=base+newCSSLink
	}
	var cssLinks=document.getElementsByTagName("head")[0];
	for(i=0;i<cssLinks.childNodes.length;i++){
		var tName=cssLinks.childNodes[i].tagName;
		if(tName==='LINK'){
			var cssHref=cssLinks.childNodes[i].href;
			if(cssHref===newBaseCSSLink){
				found=true
			}
		}
	}
	if(!found){
		var _link=document.createElement("link");
		if(!_link)
			return 0;
		_link.type="text/css";
		_link.rel="stylesheet";
		_link.href=newCSSLink;
		if(pointer.oP.debug){
			pointer.oP.trace.log("[DOLTRONIC.DOM.cL] - style sheet "+_link.href+" [loaded]")
		}
		document.getElementsByTagName("head")[0].appendChild(_link)
	}
};

DOLTRONIC.DOM.prototype.cS=function(pointer,url){
	var found=false;
	var jsURL=document.getElementsByTagName("head")[0];
	for(i=0;i<jsURL.childNodes.length;i++){
		var tType=jsURL.childNodes[i].nodeType;
		if(tType==1){
			var tName=jsURL.childNodes[i].tagName;
			if(tName==='SCRIPT'){
				if(jsURL.childNodes[i].src!=undefined){
					var jsHref=jsURL.childNodes[i].src;
					if(jsHref===url){
						found=true
					}
				}
			}
		}
	}
	if(!found){
		var _script=document.createElement("script");
		if(!_script)
			return 0;
		_script.type="text/javascript";
		_script.src=url;
		if(pointer.oP.debug){
			pointer.oP.trace.log("[DOLTRONIC.DOM.cS] - new JavaScript "+_script.src+" [loaded]")
		}
		document.getElementsByTagName("head")[0].appendChild(_script)
	}
};

DOLTRONIC.DOM.prototype.cE=function(type,attr,cont,html){
	var ne=document.createElement(type);
	if(!ne)
		return 0;
	for(var a in attr)
		ne[a]=attr[a];
	var t=typeof(cont);
	if(t=="string"&&!html)
		ne.appendChild(document.createTextNode(cont));
	else
		if(t=="string"&&html)
			ne.innerHTML=cont;
		else 
			if(t=="object")
				ne.appendChild(cont);
	return ne
};

DOLTRONIC.DOM.prototype.gE=function(e){
	var t=typeof(e);
	if(t=="undefined")
		return 0;
	else 
		if(t=="string"){
			var re=document.getElementById(e);
			if(!re)
				return 0;
			else 
				if(typeof(re.appendChild)!="undefined")
					return re;
				else
					return 0
		}else
			if(typeof(e.appendChild)!="undefined")
				return e;
			else 
				return 0
};

DOLTRONIC.DOM.prototype.remE=function(ele){
	var e=this.gE(ele);
		if(!e)
			return 0;
		else
			if(e.parentNode.removeChild(e))
				return true;
			else
				return 0
};

DOLTRONIC.DOM.prototype.getPos=function(e){
	var e=this.gE(e);
	var obj=e;
	var curleft=0;
	if(obj.offsetParent){
		while(obj.offsetParent){
			curleft+=obj.offsetLeft;
			obj=obj.offsetParent
		}
	}else
		if(obj.x)
			curleft+=obj.x;
	var obj=e;var curtop=0;
	if(obj.offsetParent){
		while(obj.offsetParent){
			curtop+=obj.offsetTop;
			obj=obj.offsetParent
		}
	}else 
		if(obj.y)
			curtop+=obj.y;
	return{x:curleft,y:curtop}
};

DOLTRONIC.DOM.prototype.getDimensionsViewPort=function(){
	var viewportwidth;
	var viewportheight;
	if(typeof window.innerWidth!='undefined'){
		viewportwidth=window.innerWidth;
		viewportheight=window.innerHeight
	}else 
		if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){
			viewportwidth=document.documentElement.clientWidth;viewportheight=document.documentElement.clientHeight
		}else{
			viewportwidth=document.getElementsByTagName('body')[0].clientWidth;viewportheight=document.getElementsByTagName('body')[0].clientHeight
		}
	return{width:viewportwidth,height:viewportheight}
};

DOLTRONIC.DOM.prototype.getDimensions=function(elt){
	var element=this.gE(elt);
	var display=this.gStyle(element,'display');
	if(display!='none'&&display!=null)
		return{width:element.offsetWidth,height:element.offsetHeight};
	var els=element.style;
	var originalVisibility=els.visibility;
	var originalPosition=els.position;
	var originalDisplay=els.display;
	els.visibility='hidden';
	els.position='absolute';
	els.display='block';
	var originalWidth=element.clientWidth;
	var originalHeight=element.clientHeight;
	els.display=originalDisplay;
	els.position=originalPosition;
	els.visibility=originalVisibility;
	return{width:originalWidth,height:originalHeight}
};

DOLTRONIC.DOM.prototype.gStyle=function(elt,style){
	function camelize(e){
		var parts=e.split('-'),len=parts.length;
		if(len==1)
			return parts[0];
		var camelized=e.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];
		for(var i=1;i<len;i++)
			camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);
		return camelized
	}
	var browser=new DOLTRONIC.BrowserDetect();
	if(browser.getBrowserName()!="Explorer"){
		var element=this.gE(elt);
		style=style=='float'?'cssFloat':camelize(style);
		var value=element.style[style];
		if(!value&&document.defaultView){
			var css=document.defaultView.getComputedStyle(element,null);
			value=css?css[style]:null
		}
		if(style=='opacity')
			return value?parseFloat(value):1.0;
		return value=='auto'?null:value
	}else{
		var element=this.gE(elt);
		style=(style=='float'||style=='cssFloat')?'styleFloat':camelize(style);
		var value=element.style[style];
		if(!value&&element.currentStyle)
			value=element.currentStyle[style];
		if(style=='opacity'){
			if(value=(this.getStyle(element,'filter')||'').match(/alpha\(opacity=(.*)\)/))
				if(value[1])
					return parseFloat(value[1])/100;return 1.0
		}
		if(value=='auto'){
			if((style=='width'||style=='height')&&(this.getStyle(element,'display')!='none'))
				return element['offset'+style.capitalize()]+'px';
			return null
		}
		return value
	}
};

DOLTRONIC.DOM.prototype.getElementsByClass=function(searchClass,node,tag){
	var classElements=new Array();
	if(node==null)
		node=document;
	if(tag==null)
		tag='*';
	var els=node.getElementsByTagName(tag);
	var elsLen=els.length;
	var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	var j=0;
	for(i=0;i<elsLen;i++){
		if(pattern.test(els[i].className)){
			classElements[j]=els[i];
			j++
		}
	}
	return classElements
};

DOLTRONIC.DOM.prototype.getAbsoluteDivs=function(){
	var arr=new Array();
	var all_divs=this.getElementsByClass("module",null,null);
	var j=0;
	var display;
	for(i=0;i<all_divs.length;i++){
		display=this.gStyle(all_divs[i],'position');
		if(display==="absolute"){
			arr[j]=all_divs[i];
			j++
		}
	}
	return arr
};

DOLTRONIC.DOM.prototype.cumulativeOffset=function(element){
	Element._returnOffset=function(l,t){
		var result=[l,t];
		result.left=l;
		result.top=t;
		return result
	};
	var browser=new DOLTRONIC.BrowserDetect();
	if(browser.getBrowserName()!="safari"){
		var valueT=0,valueL=0;
		do{
			valueT+=element.offsetTop||0;
			valueL+=element.offsetLeft||0;
			element=element.offsetParent
		}while(element);
		return Element._returnOffset(valueL,valueT)
	}else{
		var valueT=0,valueL=0;
		do{
			valueT+=element.offsetTop||0;
			valueL+=element.offsetLeft||0;
			if(element.offsetParent==document.body)
				if(Element.getStyle(element,'position')=='absolute')
					break;
			element=element.offsetParent
		}while(element);
		return Element._returnOffset(valueL,valueT)
	}
};

if(typeof DOLTRONIC=="undefined"||!DOLTRONIC){
	var DOLTRONIC={}
}

DOLTRONIC.Ajax=function(){
		this.req={}
};

DOLTRONIC.Ajax.prototype.makeRequest=function(url,request,meth,onComp,onErr){
	if(meth!="POST")
		meth="GET";
	this.onComplete=onComp;
	this.onError=onErr;
	var pointer=this;
	if(window.XMLHttpRequest){
		this.req=new XMLHttpRequest();
		this.req.onreadystatechange=function(){
			pointer.processReqChange()
		};
		this.req.open(meth,url,true);
		this.req.setRequestHeader("Content_Type","text/xml");
		this.req.send(request)
	}else 
		if(window.ActiveXObject){
			this.req=new ActiveXObject("Microsoft.XMLHTTP");
			if(this.req){
				this.req.onreadystatechange=function(){
					pointer.processReqChange()
				};
				this.req.open(meth,url,true);
				this.req.setRequestHeader("Content_Type","text/xml");
				this.req.send(request)
			}
		}
};

DOLTRONIC.Ajax.prototype.processReqChange=function(){
	if(this.req.readyState==4){
		if(this.req.status==200){
			this.onComplete(this.req)
		}else{
			this.onError(this.req.status)
		}
	}
};

if(typeof DOLTRONIC=="undefined"||!DOLTRONIC){
	var DOLTRONIC={}
}

DOLTRONIC.BrowserDetect=function(){
	this.dataBrowser=[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}];
	this.dataOS=[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}];
	this.versionSearchString="";
	this.init()
};

DOLTRONIC.BrowserDetect.prototype.init=function(){
	this.browser=this.searchString(this.dataBrowser)||"An unknown browser";
	this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";
	this.OS=this.searchString(this.dataOS)||"an unknown OS"
};

DOLTRONIC.BrowserDetect.prototype.searchString=function(data){
	for(var i=0;i<data.length;i++){
		var dataString=data[i].string;
		var dataProp=data[i].prop;
		this.versionSearchString=data[i].versionSearch||data[i].identity;
		if(dataString){
			if(dataString.indexOf(data[i].subString)!=-1)
				return data[i].identity
		}else 
			if(dataProp)
				return data[i].identity
	}
};

DOLTRONIC.BrowserDetect.prototype.searchVersion=function(dataString){
	var index=dataString.indexOf(this.versionSearchString);
	if(index==-1)
		return;
	return parseFloat(dataString.substring(index+this.versionSearchString.length+1))
};

DOLTRONIC.BrowserDetect.prototype.getBrowserName=function(){
	this.init();
	return this.browser
};

DOLTRONIC.PopUpWindow=function(id,parent_id,param){
	var DOM=new DOLTRONIC.DOM();
	if(!DOM)
		return 0;
	this.idAs=id;
	this.fld=parent_id;
	this.oP=param?param:{};
	var k;
	var def={debug:true,browser:'firefox',exist:false,width:"400px",height:"",title:"",style_path:"/",style_name:"blue",speClass:"vehicule",logo:null};
	for(k in def){
		if(typeof(this.oP[k])!=typeof(def[k])){
			this.oP[k]=def[k]
		}
	}
	//this.oP.trace=new DOLTRONIC.DEBUG(this.oP.debug);
	var browser=new DOLTRONIC.BrowserDetect();
	this.oP.browser=browser.getBrowserName();
	//this.oP.trace.log("DOLTRONIC.PopUpWindow: Object created");
	var content=this.createPopUp();
	return content
};

DOLTRONIC.PopUpWindow.prototype.createPopUp=function(){
	function findPos(obj){
		var curleft=curtop=0;
		if(obj.offsetParent){
			do{
				curleft+=obj.offsetLeft;
				curtop+=obj.offsetTop
			}while(obj=obj.offsetParent)
		}
		return[curleft,curtop]
	}
	var pointer=this;
	var DOM=new DOLTRONIC.DOM();
	var coordinateXY=findPos(this.fld);
	var holdingDiv=DOM.cE("div",{id:this.idAs,className:"module "+this.oP.style_name+"-module"});
	holdingDiv.style.top=coordinateXY[1]+"px";
	holdingDiv.style.left=this.fld.parentNode.parentNode.parentNode.parentNode.offsetLeft+this.fld.offsetWidth+"px";
	holdingDiv.style.width=this.oP.width;
	var frameDiv=DOM.cE("div",{id:"moduleframe",className:"moduleFrame moduleunHighlight"});
	var headerContainer=DOM.cE("div",{className:"moduleHeaderContainer"});
	var headerDiv=DOM.cE("div",{id:"moduleHeaderID",className:this.oP.style_name+" moduleHeader"});
	headerDiv.onmousedown=function(e){pointer.bringToFront(pointer.idAs);var savedTarget=null;var orgCursor=null;var dragOK=false;var dragXoffset=0;var dragYoffset=0;pointer.dragHandler(e,pointer.idAs)};
	var imgClose=DOM.cE("img",{src:"https://www.cartrawler.com/templates/popup/images/s.gif",width:"13",height:"16",alt:"Close",className:"icon actions-window-close"});
	imgClose.onclick=function(){pointer.close(pointer.idAs)};
	var aClose=DOM.cE("a",{href:"javascript:void(0);",className:"close"},imgClose);
	if(this.oP.logo){
		var imgLogo=DOM.cE("img",{src:this.oP.logo.src,width:this.oP.logo.width,height:this.oP.logo.height,alt:this.oP.logo.alt,className:"hicon"})
	}else{
		var imgLogo=""
	}
	var aCar=DOM.cE("a",{className:"ico"},imgLogo);
	if(pointer.oP.browser!="Explorer"){
		aCar.onmousedown=function(e){pointer.bringToFront(pointer.idAs);var savedTarget=null;var orgCursor=null;var dragOK=false;var dragXoffset=0;var dragYoffset=0;pointer.dragHandler(e,pointer.idAs)}
	}
	var spanTitle=DOM.cE("span",{className:"title",readonly:"readOnly"},this.oP.title);
	if(pointer.oP.browser!="Explorer"){
		spanTitle.onmousedown=function(e){if(!e){e=window.event}pointer.bringToFront(pointer.idAs);var savedTarget=null;var orgCursor=null;var dragOK=false;var dragXoffset=0;var dragYoffset=0;pointer.dragHandler(e,pointer.idAs)}
	}
	headerDiv.appendChild(aClose);
	headerDiv.appendChild(aCar);
	headerDiv.appendChild(spanTitle);
	headerContainer.appendChild(headerDiv);
	frameDiv.appendChild(headerContainer);
	var editDiv=DOM.cE("div",{className:"editContent"});
	frameDiv.appendChild(editDiv);
	if(this.oP.loading){
		var imgLoading=DOM.cE("img",{src:"https://www.cartrawler.com/templates/popup/images/big-ajax-loader.gif",width:"66",height:66,alt:"Loading"});
		var loadingMsg=DOM.cE("div",{className:"moduleContentMainLoadingMsg"},"Loading details");
		var ModuleContentMainDiv=DOM.cE("div",{className:"moduleContentMainLoading"},imgLoading);
		ModuleContentMainDiv.appendChild(loadingMsg)
	}else{
		var ModuleContentMainDiv=DOM.cE("div",{className:""})
	}
	var moduleDiv=DOM.cE("div",{className:"moduleContent "+this.oP.speClass},ModuleContentMainDiv);
	frameDiv.appendChild(moduleDiv);
	holdingDiv.appendChild(frameDiv);
	this.fld.parentNode.appendChild(holdingDiv);
	//this.oP.trace.log("DOLTRONIC.PopUpWindow: Popup window created");
	return moduleDiv
};

DOLTRONIC.PopUpWindow.prototype.moveHandler=function(e){
	if(e==null){
		e=window.event
	}
	if(savedTarget!=undefined){
		if(e.button<=1&&dragOK){
			savedTarget.style.left=e.clientX-dragXoffset+'px';
			savedTarget.style.top=e.clientY-dragYoffset+'px'
		}
	}
	return false
};

DOLTRONIC.PopUpWindow.prototype.cleanup=function(e){
	document.onmousemove=null;
	document.onmouseup=null;
	savedTarget.style.cursor=orgCursor;
	dragOK=false
};

DOLTRONIC.PopUpWindow.prototype.dragHandler=function(e,id){
	var htype='-moz-grabbing';
	var DOM=new DOLTRONIC.DOM();
	var moduleID=DOM.gE(id);
	if(e==null){
		e=window.event;
		htype='move'
	}
	if(this.oP.browser=="Explorer"){
		var target=e.target!=null?e.target:e.srcElement;
		target=target.parentNode.parentNode.parentNode
	}else{
		var target=e.currentTarget!=null?e.currentTarget:e.srcElement;
		//this.oP.trace.log("DOLTRONIC.PopUpWindow.dragHandler: target["+target+"] - e["+e+"");
		target=target.parentNode.parentNode.parentNode!=undefined?target.parentNode.parentNode.parentNode:e.parentNode.parentNode
	}
	orgCursor=target.style.cursor;
	var myTarget="module "+this.oP.style_name+"-module";
	if(target.className==myTarget){
		savedTarget=target;
		target.style.cursor=htype;
		dragOK=true;
		dragXoffset=e.clientX-parseInt(moduleID.style.left,10);
		dragYoffset=e.clientY-parseInt(moduleID.style.top,10);
		var pointer=this;
		document.onmousemove=this.moveHandler;
		document.onmouseup=this.cleanup
	}
	return true
};

DOLTRONIC.PopUpWindow.prototype.close=function(elt){
	var DOM=new DOLTRONIC.DOM();
	var ele=DOM.gE(elt);
	var pointer=this;
	switch(elt){
		case 'IndivNinio': var num_ninios=vhcID.getValue("indiv_childCount");
							var edades=""; 
							var contenido="<input type=\"button\" style=\"background-color:#FFFFFF; border:0 solid #FFFFFF; color:#777777; font-size:10px; width:74px;\" id=\"vhc_div_ages_indivmasButton\" value='Edades(";
							for(var nn=0; nn<num_ninios; nn++){
								if(nn==0){
									edades=vhcID.getValue("child"+nn);
									contenido+=vhcID.getValue("child"+nn);
								}else{
									if(nn==1)
										contenido+=","+vhcID.getValue("child"+nn);
									if(nn==2)
										contenido+=",...";
									edades+=","+vhcID.getValue("child"+nn);
								}
							}
							contenido+=")'/>";
							document.getElementById("vhc_div_ages_indivmas").innerHTML=contenido;
							vhcSC.events.setIndex("div_ages_indivmasButton");
							vhcID.setValue('edades_indiv',edades);
						break;
		case 'DobNinio': var num_ninios=vhcID.getValue("doble_childCount");
							var edades=""; 
							var contenido="<input type=\"button\" style=\"background-color:#FFFFFF; border:0 solid #FFFFFF; color:#777777; font-size:10px; width:74px;\" id=\"vhc_div_ages_doblemasButton\" value='Edades(";
							for(var nn=0; nn<num_ninios; nn++){
								if(nn==0){
									edades=vhcID.getValue("child"+nn);
									contenido+=vhcID.getValue("child"+nn);
								}else{
									if(nn==1)
										contenido+=","+vhcID.getValue("child"+nn);
									if(nn==2)
										contenido+=",...";
									edades+=","+vhcID.getValue("child"+nn);
								}
							}
							contenido+=")'/>";
							document.getElementById("vhc_div_ages_doblemas").innerHTML=contenido;
							vhcSC.events.setIndex("div_ages_doblemasButton");
							vhcID.setValue('edades_doble',edades);
						break;
		case 'DobDosNinio': var num_ninios=(vhcID.getValue("doble_twochildCount"))*2;
							var edades=""; 
							var contenido="<input type=\"button\" style=\"background-color:#FFFFFF; border:0 solid #FFFFFF; color:#777777; font-size:10px; width:74px;\" id=\"vhc_div_ages_doblemasdosButton\" value='Edades(";
							for(var nn=0; nn<num_ninios; nn++){
								if(nn==0){
									edades=vhcID.getValue("child"+nn);
									contenido+=vhcID.getValue("child"+nn);
								}else{
									if(nn==1)
										contenido+=","+vhcID.getValue("child"+nn);
									if(nn==2)
										contenido+=",...";
									edades+=","+vhcID.getValue("child"+nn);
								}
							}
							contenido+=")'/>";
							document.getElementById("vhc_div_ages_doblemasdos").innerHTML=contenido;
							vhcSC.events.setIndex("div_ages_doblemasdosButton");
							vhcID.setValue('edades_doblemas',edades);
							break;
		case 'TripNino': var num_ninios=vhcID.getValue("triple_childCount");
						var edades=""; 
						var contenido="<input type=\"button\" style=\"background-color:#FFFFFF; border:0 solid #FFFFFF; color:#777777; font-size:10px; width:74px;\" id=\"vhc_div_ages_triplemasButton\" value='Edades(";
						for(var nn=0; nn<num_ninios; nn++){
							if(nn==0){
								edades=vhcID.getValue("child"+nn);
								contenido+=vhcID.getValue("child"+nn);
							}else{
								if(nn==1)
									contenido+=","+vhcID.getValue("child"+nn);
								if(nn==2)
									contenido+=",...";
								edades+=","+vhcID.getValue("child"+nn);
							}
						}
						contenido+=")'/>";
						document.getElementById("vhc_div_ages_triplemas").innerHTML=contenido;
						vhcSC.events.setIndex("div_ages_triplemasButton");
						vhcID.setValue('edades_triple',edades);
						break;
	}
	if(ele){
		if(!pointer.iframe){
			var fade=new DOLTRONIC.Fader(ele,1,0,250,function(){if(pointer.iframe){DOM.remE(pointer.iframe);pointer.iframe=""};DOM.remE(ele)})
		}else{
			DOM.remE(pointer.iframe);
			pointer.iframe="";
			DOM.remE(ele)
		}
	}
};

DOLTRONIC.PopUpWindow.prototype.bringToFront=function(id){
	if(!document.getElementById||!document.getElementsByTagName)
		return;
	var DOM=new DOLTRONIC.DOM();
	var obj=document.getElementById(id);
	var divs=DOM.getAbsoluteDivs();
	var max_index=10000;
	var cur_index;
	for(i=0;i<divs.length;i++){
		var item=divs[i];
		if(item==obj||item.style.zIndex=='')
			continue;
		cur_index=parseInt(item.style.zIndex,10);
		if(max_index<cur_index){
			max_index=cur_index
		}
	}
	obj.style.zIndex=max_index+1
};

DOLTRONIC.PopUpWindow.prototype.sendToBack=function(id){
	if(!document.getElementById||!document.getElementsByTagName)
		return;
	var obj=document.getElementById(id);
	var divs=getAbsoluteDivs();
	var min_index=999999;
	var cur_index;
	if(divs.length<2)
		return;
	for(i=0;i<divs.length;i++){
		var item=divs[i];
		if(item==obj)
			continue;
		if(item.style.zIndex==''){
			min_index=0;
			break
		}
		cur_index=parseInt(item.style.zIndex,10);
		if(min_index>cur_index){
			min_index=cur_index
		}
	}
	if(min_index>parseInt(obj.style.zIndex,10)){
		return
	}
	obj.style.zIndex=1;
	if(min_index>1)
		return;
	var add=min_index==0?2:1;
	for(i=0;i<divs.length;i++){
		var item=divs[i];
		if(item==obj)
			continue;
		item.style.zIndex+=add
	}
};

DOLTRONIC.Fader=function(ele,from,to,fadetime,callback){
	if(!ele)
		return 0;
	this.e=ele;
	this.from=from;
	this.to=to;
	this.cb=callback;
	this.nDur=fadetime;
	this.nInt=50;
	this.nTime=0;
	var p=this;
	this.nID=setInterval(function(){p._fade()},this.nInt)
};

DOLTRONIC.Fader.prototype._fade=function(){
	this.nTime+=this.nInt;
	var ieop=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);
	var op=ieop/100;
	if(this.e.filters){
		try{
			this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop
		}catch(e){
			this.e.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')'
		}
	}else{
		this.e.style.opacity=op
	}
	if(this.nTime==this.nDur){
		clearInterval(this.nID);
		if(this.cb!=undefined)
			this.cb()
	}
};

DOLTRONIC.Fader.prototype._tween=function(t,b,c,d){
	return b+((c-b)*(t/d))
};

DOLTRONIC.PopUp_AgeRoom=function(param){
	var DOM=new DOLTRONIC.DOM();
	if(!DOM)
		return 0;
	var k;
	var def={title:"Edad niņos",width:"200px",loading:true,browser:'firefox',num_nin:1,titleCamp:"Niņo",edades:""};
	this.oP=def;
	for(k in param){
		if(this.oP[k]!=param[k])
			this.oP[k]=param[k]
	}
	//
	/*for(k in this.oP){
		switch(k){
			case"target":this.oP.xmlParams['Target']=this.oP.target;
						delete(this.oP.target);
						break;
			case"id":this.oP.xmlParams['ReqID']=this.oP.id;
						delete(this.oP.id);
						break;
			case"LangID":this.oP.xmlParams['LangID']=this.oP.LangID;
						delete(this.oP.language);
						break
		}
	}*/
	//this.oP.trace=new DOLTRONIC.DEBUG(this.oP.debug);
	//var cssLink=DOM.cL(this,"",this.oP.style_file,this.oP.style_path,this.oP.style_path+this.oP.style_file);
	//var cssLink=DOM.cL(this,this.oP.style_name,this.oP.style_file,this.oP.style_path);
	var browser=new DOLTRONIC.BrowserDetect();
	this.oP.browser=browser.getBrowserName();
	//this.oP.trace.log("DOLTRONIC.PopUp_CarDetails: Object created")
};

DOLTRONIC.PopUp_AgeRoom.prototype.display=function(id,parent_id){
	var DOM=new DOLTRONIC.DOM();
	this.idAs=id;
	this.fld=parent_id;
	this.oP.title=vhcSC.language.getLabel(id);
	var exist=DOM.gE(this.idAs);
	if(!exist){
		var myPopUp=new DOLTRONIC.PopUpWindow(this.idAs,this.fld,{browser:this.oP.browser,exist:false,width:this.oP.width,title:this.oP.title,loading:this.oP.loading});
		var carInfo={num_nin:this.oP.num_nin,titleCamp:this.oP.titleCamp,edades:this.oP.edades};
		//this.doAjaxRequest(myPopUp,carInfo)
		this.displayDetails(myPopUp,carInfo);
	}
	//this.oP.trace.log("DOLTRONIC.PopUp_CarDetails: popup displayed [divID:"+id+"]")
};

DOLTRONIC.PopUp_AgeRoom.prototype.displayDetails=function(id,carInfo){
	var DOM=new DOLTRONIC.DOM();
	/*var xml=req.responseXML;
	var similarCar=new Array();
	var attributeArray=new Array();
	var similarCarTxt="";
	var error_flag=false;
	var msg="";
	var error_detail="";
	if(this.oP.browser=="Explorer"){
		if(xml.xml==null)
			xml=null
	}
	if((xml!==null)&&(xml!=="")){
		var error=xml.getElementsByTagName(this.oP.xmlParams.MessageName_error);
		if(error&&error.length!=0){
			error_flag=true;
			var error_detail={type:"Error",msg:xml.getElementsByTagName(this.oP.xmlParams.MessageName_error)[0].getAttribute('ErrorMessage'),status:xml.getElementsByTagName(this.oP.xmlParams.MessageName_error)[0].getAttribute('Status'),code:xml.getElementsByTagName(this.oP.xmlParams.MessageName_error)[0].getAttribute('ErrorCode'),version:xml.getElementsByTagName(this.oP.xmlParams.MessageName_error)[0].getAttribute('Version')}
		}else{
			var success=xml.getElementsByTagName(this.oP.xmlParams.MessageName_response)[0].childNodes[1].nodeName;
			if(success=="Success"){
				if(xml.getElementsByTagName(this.oP.xmlParams.MessageName_response)[0].childNodes[0].nodeName&&xml.getElementsByTagName('FleetGroup')[0]){
					error_flag=false;
					var vehicle=xml.getElementsByTagName('FleetGroup')[0].childNodes[0];
					var nbsimilarcar=xml.getElementsByTagName('FleetGroup')[0].childNodes.length;
					if(nbsimilarcar>1){
						for(i=1;i<nbsimilarcar;i++){
							if(this.oP.browser=="Explorer"){
								similarCar.push(xml.getElementsByTagName('FleetGroup')[0].childNodes[i].text);
								similarCarTxt+=(xml.getElementsByTagName('FleetGroup')[0].childNodes[i].text+"\r")
							}else{
								similarCar.push(xml.getElementsByTagName('FleetGroup')[0].childNodes[i].textContent);
								similarCarTxt+=(xml.getElementsByTagName('FleetGroup')[0].childNodes[i].textContent+"\n")
							}
						}
					}else{
						similarCarTxt=this.oP.l18n.no_similar_cars
					}
					for(i=0;i<vehicle.attributes.length;i++){
						attributeArray[vehicle.attributes[i].nodeName]=vehicle.attributes[i].nodeValue
					}
					var carDescription={vehicleName:vehicle.getElementsByTagName('VehMakeModel')[0].getAttribute('Name'),vehicleCode:vehicle.getElementsByTagName('VehMakeModel')[0].getAttribute('Code'),vehicleClassSize:vehicle.getElementsByTagName('VehClass')[0].getAttribute('Size'),vehicleClassCategory:vehicle.getElementsByTagName('VehType')[0].getAttribute('VehicleCategory'),vehicleDoorCount:vehicle.getElementsByTagName('VehType')[0].getAttribute('DoorCount'),vehicleAttributes:attributeArray,PictureURL:vehicle.getElementsByTagName('PictureURL')[0].childNodes[0].nodeValue,similarCar:similarCarTxt,price:carInfo.price,currency:carInfo.Currency,satnav:/with sat nav/.test(vehicle.getElementsByTagName('VehMakeModel')[0].getAttribute('Name').toLowerCase()),duration:carInfo.duration}
				}else{
					error_flag=true;
					var error_detail={type:"Warning",msg:"No data for that car",status:success,code:"null",version:xml.getElementsByTagName(this.oP.xmlParams.MessageName_response)[0].getAttribute('Version')}
				}
			}
		}
	}else{
		var error=req.responseText;
		if(error.length){
			error_flag=true;
			var error_detail={type:"Error",msg:error,status:null,code:null,version:null}
		}
	}
	if(!error_flag){
		var content=this.createPopUpCarDetailsContent(carDescription)
	}else{
		var content=this.createErrorContent(error_detail)
	}*/
	var content=this.createPopUpAgeDetailsContent(carInfo);
	var moduleID=DOM.gE(id);
	DOM.remE(moduleID.childNodes[0]);
	moduleID.appendChild(content)
};

DOLTRONIC.PopUp_AgeRoom.prototype.createPopUpAgeDetailsContent=function(data){
	var DOM=new DOLTRONIC.DOM();
	var ModuleContentDiv=DOM.cE("div",{className:""});
	var mTable=DOM.cE("table",{className:"ct-rental-conditions-header", cellSpacing:"0", cellPadding:"0"});
	var mTBody=DOM.cE("tbody");
	var edades=(data.edades).split(",");
	for(var i=0;i<data.num_nin;i++){
		var mContentTD1_DIV=DOM.cE('div',{className:'ct-rental-conditions-left'},data.titleCamp+" "+(i+1)+":",true);
		var mContentTD1=DOM.cE('td',{className:'ct-rental-conditions-header ct-rental-conditions-left'},mContentTD1_DIV);
		
		var selectninios=DOM.cE('select',{id:'vhc_child'+i, name:'child'+i});
		for(var j=0;j<12;j++){
			if(i<edades.length){
				if(parseInt(edades[i])==j){
					option=DOM.cE('option',{value:j, selected:"selected"},j+' Aņos');
				}else{
					option=DOM.cE('option',{value:j},j+' Aņos');
				}
			}else{
				 option=DOM.cE('option',{value:j},j+' Aņos');
			}
			selectninios.appendChild(option);
		}
		
		var mContentTD2_DIV=DOM.cE('div',{className:'ct-rental-conditions-right'},selectninios);
		var mContentTD2=DOM.cE('td',{className:'ct-rental-conditions-header ct-rental-conditions-right'},mContentTD2_DIV);
		
		var mContentTR=DOM.cE('tr');
		
		mContentTR.appendChild(mContentTD1);
		mContentTR.appendChild(mContentTD2);
		mTBody.appendChild(mContentTR);
	}
	
	mTable.appendChild(mTBody);
	
	var moduleContentTitleDiv=DOM.cE("div",{className:"ct-rental-header"},mTable);
	
	
	/*var ModuleContentMainTitleDiv=DOM.cE("div",{className:"moduleContentMainTitle"},moduleContentTitleDiv);
	var ModuleContentMainDiv=DOM.cE("div",{className:"moduleContentMain"});
	var ModuleContentDetailsDiv=DOM.cE("div",{className:"moduleContentDetails"});
	var moduleDisclaimerDiv=DOM.cE("div",{className:"moduleDisclaimer"},this.oP.l18n.disclaimer);
	var ModuleContentMainLeftDiv=DOM.cE("div",{className:"moduleContentMainLeft"});
	var moduleContentImgCarDiv=DOM.cE("div");
	var imgCar=DOM.cE("img",{src:carDescription.PictureURL,width:"160",height:"100",alt:carDescription.vehicleName});
	var moduleContentImageDiv=DOM.cE("div",{className:"moduleContentImage"},imgCar);
	var moduleDivEmptyCarImg=DOM.cE("div");
	moduleContentImgCarDiv.appendChild(moduleContentImageDiv);
	moduleContentImgCarDiv.appendChild(moduleDivEmptyCarImg);
	var moduleContentPriceDiv=DOM.cE("div");
	var moduleContentCarPriceDiv=DOM.cE("div",{className:"moduleContentPrice"});
	var moduleContentCarPriceSpan=DOM.cE("span",{className:"moduleContentBigBold"},carDescription.currency+" "+carDescription.price);
	var moduleDivEmptyPrice=DOM.cE("div");
	moduleContentCarPriceDiv.appendChild(moduleContentCarPriceSpan);
	var newstr=this.oP.l18n.days.replace(/3/g,carDescription.duration);
	var moduleContentCarPriceByDaysSpan=DOM.cE("span",{className:"moduleContentSpan"},"&nbsp;"+newstr,true);
	moduleContentCarPriceDiv.appendChild(moduleContentCarPriceByDaysSpan);
	moduleContentPriceDiv.appendChild(moduleContentCarPriceDiv);
	moduleContentPriceDiv.appendChild(moduleDivEmptyPrice);
	ModuleContentMainLeftDiv.appendChild(moduleContentImgCarDiv);
	ModuleContentMainLeftDiv.appendChild(moduleContentPriceDiv);
	var ModuleContentMainRightDiv=DOM.cE("div",{className:"moduleContentMainRight"});
	var ModuleContentMainRightcariconsDiv=DOM.cE("div",{className:"moduleCarIconsAttributes"});
	var ModuleContentMainRightmoduleCarIconsClearDiv=DOM.cE("div",{className:"moduleClear"});
	var ModuleContentMainRightmoduleCarIconsAttributesfirstrowDiv=DOM.cE("div",{className:"moduleCarIconsAttributesfirstrow"});
	var label_passenger=DOM.cE("label",{},"x "+carDescription.vehicleAttributes.PassengerQuantity);
	var ico_passenger=DOM.cE("p",{className:"ico_passenger"},label_passenger);
	ModuleContentMainRightmoduleCarIconsAttributesfirstrowDiv.appendChild(ico_passenger);
	var label_luggage=DOM.cE("label",{},"x "+carDescription.vehicleAttributes.BaggageQuantity);
	var ico_luggage=DOM.cE("p",{className:"ico_baggage"},label_luggage);
	ModuleContentMainRightmoduleCarIconsAttributesfirstrowDiv.appendChild(ico_luggage);
	var label_doors=DOM.cE("label",{},"x "+carDescription.vehicleDoorCount);
	var ico_doors=DOM.cE("p",{className:"ico_door"},label_doors);
	ModuleContentMainRightmoduleCarIconsAttributesfirstrowDiv.appendChild(ico_doors);
	var ModuleContentMainRightmoduleCarIconsAttributessecondrowDiv=DOM.cE("div",{className:"moduleCarIconsAttributessecondrow"});
	if(carDescription.vehicleAttributes.TransmissionType==="Automatic"){
		var label_automatique=DOM.cE("label",{}," ");
		var ico_automatique=DOM.cE("p",{className:"ico_transmission"},label_automatique);
		ModuleContentMainRightmoduleCarIconsAttributessecondrowDiv.appendChild(ico_automatique)
	}
	if(carDescription.vehicleAttributes.FuelType==="Diesel"){
		var label_fuel=DOM.cE("label",{}," ");
		var ico_fuel=DOM.cE("p",{className:"ico_fuel"},label_fuel);
		ModuleContentMainRightmoduleCarIconsAttributessecondrowDiv.appendChild(ico_fuel)
	}
	if(carDescription.vehicleAttributes.AirConditionInd==="true"){
		var label_aircondition=DOM.cE("label",{}," ");
		var ico_aircondition=DOM.cE("p",{className:"ico_aircondition"},label_aircondition);
		ModuleContentMainRightmoduleCarIconsAttributessecondrowDiv.appendChild(ico_aircondition)
	}
	if(carDescription.satnav){
		var label_satnav=DOM.cE("label",{}," ");
		var ico_satnav=DOM.cE("p",{className:"ico_satnav"},label_satnav);
		ModuleContentMainRightmoduleCarIconsAttributessecondrowDiv.appendChild(ico_satnav)
	}
	ModuleContentMainRightcariconsDiv.appendChild(ModuleContentMainRightmoduleCarIconsAttributesfirstrowDiv);
	ModuleContentMainRightcariconsDiv.appendChild(ModuleContentMainRightmoduleCarIconsClearDiv);
	ModuleContentMainRightcariconsDiv.appendChild(ModuleContentMainRightmoduleCarIconsAttributessecondrowDiv);
	var ModuleContentMainRightmoduleClearDiv=DOM.cE("div",{className:"moduleClear"});
	var carDetails="";
	carDetails+=carDescription.vehicleAttributes.PassengerQuantity+" "+this.oP.l18n.passenger;
	carDetails+=", "+carDescription.vehicleAttributes.BaggageQuantity+" "+this.oP.l18n.luggage;
	carDetails+=", "+carDescription.vehicleDoorCount+" "+this.oP.l18n.doors;
	if(carDescription.vehicleAttributes.TransmissionType!=="Unspecified"){
		carDetails+=", "+carDescription.vehicleAttributes.TransmissionType
	}
	if(carDescription.vehicleAttributes.FuelType!=="Unspecified"){
		carDetails+=", "+carDescription.vehicleAttributes.FuelType
	}
	if(carDescription.vehicleAttributes.AirConditionInd!=="false"){
		carDetails+=", "+this.oP.l18n.air_condition
	}
	if(carDescription.satnav){
		carDetails+=", "+this.oP.l18n.satelite
	}
	var ModuleContentMainRightcariconsdescriptionPDiv=DOM.cE("p",{},carDetails);
	var ModuleContentMainRightcariconsdescriptionDiv=DOM.cE("div",{className:"moduleCarIconsDescription"},ModuleContentMainRightcariconsdescriptionPDiv);
	ModuleContentMainRightDiv.appendChild(ModuleContentMainRightcariconsDiv);
	ModuleContentMainRightDiv.appendChild(ModuleContentMainRightmoduleClearDiv);
	ModuleContentMainRightDiv.appendChild(ModuleContentMainRightcariconsdescriptionDiv);
	var ModuleContentDetailsLeftDiv=DOM.cE("div",{className:"moduleContentDetailsLeft"});
	var moduleContentDescriptionDivDescH2=DOM.cE("h2",{className:"moduleContentBold"},this.oP.l18n.car_description);
	var moduleContentDescriptionDivDesc=DOM.cE("div",{className:"moduleContentDescription"});
	moduleContentDescriptionDivDesc.appendChild(moduleContentDescriptionDivDescH2);
	var moduleContentDescriptionDivDescP=DOM.cE("p",{className:"moduleContentDescriptionDivP"},"N/A");
	moduleContentDescriptionDivDesc.appendChild(moduleContentDescriptionDivDescP);
	var moduleContentDescriptionDivFuelH2=DOM.cE("h2",{className:"moduleContentBold"},this.oP.l18n.fuel_consumption);
	var moduleContentDescriptionDivFuel=DOM.cE("div",{className:"moduleContentDescription"});
	moduleContentDescriptionDivFuel.appendChild(moduleContentDescriptionDivFuelH2);
	var moduleContentDescriptionDivFuelP=DOM.cE("p",{className:"moduleContentDescriptionDivP"},"N/A");
	moduleContentDescriptionDivFuel.appendChild(moduleContentDescriptionDivFuelP);
	var moduleContentDescriptionDivEmissionH2=DOM.cE("h2",{className:"moduleContentBold"},this.oP.l18n.co2_emission);
	var moduleContentDescriptionDivEmission=DOM.cE("div",{className:"moduleContentDescription"});
	moduleContentDescriptionDivEmission.appendChild(moduleContentDescriptionDivEmissionH2);
	var moduleContentDescriptionDivEmissionP=DOM.cE("p",{className:"moduleContentDescriptionDivP"},"N/A");
	moduleContentDescriptionDivEmission.appendChild(moduleContentDescriptionDivEmissionP);
	ModuleContentDetailsLeftDiv.appendChild(moduleContentDescriptionDivDesc);
	ModuleContentDetailsLeftDiv.appendChild(moduleContentDescriptionDivFuel);
	ModuleContentDetailsLeftDiv.appendChild(moduleContentDescriptionDivEmission);
	var ModuleContentDetailsRightDiv=DOM.cE("div",{className:"moduleContentDetailsRight"});
	var ModuleContentDetailsRightPDiv=DOM.cE("p",{className:"moduleContentDescriptionDivP"},this.oP.l18n.similar_cars);
	var ModuleContentDetailsRightTextAreaDiv=DOM.cE("textarea",{className:"moduleContentDetailsRight_textarea",rows:"5",cols:"21",readonly:"readonly"},carDescription.similarCar);
	ModuleContentDetailsRightDiv.appendChild(ModuleContentDetailsRightPDiv);
	ModuleContentDetailsRightDiv.appendChild(ModuleContentDetailsRightTextAreaDiv);
	ModuleContentMainDiv.appendChild(ModuleContentMainLeftDiv);
	ModuleContentMainDiv.appendChild(ModuleContentMainRightDiv);
	ModuleContentDetailsDiv.appendChild(ModuleContentDetailsRightDiv);
	ModuleContentDiv.appendChild(ModuleContentMainTitleDiv);
	ModuleContentDiv.appendChild(ModuleContentMainDiv);
	ModuleContentDiv.appendChild(ModuleContentDetailsDiv);
	ModuleContentDiv.appendChild(moduleDisclaimerDiv);*/
	ModuleContentDiv.appendChild(moduleContentTitleDiv);
	return ModuleContentDiv
};
/*
DOLTRONIC.PopUp_CarDetails.prototype.doAjaxRequest=function(contentDiv,carInfo){
	var pointer=this;
	var DOM=new DOLTRONIC.DOM();
	var myAjax=new DOLTRONIC.Ajax();
	var url=this.oP.proxyURL;
	var request=this.createRequest(this.oP.xmlParams,carInfo);
	if(!url)
		return false;
	var meth=this.oP.meth;
	var onSuccessFunc=function(req){pointer.oP.trace.log("DOLTRONIC.PopUp_CarDetails: doAjaxRequest, Ajax call success");pointer.displayCarDetails(req,contentDiv,carInfo)};
	var onErrorFunc=function(status){pointer.oP.trace.log("DOLTRONIC.PopUp_CarDetails: doAjaxRequest, Ajax call in error");var error_detail={type:"Error",msg:this.req.responseText,status:this.req.statusText,code:status,version:"none"};var content=pointer.createErrorContent(error_detail);var moduleID=DOM.gE(contentDiv);DOM.remE(moduleID.childNodes[0]);moduleID.appendChild(content)};
	myAjax.makeRequest(url,request,meth,onSuccessFunc,onErrorFunc)
};*/


function vhcParser(){
	this.parseURL=parseURL;
	this.parseText=parseText;
	this.getSearch=getSearch;
	function parseURL(){
		var srch=this.getSearch(vhcSC.parseTopURL?window:top),index;srch=(!vhcSC.parseTopURL&&srch.indexOf("vhc=top")>-1?srch:this.getSearch(window)).split("&");
		this.param=new Array();
		for(var i=new Number(0);i<srch.length;i++){
			srch[i]=srch[i].split("=");
			index=srch[i];
			this.param[index[0]]=index[1]
		}
		return true
	};
	function parseText(text){
		return text.replace(/\r+/g,"\n").replace(/\n{2,}/g,"\n")
	};
	function getSearch(_window){
		return decodeURI(_window.location.search.slice(1))
	}
};

var vhcID=new vhcID(),vhcOption=new vhcOption(),vhcSC;

function vhcID(){
	var doc=document;
	this.pre=new String("vhc_");
	this.x=this.y=this.scrollX=this.scrollY=this.clientX=this.clientY=new Number();
	this.addStyle=addStyle;
	this.display=display;
	this.getdisplay=getdisplay;
	this.visible=visible;
	this.inner=inner;
	this.enable=enable;
	this.disable=disable;
	this.setValue=setValue;
	this.onChange=onChange;
	this.onClick=onClick;
	this.get=get;
	this.getObj=getObj;
	this.getFrame=getFrame;
	this.getValue=getValue;
	this.getScroll=getScroll;
	this.tag=tag;
	this.mouse=mouse;
	this.elementWidth=elementWidth;
	this.elementClassName=elementClassName;
	this.numberPadding=numberPadding;
	function addStyle(file,url){
		var _link=doc.createElement("link");
		with(_link){
			type="text/css";
			rel="stylesheet";
			href=file?vhcSC.srcURL+"css/"+file+".css":url
		}
		this.tag("head")[0].appendChild(_link)
	};
	function display(id,d,frame){
		this.getObj(id,frame).style.display=d?d!="none"&&d!="block"&&this.gecko?d="block":d:"none"
	};
	function getdisplay(id,frame){
		return this.getObj(id,frame).style.display;
	};
	function visible(id,frame){
		var _style=this.getObj(id,frame).style;
		_style.visibility=_style.visibility=="hidden"?"visible":"hidden"
	};
	function inner(id,text,frame){
		this.getObj(id,frame).innerHTML=text
	};
	function elementWidth(id,w,frame){
		this.getObj(id,frame).style.width=w+'px'
	};
	function elementClassName(id,c,frame){
		this.getObj(id,frame).className=this.pre+c
	};
	function enable(id){
		this.disable(id,true)
	};
	function disable(id,status){
		this.get(id).disabled=!status;
		this.get(id).className=!status?"disabled":""
	};
	function setValue(id,_value,frame){
		this.getObj(id,frame).value=_value
	};
	function onChange(id,frame){
		this.get(id,frame).onchange=eval("vhcSC.events.onChange_"+id)
	};
	function onClick(id,frame){
		this.get(id,frame).onclick=eval("vhcSC.events.onClick_"+id)
	};
	function get(_id,frame){
		try{
			var id=(frame?this.getFrame(frame):doc).getElementById(this.pre+_id)
		}catch(e){}
		id?null:vhcSC.debug?null:alert("ERROR: no such element exists, ID = "+this.pre+_id);
		return id
	};
	function getObj(id,frame){
		return id.constructor==String?this.get(id,frame):id
	};
	function getFrame(id){
		return window.frames[this.pre+id].document
	};
	function getValue(id,frame){
		return this.getObj(id,frame).value
	};
	function getScroll(){
		var b=doc.body,d=doc.documentElement,qw=new Number(b.clientWidth),qh=new Number(b.clientHeight),sw=new Number(d.clientWidth),sh=new Number(d.clientHeight);
		this.scrollX=b.scrollLeft+d.scrollLeft;
		this.scrollY=b.scrollTop+d.scrollTop;
		this.clientX=sw>0&&qw>sw?sw:qw;
		this.clientY=sh>0&&qh>sh?sh:qh
	};
	function tag(_tag,id){
		try{
			return(id?id:doc).getElementsByTagName(_tag)
		}catch(e){
			vhcSC.debug?null:alert("ERROR: no such element exists, TAG = "+_tag+" in ID = "+id)
		}
	};
	function mouse(e){
		this.getScroll();
		this.x=e.clientX+this.scrollX;
		this.y=e.clientY+this.scrollY+16
	};
	function numberPadding(numZeros,number){
		var n=new Number(number);
		return n.toFixed(numZeros)
	}
};

function vhcAJAX(){
	var url=new String(vhcSC.url);
	this.init=init;
	this.initForInsurance=initForInsurance;
	this.createXMLHttp=createXMLHttp;
	this.setCallback=setCallback;
	this.sendXML=sendXML;
	this.sendNoteXML=sendNoteXML;
	this.sendHTML=sendHTML;
	this.sendFile=sendFile;
	this.loadFile=loadFile;
	this.gotResponse=gotResponse;
	this.isSuccess=isSuccess;
	this.isSuccessHTML=isSuccessHTML;
	this.isError=isError;
	this.isErrorHTML=isErrorHTML;
	this.getResponseXML=getResponseXML;
	this.getResponseText=getResponseText;
	this.getMessageName=getMessageName;
	this.getErrorType=getErrorType;
	this.getErrorShortText=getErrorShortText;
	this.getDebugError=getDebugError;
	this.getBrowserInfo=getBrowserInfo;
	function init(){
		this.xmlHttp=this.createXMLHttp();
		this.responseXML=new Object();
		this.responseText=this.errorType=this.errorShortText=this.messageName=new String()
	};
	function initForInsurance(){
		this.xmlHttp=this.createXMLHttp();
		this.responseText=this.errorType=this.errorShortText=this.messageName=new String()
	};
	function createXMLHttp(){
		try{
			return new XMLHttpRequest()
		}catch(e){
			try{
				return new ActiveXObject("MSXML2.XMLHTTP.3.0")
			}catch(e){
				try{
					return new ActiveXObject("MSXML2.XMLHTTP")
				}catch(e){
					try{
						return new ActiveXObject("Microsoft.XMLHTTP")
					}catch(e){
						return false
					}
				}
			}
		}
	};
	function setCallback(callback){
		this.xmlHttp.onreadystatechange=callback
	};
	function sendXML(request,wait){
		this.messageName=request.messageName;
		with(this.xmlHttp){
			open("POST",url,wait?false:true);
			setRequestHeader("Content_Type","text/xml");
			send(request.getXML());
			if(wait){
				return responseXML
			}
		}
	};
	function sendNoteXML(request,wait){
		this.messageName=request.messageName;
		with(this.xmlHttp){
			open("POST",url,wait?false:true);
			setRequestHeader("Content_Type","text/xml");
			send(request.getNoteXML());
			if(wait){
				return responseXML
			}
		}
	};
	function sendHTML(request,url,wait){
		this.messageName=request.messageName;
		with(this.xmlHttp){
			var targetUrl=url+"?insurance=1&"+request;
			open("GET",targetUrl,wait?false:true);
			setRequestHeader("Content_Type","text/html");
			send(null);
			if(wait){
				return responseText
			}
		}
	};
	function sendFile(file,dontWait,type){
		with(this.xmlHttp){
			open("GET",url+"?getfile="+file,dontWait);
			setRequestHeader("Content_Type",type?type:"text/xml");
			send("")
		}
	};
	function loadFile(file,wait,_type,_url){
		var type=new String("text/"+(_type?_type:"plain"));
		try{
			with(this.xmlHttp){
				open("GET",_url?_url:url+"?abegetfile="+file+'&alb='+Math.random(),wait?false:true);
				setRequestHeader("Content_Type",type);
				send("");
				if(wait){
					return responseText
				}
			}
		}catch(e){
			var msg=new String("vhcAJAX.loadFile ("+file+", "+dontWait+", "+type+", "+(_url?_url:"")+")");
			vhcSC.errorReport(msg,"",msg);
			alert(msg);
			return
		}
	};
	function gotResponse(){
		if(this.xmlHttp.readyState==4&&this.xmlHttp.status==200){
			this.responseXML=this.xmlHttp.responseXML;
			this.responseText=this.xmlHttp.responseText;
			return true
		}else{
			return false
		}
	};
	function isSuccess(){
		if(!this.responseXML){
			var msg=new String("vhcAJAX.isSuccess ()");
			vhcSC.errorReport(msg,"0",msg+"\nresponse:\n"+this.responseText);
			return false
		}else
			if(vhcID.tag("Success",this.responseXML).length){
				return true
			}else{
				return false
			}
	};
	function isSuccessHTML(){
		if(!this.responseText){
			return false
		}else 
			if(this.responseText.length){
				return true
			}else{
				return false
			}
	};
	function isError(){
		var error=vhcID.tag("Error",this.responseXML);
		//alert(typeof error=="undefined");
		if(typeof error=="undefined"){
			return false
		}
		if(eval(error).length){
			error=eval(error);
			this.errorType=error[0].getAttribute("Type");
			this.errorShortText=error[0].getAttribute("ShortText")
		}else{
			error='vhcID.tag ("OTA_ErrorRS", this.responseXML)';
			if(eval(error).length){
				error=eval(error);
				this.errorType=error[0].getAttribute("ErrorCode");
				this.errorShortText=error[0].getAttribute("ErrorMessage")
			}else{
				return false
				}
		}
		var msg=new String("vhcAJAX.isError ()");
		vhcSC.errorReport(msg,"0",msg+"\nresponse:\n"+this.responseText);
		return true
	};
	function isErrorHTML(){
		var error=vhcID.tag("Error",this.responseText);
		if(typeof error=="undefined"){
			return false
		}
		if(eval(error).length){
			error=eval(error);
			this.errorType=error[0].getAttribute("Type");
			this.errorShortText=error[0].getAttribute("ShortText")
		}else{
			error='vhcID.tag ("OTA_ErrorRS", this.responseXML)';
			if(eval(error).length){
				error=eval(error);
				this.errorType=error[0].getAttribute("ErrorCode");
				this.errorShortText=error[0].getAttribute("ErrorMessage")
			}else{
				return false
			}
		}
		var msg=new String("vhcAJAX.isError ()");
		vhcSC.errorReport(msg,"0",msg+"\nresponse:\n"+this.responseText);
		return true
	};
	function getResponseXML(){
		return this.responseXML
	};
	function getResponseText(){
		return this.responseText
	};
	function getMessageName(){
		return this.messageName
	};
	function getErrorType(){
		return this.errorType
	};
	function getErrorShortText(){
		return this.errorShortText
	};
	function getDebugError(){
		if(this.errorShortText.indexOf('Invalid POS ID')!=-1){
			return this.errorShortText+"  There can be a delay after a client is created before it is actived."
		}
		if(this.errorShortText.indexOf('Target Must be')!=-1){
			return this.errorShortText+"  .  Booking engine Test/Production configuration does not match the OTA Server."
		}
		return getBrowserInfo()+" ,"+"MessageName="+this.messageName+" ,"+"Type="+this.errorType+" ,"+"Short="+this.errorShortText+" ,"+"ResponseXML="+this.responseXML+" ,"+"isSuccess()="+this.isSuccess()+" ,"+"ResponseText="+this.responseText
	};
	function getBrowserInfo(){
		var n=navigator;
		return"Browser="+n.appName+" ,"+"Version: "+n.appVersion+" ,"+"Platform: "+n.platform+" ,"+"User agent: "+n.userAgent
	}
};

function vhcLoad(){
	var symbols=new Array(".","&rsaquo;"),symbol=new String(symbols[0]),_max=new Number(3),_min=new Number(0),i=new Number(0),_load=new String(),w=window,_this=this,_id;
	this.start=start;
	this.setselect=setselect;
	this.setiframe=setiframe;
	this.loadBar=loadBar;
	this.processBar=processBar;
	this.clear=clear;
	this.getSymbol=getSymbol;
	function start(id,_symbol,maxLength,minLength,i){
		var tag=new String(vhcID.get(id).tagName.toLowerCase());
		_id=tag=="select"?vhcOption.get(id):vhcID.tag("span",vhcID.getFrame(id))[i?i:0];
		_symbol?symbol=symbols[_symbol]:null;maxLength?_max=maxLength:null;minLength?_min=minLength:null;
		this.intr=w.setInterval(function(){eval("_this.set"+tag+"();")},250)
	};
	function setselect(){
		_id[0].text=vhcSC.translate("PleaseWait")+this.getSymbol()
	};
	function setiframe(){
		_id.innerHTML=this.getSymbol()
	};
	function loadBar(msg){
		if(msg){
			vhcID.inner("loadAction",vhcSC.translate(msg));
			this.intr=w.setInterval(function(){_this.processBar()},250)
		}else{
			this.clear()
		}
		vhcID.display("LOAD",msg?"block":null)
	};
	function processBar(){
		vhcID.visible("loadWait")
	};
	function clear(){
		w.clearInterval(this.intr)
	};
	function getSymbol(){
		if(i<_max){
			_load+=symbol;
			i++
		}else{
			i=_min;
			_load="";
			while(i.valueOf()){
				_load+=symbol;
				i--
			}
		}
		return _load
	}
};

function vhcLanguage(){
	var ajaxHTML=new vhcAJAX(),ajaxLanguage=new vhcAJAX(),parser=new vhcParser(),label=new Array();
	this.html=new Array();
	this.add=add;
	this.getSource=getSource;
	this.getLanguage=getLanguage;
	this.receiveHTML=receiveHTML;
	this.receiveLanguage=receiveLanguage;
	this.generateCache=generateCache;
	this.generateFlag=generateFlag;
	this.generateHTML=generateHTML;
	this.generate=generate;
	this.translate=translate;
	this.getLabel=getLabel;
	function add(){
		var args=arguments[0],j=new String(),l=new Number();
		this.img=new Array();
		for(var i=new Number(0);i<args.length;i++){
			j=args[i].toUpperCase();
			this.img.push(new Image());
			l=this.img.length-1;
			this.img[l].src=vhcSC.srcURL+"vhc/image/icon/flag/"+j+".gif";
			this.img[l].code=j
		}
	};
	function getSource(){
		
		with(ajaxHTML){
			init();
			setCallback(this.receiveHTML);
			if(vhcSC.Step2){
				loadFile("template/"+vhcSC.template+"_hotel.html",false,"html",vhcSC.templateURL)
			}else{
				loadFile("template/"+vhcSC.template+"_vuelo.html",false,"html",vhcSC.templateURL)
			}
		}
		
		this.getLanguage()
	};
	function getLanguage(){
		with(ajaxLanguage){
			init();
			setCallback(this.receiveLanguage);
			loadFile("VhcDoltronic_"+vhcSC.languageID+".properties",false,"plain")
		}
	};
	function receiveHTML(){
		if(ajaxHTML.gotResponse()){
			var raw=new String(parser.parseText(ajaxHTML.getResponseText()).replace(/\n|\t/g,"")),tag=new String(),i=new Number(),j=new Number(),_this=vhcSC.language;
			while(raw.length){
				i=raw.search(/<%[^%>]+%>/);
				j=raw.search(/<\/%[^%>]+%>/);
				tag=raw.slice(i+2,raw.indexOf("%>",i));
				_this.html[tag]=new String(raw.slice(i+tag.length+4,j));
				raw=raw.slice(j+tag.length+5)
			}
			//if(vhcSC.landingPage){
				_this.html["HEADER"]=_this.html["LOAD"]="";
				tag="STEP1";
				raw=_this.html["LP_"+tag];
				typeof raw=="undefined"?null:_this.html[tag]=raw
			//}
			//if(!vhcSC.magiclocation){
			//	_this.html["LOCATION"]=_this.generateHTML("LOCATION_NO_SUGGEST");
			//	_this.html["LOCATION_DROPOFF"]=_this.generateHTML("LOCATION_DROPOFF_NO_SUGGEST")
			//}else{
			//	_this.html["LOCATION"]=_this.generateHTML("LOCATION_WITH_SUGGEST");
			//	_this.html["LOCATION_DROPOFF"]=_this.generateHTML("LOCATION_DROPOFF_WITH_SUGGEST")
			//}
			//vhcSC.displayPromotionCode?_this.html["PROMO"]=_this.html["LP_PROMO"]="":null;
			//if(typeof _this.html["CAR_PRICE_ROW"]!="undefined"){
			//	vhcSC.supportHybridData=true
			//}
			//if(typeof _this.html["vhc_FeeBreakdown"]=="undefined"){
			//	vhcSC.feeBreakdown=new Boolean(0)
			//}
			if((typeof _this.html["CAR_GRID"]!="undefined")&&(typeof _this.html["CAR_GRID_ROW"]!="undefined")&&(typeof _this.html["CAR_ELEMENT_EMPTY"]!="undefined")&&(vhcSC.supportHybridData)){
				for(var i=1;i<10;i++){
					var lookup="CAR_ELEMENT_"+i;
					if(typeof _this.html[lookup]!="undefined"){
						vhcSC.gridLayoutColumnCount=i
					}
				}
			}
			var testData1='1'+new Date().toGMTString()+'1';
			var testData2='2'+new Date().toGMTString()+'2';
			_this.html["CAR_ROW_locationType"]=testData1;
			_this.html["CAR_TITLE_locationType"]=testData2;
			var lookup=_this.generateHTML("CAR_ROW");
			if((lookup.indexOf(testData1)!=-1)&&(lookup.indexOf(testData2)!=-1)){
				vhcSC.supportAlternateLegend=true
			}
			with(_this){
				//html["CACHE"]=generateCache();
				//html["FLAGS"]=generateFlag();
				html["CORE"]=generateHTML("CORE");
				delete html["LP_STEP1"];
				delete html["LP_PROMO"];
				delete html["CACHE"];
				delete html["HEADER"];
				delete html["LOAD"];
				delete html["STEP1"];
				delete html["PROMO"];
				delete html["FLAGS"];
				generate()
			}
		}else{
			if(ajaxHTML.isError()){
				alert(ajaxHTML.getDebugError())
			}
		}
	};
	function receiveLanguage(){
		if(ajaxLanguage.gotResponse()){
			var id=new String(),val=new String();
			label=parser.parseText(ajaxLanguage.responseText).split("\n");
			for(var i=new Number(0);i<label.length;i++){
				label[i]=label[i].split(/=\s*/);
				id=label[i].shift();
				val=label[i].length>1?label[i].join("="):label[i][0];
				id=="PleaseSelect"?val+="...":null;
				label[id]=val
			}
			vhcSC.language.generate()
		}else{
			if(ajaxLanguage.isError()){
				alert(ajaxLanguage.getDebugError())
			}
		}
	};
	function generateCache(){
		var _array=new Array("qtrax","errorReport"),raw=new String();
		for(var i=new Number(0);i<_array.length;i++){
			raw+='<img id="'+vhcID.pre+_array[i]+'">'
		}
		raw='<div class="vhc_none">'+raw+(vhcSC.landingPage?'':'<!--[if IE]><iframe id="'+vhcID.pre+'historyFrame" src="javascript:;"></iframe><![endif]-->')+'</div>';
		if(!vhcSC.landingPage){
			var index;
			_array=new Array("car","conditions","email");
			for(i=0;i<_array.length;i++){
				index=vhcID.pre+_array[i];
				raw+='<iframe id="'+index+'Frame" name="'+index+'Frame" src="javascript:;" frameborder="0" scrolling="no"></iframe>'
			}
		}
		return raw
	};
	function generateFlag(){
		var raw=new String();
		if(this.img){
			var index;
			for(var i=new Number(0);i<this.img.length;i++){
				index=this.img[i];
				raw+='<td><input type="button" style="background-image:url('+index.src+');" onclick="vhcSC.setLanguage(\''+index.code+'\');"></td>'
			}
			raw='<table class="flags" cellspacing="0">'+'<tr>'+raw+'</tr>'+'</table>'
		}
		return raw
	};
	function generateHTML(code){
		
		var raw=new String(this.html[code]),tag=new String(),i;
		while(true){
			i=raw.search(/<%=[^>]+>/);
			if(i<0){
				break
			}
			tag=raw.slice(i+3,raw.indexOf(">",i));
			i=this.html[tag];
			raw=raw.replace("<%="+tag+">",typeof i=="undefined"?"":i)
		}
		return raw
	};
	function generate(){
		if((generate.caller!="undefined")&&(generate.caller!=null)){
			var _caller=new String(generate.caller.toString());
			var i=_caller.indexOf("function receive");
			_caller.slice(i,_caller.indexOf("()",i)).indexOf("HTML")>0?this.htmlComplete=true:this.labelComplete=true;
			if(this.htmlComplete&&this.labelComplete){
				label.length=0;
				var aux_core=this.translate("CORE");
				
				vhcSC.generate(aux_core)
			}
		}
	};
	function translate(code){
		
		var raw=new String(this.html[code]),tag=new String(),i=new Number();
		while(true){
			i=raw.search(/<%[^>=]+>/);
			if(i<0){
				break
			}
			tag=raw.slice(i+2,raw.indexOf(">",i));
			raw=raw.replace("<%"+tag+">",label[tag])
		}
		
		return raw
	};
	function getLabel(id){
		var index=label[id];
		index?null:vhcSC.debug?null:alert("ERROR: missed label = "+id);
		return index
	}
};

function vhcOption(){
	this.add=add;
	this.list=list;
	this.rem=rem;
	this.remSelect=remSelect;
	this.clear=clear;
	this.get=get;
	this.getSelected=getSelected;
	this.getText=getText;
	function add(id,text,val,_selected){
		var i=this.get(id),l=i.length;
		i[l]=new Option(text,val,false,false);
		_selected?i[l].selected=true:null
	};
	function list(id,_min,_max,_selected){
		for(var i=new Number(_min);i<=_max;i++){
			this.add(id,i.zero(),i,_selected==i)
		}
	};
	function rem(id,i){
		vhcID.get(id).remove(i?i:0)
	};
	function remSelect(id){
		this.get(id)[0].text==vhcSC.translate("PleaseSelect")?this.rem(id):null
	};
	function clear(id){
		vhcID.disable(id);
		while(vhcID.get(id).length){
			this.rem(id)
		}
		return true
	};
	function get(id){
		return vhcID.get(id).options
	};
	function getSelected(id){
		return vhcID.get(id).selectedIndex
	};
	function getText(id){
		return this.get(id)[this.getSelected(id)].text
	}
};

function vhcEvent(){
	var option=vhcOption;
	this.set=set;
	this.setIndex=setIndex;
	//this.onChange_countryList=countryList;
	//this.onChange_pickupList=pickupList;
	this.onChange_datePickup_d=datePickup_d;
	this.onChange_datePickup_m=datePickup_m;
	this.onChange_dateDropoff_m=dateDropoff_m;
	this.onChange_datePickup_y=datePickup_y;
	this.onChange_dateDropoff_y=dateDropoff_y;
	//this.onChange_timePickup_h=timePickup_h;
	//this.onChange_timePickup_m=timePickup_m;
	//this.onChange_carGroupList=carGroupList;
	//this.onChange_residenceList=residenceList;
	this.onClick_calendarPickupButton=calendarPickupButton;
	this.onClick_calendarDropoffButton=calendarDropoffButton;
	this.onClick_searchButton=searchButton;
	this.onClick_tipoVuelo1Button=tipoVueloRadio1;
	this.onClick_tipoVuelo2Button=tipoVueloRadio2;
	//this.onClick_ListPickupButton=ventana_origenVuelo;
	//this.onClick_ListDropoffButton=ventana_destinoVuelo;
	this.onChange_numhab=cambio_habitaciones;
	this.onChange_numnin_1=edad_numnin_1;
	this.onChange_numnin_2=edad_numnin_2;
	this.onChange_numnin_3=edad_numnin_3;
	function set(){
		if(vhcSC.Step2){
			var id=new Array("datePickup_d","datePickup_m","dateDropoff_m","datePickup_y","dateDropoff_y","calendarPickupButton","calendarDropoffButton","numhab","numnin_1","numnin_2","numnin_3","searchButton"),index;
		}else{
			var id=new Array("datePickup_d","datePickup_m","dateDropoff_m","datePickup_y","dateDropoff_y","calendarPickupButton","calendarDropoffButton","tipoVuelo1Button","tipoVuelo2Button","searchButton"),index;
		}
		//if(vhcSC.magiclocation){
		//}else{
		//	id.push("countryList");
		//	id.push("pickupList")
		//}
		for(var i=new Number(0);i<id.length;i++){
			index=id[i];
			eval("vhcID.on"+(index.indexOf("Button")<0?"Change":"Click")+"('"+index+"')")
		}
	};
	function setIndex(index){
		//if(vhcSC.Step2){
		//	var id=new Array("datePickup_d","datePickup_m","dateDropoff_m","datePickup_y","dateDropoff_y","calendarPickupButton","calendarDropoffButton","indiv_childCount","doble_childCount","doble_twochildCount","triple_childCount","searchButton"),index;
		//}else{
		//	var id=new Array("datePickup_d","datePickup_m","dateDropoff_m","datePickup_y","dateDropoff_y","calendarPickupButton","calendarDropoffButton","ListPickupButton","ListDropoffButton","tipoVuelo1Button","tipoVuelo2Button","searchButton"),index;
		//}
		//if(vhcSC.magiclocation){
		//}else{
		//	id.push("countryList");
		//	id.push("pickupList")
		//}
		//for(var i=new Number(0);i<id.length;i++){
			//index=id[i];
			eval("vhcID.on"+(index.indexOf("Button")<0?"Change":"Click")+"('"+index+"')");
		//}
	};
	function tipoVueloRadio1(){
		var name=new String("tipoVuelo1Button");
		if(vhcID.getValue(name)=="ida_vuelta"){
			//vhcID.disable("ListDropoffButton",true);
			vhcID.disable("dateDropoff_d",true);
			vhcID.disable("dateDropoff_m",true);
			vhcID.disable("dateDropoff_y",true);
			vhcID.disable("calendarDropoffButton",true);
		}
		
	};	
	function tipoVueloRadio2(){
		var name=new String("tipoVuelo2Button");
		if(vhcID.getValue(name)=="ida"){
			//vhcID.disable("ListDropoffButton",false);
			vhcID.disable("dateDropoff_d",false);
			vhcID.disable("dateDropoff_m",false);
			vhcID.disable("dateDropoff_y",false);
			vhcID.disable("calendarDropoffButton",false);
		}
	};
	function ventana_origenVuelo(){
		window.open("http://www.doltronicweb.com/vuelomashotelmix/vuelos/php/masinfo2_buscadorexterno.php?accion=change&pais=ESPAŅA&vuelo=1&hotel=0&coche=0&ticket=0&agencia="+vhcSC.getTemplate(),'_blank','top=0, left=0, width=400,height=160,resizable=0,scrollbars=0');
	};
	function ventana_destinoVuelo(){
		if(vhcSC.Step2){
			window.open("http://www.doltronicweb.com/vuelomashotelmix/vuelos/php/masinfo3_buscadorexterno.php?accion=change&pais=ESPAŅA&vuelo=0&hotel=1&coche=0&ticket=0&agencia="+vhcSC.getTemplate(),'_blank','top=0, left=0,width=400,height=160,resizable=0,scrollbars=0');
		}else{
			window.open("http://www.doltronicweb.com/vuelomashotelmix/vuelos/php/masinfo3_buscadorexterno.php?accion=change&pais=ESPAŅA&vuelo=1&hotel=0&coche=0&ticket=0&agencia="+vhcSC.getTemplate(),'_blank','top=0, left=0,width=400,height=160,resizable=0,scrollbars=0');
		}
	};
	/*function countryList(){
		var name=new String("countryList");
		with(abeSC){
			setCountryID(abeID.getValue(name));
			setCountryName(option.getText(name));
			delete pickupID;
			delete returnID;
			delete pickupName;
			delete returnName;
			step1Container.pickup.populate()
		}
		option.remSelect(name)
	};
	function pickupList(){
		var name=new String("pickupList"),id=new String(abeID.getValue(name));
		if(id.length){
			with(abeSC){
				setPickupID(id);
				setPickupName(option.getText(name));
				delete returnID;
				delete returnName;
				step1Container.dropoff.populate()
			}
		}
		option.remSelect(name)
	};*/
	function datePickup_d(){
		vhc_changePickupDate()
	};
	function datePickup_m(days,years,month){
		var yearValue=new Number(vhcID.get("datePickup_y").value);
		function daysInMonth(iMonth,iYear){
			return 32-new Date(iYear,iMonth,32).getDate()
		}
		if(month!=undefined){
			var nbDays=daysInMonth(month,yearValue)
		}else{
			var nbDays=daysInMonth(this.selectedIndex,yearValue)
		}
		var daySelected=vhcID.get("datePickup_d").selectedIndex+1;
		if(daySelected>nbDays){
			daySelected=1
		}
		var days=vhcID.get("datePickup_d").options.length=0;
		vhcOption.list("datePickup_d",1,nbDays,daySelected);
		var month=this.selectedIndex+1;
		vhc_changePickupDate()
	};
	function dateDropoff_m(days,years,month){
		var yearValue=new Number(vhcID.get("dateDropoff_y").value);
		function daysInMonth(iMonth,iYear){
			return 32-new Date(iYear,iMonth,32).getDate()
		}
		if(month!=undefined){
			var nbDays=daysInMonth(month,yearValue)
		}else{
			var nbDays=daysInMonth(this.selectedIndex,yearValue)
		}
		var daySelected=vhcID.get("dateDropoff_d").selectedIndex+1;
		if(daySelected>nbDays){
			daySelected=1
		}
		var days=vhcID.get("dateDropoff_d").options.length=0;
		vhcOption.list("dateDropoff_d",1,nbDays,daySelected)
	};
	function datePickup_y(){
		datePickup_m(vhcID.get("datePickup_d").selectedIndex,vhcID.get("datePickup_y").value,vhcID.get("datePickup_m").selectedIndex)
	};
	function dateDropoff_y(){
		dateDropoff_m(vhcID.get("dateDropoff_d").selectedIndex,vhcID.get("dateDropoff_y").value,vhcID.get("dateDropoff_m").selectedIndex)
	};
	/*function timePickup_h(){
		abe_changePickupTime()
	};
	function timePickup_m(){
		abe_changePickupTime()
	};
	function carGroupList(){
		option.remSelect("carGroupList")
	};
	function residenceList(){
		option.remSelect("residenceList")
	};*/
	function calendarPickupButton(event){
		event?vhcID.mouse(event):null;
		vhc_popUpCalendar("Pickup")
	};
	function calendarDropoffButton(event){
		event?vhcID.mouse(event):null;
		vhc_popUpCalendar("Dropoff")
	};
	function searchButton(){
		
		vhcID.setValue("agencia",vhcSC.getClientID());
		var formulario=vhcID.get("buscador");
		formulario.action=vhcSC.getStep2URL();
		formulario.submit();
	};
	function cambio_habitaciones(){
		var name=new String("numhab");
		var num_hab=vhcID.getValue(name);
		for(var nh=1; nh<=3; nh++){
			if(nh<=num_hab){
				if(vhcID.getdisplay("habitacion_"+nh)=="none"){
					vhcID.setValue("seled_"+nh+"0","0");
					vhcID.setValue("seled_"+nh+"1","0");
					vhcID.display("edad_"+nh+"0","none");
					vhcID.display("edad_"+nh+"1","none");
					vhcID.display("txteda"+nh,"none");
					vhcID.setValue("numnin_"+nh,"0");
					vhcID.setValue("numadu_"+nh,"1");
					vhcID.display("habitacion_"+nh,"block");
				}
			}else{
				vhcID.setValue("seled_"+nh+"0","0");
				vhcID.setValue("seled_"+nh+"1","0");
				vhcID.display("edad_"+nh+"0","none");
				vhcID.display("edad_"+nh+"1","none");
				vhcID.display("txteda"+nh,"none");
				vhcID.setValue("numnin_"+nh,"0");
				vhcID.setValue("numadu_"+nh,"1");
				vhcID.display("habitacion_"+nh,"none");
			}
		}
	}
	function edad_numnin_1(){
		var name=new String("numnin_1");
		var num_ninios=vhcID.getValue(name);
		if(num_ninios>0){
			vhcID.display("txteda1","block");
			for(var nn=0;nn<num_ninios;nn++){
				vhcID.display("edad_1"+nn,"block");
				vhcID.setValue("seled_1"+nn,"0");
			}
		}else{
			vhcID.setValue("seled_10","0");
			vhcID.setValue("seled_11","0");
			vhcID.display("edad_10","none");
			vhcID.display("edad_11","none");
			vhcID.display("txteda1","none");
		}
	};
	function edad_numnin_2(){
		var name=new String("numnin_2");
		var num_ninios=vhcID.getValue(name);
		if(num_ninios>0){
			vhcID.display("txteda2","block");
			for(var nn=0;nn<num_ninios;nn++){
				vhcID.display("edad_2"+nn,"block");
				vhcID.setValue("seled_2"+nn,"0");
			}
		}else{
			vhcID.setValue("seled_20","0");
			vhcID.setValue("seled_21","0");
			vhcID.display("edad_20","none");
			vhcID.display("edad_21","none");
			vhcID.display("txteda2","none");
		}
	};
	function edad_numnin_3(){
		var name=new String("numnin_3");
		var num_ninios=vhcID.getValue(name);
		if(num_ninios>0){
			vhcID.display("txteda3","block");
			for(var nn=0;nn<num_ninios;nn++){
				vhcID.display("edad_3"+nn,"block");
				vhcID.setValue("seled_3"+nn,"0");
			}
		}else{
			vhcID.setValue("seled_30","0");
			vhcID.setValue("seled_31","0");
			vhcID.display("edad_30","none");
			vhcID.display("edad_31","none");
			vhcID.display("txteda3","none");
		}
	};
	
	
	/*function searchButton(){
		abeOnClick_searchAvail();
		var id=new String(),val=new String();
		val=abeID.getValue("pickupList");
		if(!val.length){
			alert(abeSC.translate("SearchErrorPickupLocation"));
			return
		}
		id="dropoffList";
		val=abeID.getValue(id);
		if(val.length){
			with(abeSC){
				if(!abeSC.magiclocation){
					setReturnID(val);
					setReturnName(option.getText(id))
				}else{
					if(document.getElementById('abe_droplocation_cb').checked){
						if(isNaN(abeSC.returnID)){
							var msg=abeSC.language.getLabel("AutoSuggestDropOffLocationError");
							alert(msg);
							return
						}
						setReturnID(abeSC.returnID);
						if(isNaN(abeSC.returnID)){
							return
						}
						idVal="ASlocation_dropoff_xml";
						setReturnName(abeID.getValue(idVal))
					}else{
						setReturnName(abeSC.pickupName);
						setReturnID(abeSC.pickupID)
					}
				}
			}
		}else{
			alert(abeSC.translate("SearchErrorDropoffLocation"));
			return
		}
		var index=new Array("Pickup","Dropoff"),today=new Date().valueOf();
		for(var i=new Number(0);i<index.length;i++){
			id="date"+index[i]+"_";
			index[i]=new Date(abeID.getValue(id+"y"),abeID.getValue(id+"m"),abeID.getValue(id+"d"),abeID.getValue("time"+index[i]+"_h"),abeID.getValue("time"+index[i]+"_m"))
		}
		var pickup=index[0].valueOf(),dropoff=index[1].valueOf();
		if(pickup<today||pickup>=dropoff){
			alert(abeSC.translate("SearchErrorDatesIncorrect"));
			return
		}
		for(i=0;i<index.length;i++){
			id=index[i];
			i?abeSC.setReturnDate(id.getDate(),id.getMonth(),id.getFullYear()):abeSC.setPickupDate(id.getDate(),id.getMonth(),id.getFullYear())
		}
		abeSC.setPickupTime(abeID.getValue("timePickup_h"),abeID.getValue("timePickup_m"));
		abeSC.setReturnTime(abeID.getValue("timeDropoff_h"),abeID.getValue("timeDropoff_m"));
		val=abeID.getValue("driverAge");
		if(isFinite(val)&&Number(val)>=18){
			abeSC.setDriversAge(val)
		}else{
			alert(abeSC.translate("driverAge_valid"));
			return
		}
		if(!abeSC.displayPromotionCode){
			val=abeID.getValue("promoCode");
			abeSC.setPromoCode(val)
		}
		abeSC.setCurrencyID(abeID.getValue("currencyList"));
		id="carGroupList";
		val=abeID.getValue(id);
		if(val.length){
			with(abeSC){
				setCarGroupID(val);
				setCarGroupName(option.getText(id))
			}
		}else{
			alert(abeSC.translate("SearchErrorCarGroup"));
			return
		}
		id="residenceList";
		val=abeID.getValue(id);
		if(val.length){
			abeSC.setResidence(option.getText(id),val)
		}else{
			alert(abeSC.translate("SearchErrorResidence"));
			return
		}
		abeSC.landingPage?abeSC.loadPage2():abeSC.step2Container.populate()
	}*/
};

function vhcSTEP1Container(){
	//this.country=new abeCountry();
	//this.pickup=new abePickup();
	//this.dropoff=new abeDropoff();
	this.date=new vhcDate();
	//this.time=new abeTime();
	//this.currency=new abeCurrency();
	//this.carGroup=new abeCarGroup();
	//this.residence=new abeResidence();
	this.populate=populate;
	//this.populateStep1=populateStep1;
	//this.enableSearchButton=enableSearchButton;
	//this.disableSearchButton=disableSearchButton;
	function populate(){
		//sdfgh
		/*if(!abeSC.magiclocation){
			this.country.populate();
			abeSC.language.html["LOCATION"]=abeSC.language.generateHTML("LOCATION_NO_SUGGEST");
			abeSC.language.html["LOCATION_DROPOFF"]=abeSC.language.generateHTML("LOCATION_DROPOFF_NO_SUGGEST")
		}else{
			var pickupLocation_defaultTxt=abeSC.language.getLabel("pickupTypeIn");
			abeID.setValue("ASlocation_xml",pickupLocation_defaultTxt);
			var dropoffLocation_defaultTxt=abeSC.language.getLabel("dropoffTypeIn");
			abeID.setValue("ASlocation_dropoff_xml",dropoffLocation_defaultTxt);
			var pickupLocation_ID=abeID.get("ASlocation_xml");
			pickupLocation_ID.onfocus=function(){if(abeID.getValue("ASlocation_xml")===pickupLocation_defaultTxt)abeID.setValue("ASlocation_xml","")};
			var droplocationDisplay_ID=abeID.get("droplocation_cb");
			droplocationDisplay_ID.onclick=function(){
				if(document.getElementById('abe_droplocation_cb').checked){
					abeID.setValue("ASlocation_dropoff_xml",dropoffLocation_defaultTxt);
					abeSC.returnID=NaN;
					document.getElementById('abe_dropoffDiv').style.display="block"
				}else{
					document.getElementById('abe_dropoffDiv').style.display="none";abeSC.returnID=abeSC.pickupID
				}
			};
			var as_xml=new DOLTRONIC.AutoSuggest('abe_ASlocation_xml',{url:abeSC.url,baseUrl:abeSC.srcURL,id:abeSC.clientID,i18n:{noresults:abeSC.language.getLabel("MagicLocation_noresult"),nopickup:"Please, enter a location in the same country as the pick up location",prevTxt:abeSC.language.getLabel("MagicLocation_prev"),nextTxt:abeSC.language.getLabel("MagicLocation_next")},style_name:abeSC.magiclocationParam.style?abeSC.magiclocationParam.style:"darkgray",style_path:abeSC.srcURL+"files/template/style/suggest/",target:abeSC.target,flag_path:"https://www.cartrawler.com/templates/flags/",flag_size:abeSC.magiclocationParam.flag_size?abeSC.magiclocationParam.flag_size:16,flag:abeSC.magiclocationParam.flag?abeSC.magiclocationParam.flag:false,type:abeSC.magiclocationParam.type?abeSC.magiclocationParam.type:"default",language:abeSC.languageID,callback:function(obj){document.getElementById('abe_pickupList').value=obj.id;with(abeSC){setCountryID(obj.info);setPickupID(obj.id);setPickupName(obj.value);step1Container.dropoff.populate()}}});
			var dropoffLocation_ID=abeID.get("ASlocation_dropoff_xml");
			dropoffLocation_ID.onfocus=function(){
				if(abeID.getValue("ASlocation_dropoff_xml")===dropoffLocation_defaultTxt)abeID.setValue("ASlocation_dropoff_xml","")
			};
			var as_dropoff_xml=new DOLTRONIC.AutoSuggest('abe_ASlocation_dropoff_xml',{url:abeSC.url,baseUrl:abeSC.srcURL,id:abeSC.clientID,i18n:{noresults:abeSC.language.getLabel("MagicLocation_noresult"),nopickup:"Please, enter a location in the same country as the pick up location",prevTxt:abeSC.language.getLabel("MagicLocation_prev"),nextTxt:abeSC.language.getLabel("MagicLocation_next")},style_name:abeSC.magiclocationParam.style?abeSC.magiclocationParam.style:"darkgray",style_path:abeSC.srcURL+"files/template/style/suggest/",type:"dropoff",pickupID:"abe_pickupList",pickupName:"abe_ASlocation_xml",flag_path:"https://www.cartrawler.com/templates/flags/",flag_size:abeSC.magiclocationParam.flag_size?abeSC.magiclocationParam.flag_size:16,flag:abeSC.magiclocationParam.flag?abeSC.magiclocationParam.flag:false,type:abeSC.magiclocationParam.type?abeSC.magiclocationParam.type:"default",target:abeSC.target,language:abeSC.languageID,callback:function(obj){if(obj.id===NaN){var msg=abeSC.language.getLabel("AutoSuggestDropOffLocationError");alert(msg)}else{document.getElementById('abe_dropoffList').value=obj.id;with(abeSC){setReturnID(obj.id);setReturnName(obj.value)}}}});
			abeSC.language.html["LOCATION"]=abeSC.language.generateHTML("LOCATION_WITH_SUGGEST");
			abeSC.language.html["LOCATION_DROPOFF"]=abeSC.language.generateHTML("LOCATION_DROPOFF_WITH_SUGGEST");
			if(abeSC.ASlocation_xml){
				abeID.setValue("ASlocation_xml",abeSC.ASlocation_xml);
				as_xml.getSuggestions(abeSC.ASlocation_xml)
			}
			abeSC.step1Container.pickup.populate()
		}*/
		this.date.populate();
		//this.time.populate();
		initCalendar();
		constructCalendar();
		if(!vhcSC.Step2){
			//vhcID.enable("ListPickupButton");
		}
		//vhcID.enable("ListDropoffButton");
		//abeSC.promoCode&&!abeSC.displayPromotionCode?abeID.setValue("promoCode",abeSC.promoCode):null;
		//abeSC.driversAge?abeID.setValue("driverAge",abeSC.driversAge):null;
		//this.currency.populate();
		//this.carGroup.populate();
		//this.residence.populate();
		//this.populateStep1=function(){}
	};
	/*function populateStep1(){
		with(abeSC){
			delete ppc;
			delete nolog
		}
		this.populate()
	};
	function enableSearchButton(){
		this.disableSearchButton(true)
	};
	function disableSearchButton(status){
		abeID.get("searchButton").className=!status?"disabled":""
	}*/
};

function vhcDate(){
	var option=vhcOption;
	this.monthShort=new Array(vhcSC.translate("MonthJanuaryShort"),vhcSC.translate("MonthFebruaryShort"),vhcSC.translate("MonthMarchShort"),vhcSC.translate("MonthAprilShort"),vhcSC.translate("MonthMayShort"),vhcSC.translate("MonthJuneShort"),vhcSC.translate("MonthJulyShort"),vhcSC.translate("MonthAugustShort"),vhcSC.translate("MonthSeptemberShort"),vhcSC.translate("MonthOctoberShort"),vhcSC.translate("MonthNovemberShort"),vhcSC.translate("MonthDecemberShort"));
	this.monthName=new Array(vhcSC.translate("MonthJanuary"),vhcSC.translate("MonthFebruary"),vhcSC.translate("MonthMarch"),vhcSC.translate("MonthApril"),vhcSC.translate("MonthMay"),vhcSC.translate("MonthJune"),vhcSC.translate("MonthJuly"),vhcSC.translate("MonthAugust"),vhcSC.translate("MonthSeptember"),vhcSC.translate("MonthOctober"),vhcSC.translate("MonthNovember"),vhcSC.translate("MonthDecember"));
	this.daysShort=new Array(vhcSC.translate("DayMondayShort"),vhcSC.translate("DayTuesdayShort"),vhcSC.translate("DayWednesdayShort"),vhcSC.translate("DayThursdayShort"),vhcSC.translate("DayFridayShort"),vhcSC.translate("DaySaturdayShort"),vhcSC.translate("DaySundayShort"));
	this.daysLong=new Array(vhcSC.translate("DayMonday"),vhcSC.translate("DayTuesday"),vhcSC.translate("DayWednesday"),vhcSC.translate("DayThursday"),vhcSC.translate("DayFriday"),vhcSC.translate("DaySaturday"),vhcSC.translate("DaySunday"));
	var startAt=0;startAt.valueOf()?null:this.daysShort.unshift(this.daysShort.pop());
	startAt.valueOf()?null:this.daysLong.unshift(this.daysLong.pop());
	this.populate=populate;
	function populate(){
		var today=new Date(),pickup=new Date(),dropoff=new Date(),_array=new Array("datePickup_","dateDropoff_"),suffix=new Array("y","m","d"),val=new Number(today.getFullYear()),index=new Number();
		pickup.setDate(today.getDate());
		dropoff.setDate(today.getDate()+1);
		for(var i=new Number(0);i<_array.length;i++){
			option.list(_array[i]+suffix[0],val,val+1,i.valueOf()?vhcSC.returnYear:vhcSC.pickupYear)
		}
		for(var j=new Number(0);j<this.monthShort.length;j++){
			val=this.monthShort[j];
			for(i=0;i<_array.length;i++){
				option.add(_array[i]+suffix[1],val,j,(i?vhcSC.returnMonth?vhcSC.returnMonth:dropoff.getMonth():vhcSC.pickupMonth?vhcSC.pickupMonth:pickup.getMonth())==j)
			}
		}
		for(i=0;i<_array.length;i++){
			option.list(_array[i]+suffix[2],1,31,i?vhcSC.returnDate?vhcSC.returnDate:dropoff.getDate():vhcSC.pickupDate?vhcSC.pickupDate:pickup.getDate())
		}
		for(j=0;j<suffix.length;j++){
			for(i=0;i<_array.length;i++){
				vhcID.enable(_array[i]+suffix[j])
			}
		}
		vhcID.enable("calendarPickupButton");
		vhcID.enable("calendarDropoffButton")
	}
};

function DOL_OTA_Engine(_ID_){
	vhcSC=this;
	this.displayID=_ID_;
	this.Step2URL="http://www.doltronicweb.com/vuelos-hoteles/index.php";
	this.clientID=null;
	this.Step2=false;
	this.events=null;
	//this.DefaultLanguage="ES";
	this.languageID="ES";
	this.Template="";
	this.url="include/otaproxy.php";
	this.srcURL="http://www.doltronicweb.com/vuelos-hoteles_externo/";
	initProtos();
	this.isStep2=isStep2;
	this.setStep1=setStep1;
	this.setStep2=setStep2;
	this.setStep2URL=setStep2URL;
	this.getStep2URL=getStep2URL;
	this.setURL=setURL;
	this.setClientID=setClientID;
	this.getClientID=getClientID;
	this.setDefaultLanguage=setDefaultLanguage;
	this.setTemplate=setTemplate;
	this.getTemplate=getTemplate;
	this.displayBUS=displayBookEngine;
	this.setErrorReportUrl=setErrorReport;
	this.errorReport=errorReport;
	this.translate=translate;
	this.debug=debug;
	this.generate=generate;
	this.cacheIcons=cacheIcons;
	
	function setStep1(){
		this.Step2=false
	};
	
	function setStep2(){
		this.Step2=true
	};
	
	function isStep2(){
		return this.Step2;
	};
	
	function initProtos(){
		String.prototype.toPrice=Number.prototype.toPrice=function(){return Number(this).toFixed(2)};
		String.prototype.zero=Number.prototype.zero=function(){return Number(this)<10?"0"+this:this.toString()};
		String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};
		Number.prototype.toPX=function(){return this+"px"}
	};
	
	function cacheIcons(){
		var index;
		this.img=new Array("conditions","airCondition","automatic","diesel","passengers","baggage","doors","GPS","emailQuote","bar","closeOver","noimage","loadimage");
		for(var i=new Number(0);i<this.img.length;i++){
			index=this.img[i];
			this.img[index]=new Image();
			this.img[index].src=this.srcURL+"files/template/image/"+this.template+"/"+index+".gif";
			i<9?this.language.html[index+"Icon"]=this.img[index].src:null
			//this.language.html[index+"Icon"]=this.img[index].src
		}
		this.img.length=0
	};
	
	function debug(){
		delete this.debug
	};
	
	function translate(id){
		return this.language.getLabel(id)
	};
	
	function setErrorReport(url){
		this.errorReportURL=new String(url);
		delete this.setErrorReportURL
	};
	
	function errorReport(msg,type,desc){
		this.errorReportURL?vhcID.get("errorReport").src=this.errorReportURL+"?"+"msg="+msg+"&"+"type="+type+"&"+"desc="+desc+"&"+"IP="+this.clientIP+"&"+"clientID="+this.clientID+"&"+"target="+this.target+"&"+"host="+window.location.hostname:null
	};
	
	function initProtos(){
		String.prototype.toPrice=Number.prototype.toPrice=function(){return Number(this).toFixed(2)};
		String.prototype.zero=Number.prototype.zero=function(){return Number(this)<10?"0"+this:this.toString()};
		String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};
		Number.prototype.toPX=function(){return this+"px"}
	};
	
	function setStep2URL(url){
		this.step2URL=new String(url);
		delete this.setStep2URL
	};
	
	function getStep2URL(url){
		return this.step2URL;
	};
	
	function setURL(url){
		this.url=new String(url);
		delete this.setURL
	};
	
	function setClientID(id){
		isFinite(id)?this.clientID=new Number(Number(id)):alert(err+"client ID = "+id)
	};
	
	function getClientID(id){
		return isFinite(this.clientID)?this.clientID:null;
	};
	
	function setDefaultLanguage(id){
		switch(id){
			case "ES": 
			case "EN": 
			case "FR": 
			case "AL": this.languageID=id.toUpperCase();
						break;
			default: this.languageID=null;
		}
	};
	
	function setTemplate(file){
		this.template=String(file)
	};
	
	function getTemplate(){
		return this.template;
	};
	
	function generate(html){
		
		vhcID.inner(this.displayID,html);
		var id=new Array("datePickup_d","datePickup_m","datePickup_y","dateDropoff_d","dateDropoff_m","dateDropoff_y","calendarPickupButton","calendarDropoffButton","timePickup_h","timePickup_m","timeDropoff_h","timeDropoff_m","driverAge","currencyList","carGroupList","residenceList","searchButton"),index;
		this.step1Container=new vhcSTEP1Container();
		this.events=new vhcEvent();
		this.step1Container.populate();
		this.events.set();
		//this.cacheIcons();
		try{
			vhcID.get("qtrax").style.display="table"
		}catch(e){
			vhcID.gecko=true
		}
		vhcID.display("STEP1","block");
		if(vhcSC.Step2){
			new AjaxJspTag.Autocomplete(
					this.url, {
					 minimumCharacters: "3",
					 parameters: "cadena={vhc_vdestino_hotel}&tipo=destino&vuelo=false&hotel=true&coche=false&excursion=0",
					 progressStyle: "throbbing",
					 target: "vhc_vdestino_hotel",
					 forceSelection: "true",
					 className: "autocomplete",
					 source: "vhc_vdestino_hotel"
					 }
					 ); 
		}else{
			
		
			new AjaxJspTag.Autocomplete(
					this.url, {
					 minimumCharacters: "3",
					 parameters: "cadena={vhc_vorigen_vuelo}&tipo=origen",
					 progressStyle: "throbbing",
					 target: "vhc_vorigen_vuelo",
					 forceSelection: "true",
					 className: "autocomplete",
					 source: "vhc_vorigen_vuelo"
					 }
					 ); 
			
			new AjaxJspTag.Autocomplete(
					this.url, {
					 minimumCharacters: "3",
					 parameters: "cadena={vhc_vdestino_vuelo}&tipo=destino&vuelo=true&hotel=false&coche=false&excursion=0",
					 progressStyle: "throbbing",
					 target: "vhc_vdestino_vuelo",
					 forceSelection: "true",
					 className: "autocomplete",
					 source: "vhc_vdestino_vuelo"
					 }
					 ); 
		}
		//sfsda
		/*if(abeSC.magiclocation){
			id.push("ASlocation_xml");
			id.push("ASlocation_dropoff_xml")
		}else{
			id.push("countryList");
			id.push("pickupList");
			id.push("dropoffList")
		}
		for(var i=new Number(0);i<id.length;i++){
			index=id[i];
			if(!vhcID.get(index)){
				alert("ERROR: missing core ID = "+vhcID.pre+index+"\n\n"+"CarTrawler AJAX Booking Engine can not work without core element,\n"+"please ensure that all required elements and their IDs exist.");
				break;
				return
			}
		}
		
		this.step1Container=new abeSTEP1Container();
		this.events=new abeEvent();
		this.landingPage||!this.isValidRequest?this.step1Container.populate():null;
		this.events.set();
		this.cacheIcons();
		try{
			abeID.get("qtrax").style.display="table"
		}catch(e){
			abeID.gecko=true
		}
		abeID.display("STEP1","block");
		qtraxLog(1)
		*/
		
	};
	
	function displayBookEngine(){
		var browser=new DOLTRONIC.BrowserDetect();
		var browserName=browser.getBrowserName();
		var browser_ok=true;
		if(browserName=="Explorer"){
			if(browser.version<6){
				browser_ok=false;
				var DOM=new DOLTRONIC.DOM();
				var vhcDOL_id=DOM.gE("vhc_DOL");
				var vhcBrowser=DOM.cE("div",{id:"browserNOK",className:"browserNOK",width:"400px"},"Your Browser version is not supported, you should upgrade to a more uptodate version.");
				vhcDOL_id.appendChild(vhcBrowser)
			}
		}
		if(browser_ok){
			if(vhcUncompressionComplete()){
				var s=new String("standard");
				this.displayID=vhcID.getObj(this.displayID);
				with(vhcID){
					addStyle(s+"/buscador");
					inner(this.displayID,'<div class="vhc_browser">PLEASE WAIT<br><br><br>browser is loading booking engine</div>')
				}
				var ajax=new vhcAJAX();
				if(ajax.createXMLHttp()){
					var temp=new String(this.template);
					vhcID.addStyle(temp+"/buscador");
					vhcID.addStyle("ui/ui.base");
					this.language=new vhcLanguage();
					this.loading=new vhcLoad();	
					this.language.getSource();
					/*this.cookieIndicator=this.checkCookieExists(document.cookie,'clientCookie');
					if(this.parseURL()){
						abeDeepLink_onload();
						var url=new String(typeof this.setStylesheetURL=="function"?"":this.setStylesheetURL),temp=new String(this.template);
						this.language=new abeLanguage();
						if(url.length>0){
							abeID.addStyle(null,url)
						}else{
							abeID.addStyle(temp+"/"+temp+(this.templateColor?"_"+this.templateColor:""))
						}
						this.setOptionalInsuranceDailyAmount(4.73);
						this.setGBPCurencyRate(1.2722);
						if(!this.Step15){
							this.step1Container=new abeSTEP1Container();
							this.step1Container.carGroup.populateStep2()
						}else{
							this.step15Container=new abeSTEP15Container()
						}
						this.loading=new abeLoad();
						this.language.getSource()
					}
					if(this.cookieIndicator==0){
						this.setClientCookieID('clientCookie',this.clientID,28)
					}*/
				}else{
					vhcID.inner(vhcID.tag("div",this.displayID)[0],'! NOTE !<br />'+'YOUR BROWSER DOES NOT SUPPORT ACTIVEX CONTROLS!<br /><br />'+'Please update browser or enable ActiveX as described <a href="http://www.microsoft.com/windows/ie/ie6/using/howto/security/setup.mspx#ELAAE" target="_blank">here</a>'+'<img id="'+vhcID.pre+'errorReport" />');
					var n=navigator;
					this.errorReport("vhcAJAX.createXMLHttp ()","","could not create AJAX object,\nbrowser: "+n.appName+"\nversion: "+n.appVersion+"\nplatform: "+n.platform+"\nuser agent: "+n.userAgent)
				}
			}
		}
	};
};
var fixedX=-1;
var fixedY=-1;
var startAt=0;
var showToday=1;
var crossobj,crossMonthObj,crossYearObj,monthSelected,yearSelected,dateSelected,omonthSelected,oyearSelected,odateSelected,monthConstructed,yearConstructed,intervalID1,intervalID2,timeoutID1,timeoutID2;
var ie=(document.all&&navigator.userAgent.search("MSIE")!=-1&&!window.opera?true:false);
var today=new Date();
var dateNow=today.getDate();
var monthNow=today.getMonth();
var yearNow=today.getYear();
var dateMin=new Date(2008,1,1);
var dayMin=1;
var monthMin=0;
var yearMin=yearNow;
var dayMax=31;
var monthMax=11;
var yearMax=(yearNow+1);

function hideElement(elmID,overDiv){
	if(ie){
		for(i=0;i<document.all.tags(elmID).length;i++){
			obj=document.all.tags(elmID)[i];
			if(!obj||!obj.offsetParent){
				continue
			}
			objLeft=obj.offsetLeft;
			objTop=obj.offsetTop;
			objParent=obj.offsetParent;
			while(objParent.tagName.toUpperCase()!="BODY"){
				objLeft+=objParent.offsetLeft;
				objTop+=objParent.offsetTop;
				objParent=objParent.offsetParent
			}
			objHeight=obj.offsetHeight;
			objWidth=obj.offsetWidth;
			if((overDiv.offsetLeft+overDiv.offsetWidth)<=objLeft){
				
			}else if((overDiv.offsetTop+overDiv.offsetHeight)<=objTop){
				
			}else if(overDiv.offsetTop>=(objTop+objHeight)){
				
			}else if(overDiv.offsetLeft>=(objLeft+objWidth)){
				
			}else{
				obj.style.visibility="hidden"
			}
		}
	}
};

function showElement(elmID){
	if(ie){
		for(i=0;i<document.all.tags(elmID).length;i++){
			obj=document.all.tags(elmID)[i];
			if(!obj||!obj.offsetParent){
				continue
			}
			obj.style.visibility=""
		}
	}
};

function HolidayRec(d,m,y,desc){
	this.d=d;
	this.m=m;
	this.y=y;
	this.desc=desc
};
var HolidaysCounter=0;
var Holidays=new Array();

function addHoliday(d,m,y,desc){
	Holidays[HolidaysCounter++]=new HolidayRec(d,m,y,desc)
};

document.write("<div onclick='bShow=true' id='calendar' style='z-index:+999; position:absolute; visibility:hidden;'><table width=210px class='cal_outertbl'><tr class='cal_outerrow'><td><table width=208px><tr><td class='cal_navbar'><div id='caption'></div></td><td class=\"cal_close\" onclick=\"hideCalendar();\" title=\"\">&times;</td></tr></table></td></tr><tr><td style='padding:2px' bgcolor=#ffffff><span id='abe_calendarContent'></span></td></tr>");

if(showToday==1){
	document.write("<tr class='cal_bottom'><td style='padding:2px' align=center><span id='lblToday'></span></td></tr>")
}
document.write("</table></div><div id='selectMonth' style='z-index:+999;position:absolute;visibility:hidden;'></div><div id='selectYear' style='z-index:+999;position:absolute;visibility:hidden;'></div>");
var monthName=new Array("MonthJanuary","MonthFebruary","MonthMarch","MonthApril","MonthMay","MonthJune","MonthJuly","MonthAugust","MonthSeptember","MonthOctober","MonthNovember","MonthDecember");
var vhcDaysShort=new Array("Mon","Tue","Wed","Thu","Fri","Sat","Sun");
startAt.valueOf()?null:vhcDaysShort.unshift(vhcDaysShort.pop());
var styleAnchor="text-decoration:none;color:#000000;";
var styleNoneSelect="text-decoration:line-through;color:grey;font-size:10px;";
var styleLightBorder="border:1px solid #a0a0a0;";

function initCalendar(){
	!ie?yearNow+=1900:null;
	crossobj=document.getElementById("calendar").style;
	hideCalendar();
	crossMonthObj=document.getElementById("selectMonth").style;
	crossYearObj=document.getElementById("selectYear").style;
	monthConstructed=false;
	yearConstructed=false;
	if(showToday==1){
		document.getElementById("lblToday").innerHTML='<span id="vhc_todayIs">'+vhcSC.translate("todayIs")+'</span>'+" <a href='javascript:;' title='"+vhcSC.translate("calendarGoToMonth")+"' style='"+styleAnchor+"' onclick='monthSelected=monthNow;yearSelected=yearNow;constructCalendar();'>"+vhcSC.step1Container.date.daysShort[(today.getDay()-startAt==-1)?6:(today.getDay()-startAt)]+", "+dateNow+" "+vhcSC.step1Container.date.monthShort[monthNow]+" "+yearNow+"</a>"
	}
	document.getElementById("caption").innerHTML='<div id="spanLeft" class="cal_navbox" onclick="decMonth();" onmouseout="clearInterval(intervalID1);" onmousedown="clearTimeout(timeoutID1);timeoutID1=setTimeout(\'StartDecMonth()\',500);" onmouseup="clearTimeout(timeoutID1);clearInterval(intervalID1)"><p class="cal_left" id="changeLeft"></p></div>'+'<div id="spanRight" class="cal_navbox" onmouseout="clearInterval(intervalID1);" onclick="incMonth();" onmousedown="clearTimeout(timeoutID1);timeoutID1=setTimeout(\'StartIncMonth()\',500);" onmouseup="clearTimeout(timeoutID1);clearInterval(intervalID1)"><p class="cal_right" id="changeRight"></p></div>'+'<div id="spanMonth" class="cal_navbox" onclick="popUpMonth();"></div>'+'<div id="spanYear" class="cal_navbox" onclick="popUpYear();"></div>';
	bPageLoaded=true;
	initCalendar=function(){};
	return true
};

function hideCalendar(){
	crossobj.visibility="hidden";
	if(crossMonthObj!=null){
		crossMonthObj.visibility="hidden"
	}
	if(crossYearObj!=null){
		crossYearObj.visibility="hidden"
	}
	showElement('SELECT');
	showElement('APPLET')
};

function closeCalendar(){
	var sTmp;
	var found=false;
	for(var i=0;i<ctlToPlaceValue_d.length&&!found;i++){
		if(ctlToPlaceValue_d[i].value==dateSelected){
			ctlToPlaceValue_d[i].selected=true;
			found=true
		}
	}
	found=false;
	for(var i=0;i<ctlToPlaceValue_m.length&&!found;i++){
		if(ctlToPlaceValue_m[i].value==monthSelected){
			ctlToPlaceValue_m[i].selected=true;
			found=true
		}
	}
	found=false;
	for(var i=0;i<ctlToPlaceValue_y.length&&!found;i++){
		if(ctlToPlaceValue_y[i].value==yearSelected){
			ctlToPlaceValue_y[i].selected=true;
			found=true
		}
	}
	vhc_changePickupDate();
	hideCalendar()
};

function incMonth(){
	monthSelected++;
	if(monthSelected>11){
		monthSelected=0;
		yearSelected++
	}
	constructCalendar()
};

function decMonth(){
	monthSelected--;
	if(monthSelected<0){
		monthSelected=11;
		yearSelected--
	}
	constructCalendar()
};

function constructMonth(){
	popDownYear();
	if(!monthConstructed){
		sHTML="";
		for(i=0;i<12;i++){
			sName=vhcSC.step1Container.date.monthName[i];
			if(i==monthSelected){
				sName="<B>"+sName+"</B>"
			}
			sHTML+="<tr><td id='m"+i+"' onmouseover='this.style.backgroundColor=\"#ffffff\"' onmouseout='this.style.backgroundColor=\"\"' style='cursor:pointer;' onclick='monthConstructed=false;monthSelected="+i+";constructCalendar();popDownMonth();event.cancelBubble=true'>&nbsp;"+sName+"&nbsp;</td></tr>"
		}
		document.getElementById("selectMonth").innerHTML="<table width=70 style='font-family:arial; font-size:11px; border-width:1px; border-style:solid; border-color:#a0a0a0;' bgcolor='#C6C6CA' cellspacing=0 onmouseover='clearTimeout(timeoutID1)'	onmouseout='clearTimeout(timeoutID1);timeoutID1=setTimeout(\"popDownMonth()\",100);event.cancelBubble=true'>"+sHTML+"</table>";
		monthConstructed=true
	}
};

function popUpMonth(){
	constructMonth();
	crossMonthObj.visibility="visible";
	crossMonthObj.left=(parseInt(crossobj.left)+50).toPX();
	crossMonthObj.top=(parseInt(crossobj.top)+26).toPX();
	hideElement('SELECT',document.getElementById("selectMonth"));
	hideElement('APPLET',document.getElementById("selectMonth"))
};

function popDownMonth(){
	crossMonthObj.visibility="hidden"
};

function incYear(){
	for(i=0;i<1;i++){
		newYear=(i+nStartingYear)+1;
		if(newYear==yearSelected){
			txtYear="&nbsp;<B>"+newYear+"</B>&nbsp;"
		}else{
			txtYear="&nbsp;"+newYear+"&nbsp;"
		}
		document.getElementById("y"+i).innerHTML=txtYear
	}
	nStartingYear++;
	bShow=true
};

function decYear(){
	for(i=0;i<1;i++){
		newYear=(i+nStartingYear)-1;
		if(newYear==yearSelected){
			txtYear="&nbsp;<B>"+newYear+"</B>&nbsp;"
		}else{
			txtYear="&nbsp;"+newYear+"&nbsp;"
		}
		document.getElementById("y"+i).innerHTML=txtYear
	}
	nStartingYear--;
	bShow=true
};

function selectYear(nYear){
	yearSelected=parseInt(nYear+nStartingYear);
	yearConstructed=false;
	constructCalendar();
	popDownYear()
};

function constructYear(){
	popDownMonth();
	sHTML="";
	if(!yearConstructed){
		sHTML="";
		j=0;
		nStartingYear=yearNow;
		for(i=nStartingYear;i<=(nStartingYear+1);i++){
			sName=i;
			if(i==yearSelected){
				sName="<B>"+sName+"</B>"
			}
			sHTML+="<tr><td id='y"+j+"' onmouseover='this.style.backgroundColor=\"#ffffff \"' onmouseout='this.style.backgroundColor=\"\"' style='cursor:pointer' onclick='selectYear("+j+");event.cancelBubble=true'>&nbsp;"+sName+"&nbsp;</td></tr>";
			j++
		}
		document.getElementById("selectYear").innerHTML="<table width=44 style='font-family:arial; font-size:11px; border-width:1px; border-style:solid; border-color:#a0a0a0;'	bgcolor='#C6C6CA' onmouseover='clearTimeout(timeoutID2)' onmouseout='clearTimeout(timeoutID2);timeoutID2=setTimeout(\"popDownYear()\",100)' cellspacing=0>"+sHTML+"</table>";
		yearConstructed=true
	}
};

function popDownYear(){
	clearInterval(intervalID1);
	clearTimeout(timeoutID1);
	clearInterval(intervalID2);
	clearTimeout(timeoutID2);
	crossYearObj.visibility="hidden"
};

function popUpYear(){
	var leftOffset;
	constructYear();
	crossYearObj.visibility="visible";
	leftOffset=parseInt(crossobj.left)+document.getElementById("spanYear").offsetLeft;
	if(ie){
		leftOffset+=6
	}
	crossYearObj.left=leftOffset.toPX();
	crossYearObj.top=(parseInt(crossobj.top)+26).toPX()
};

function constructDatesssss(d,m,y){
	sTmp=dateFormat;
	sTmp=sTmp.replace("dd","<e>");
	sTmp=sTmp.replace("d","<d>");
	sTmp=sTmp.replace("<e>",d.zero());
	sTmp=sTmp.replace("<d>",d);
	sTmp=sTmp.replace("mmm","<o>");
	sTmp=sTmp.replace("mm","<n>");
	sTmp=sTmp.replace("m","<m>");
	sTmp=sTmp.replace("<m>",m+1);
	sTmp=sTmp.replace("<n>",(m+1).zero());
	sTmp=sTmp.replace("<o>",vhcSC.step1Container.date.monthShort[m]);
	return sTmp.replace("yyyy",y)
};

function constructCalendar(){
	var aNumDays=Array(31,0,31,30,31,30,31,31,30,31,30,31);
	var startDate=new Date(yearSelected,monthSelected,1);
	var endDate;
	if(monthSelected==1){
		endDate=new Date(yearSelected,monthSelected+1,1);
		endDate=new Date(endDate-(24*60*60*1000));
		numDaysInMonth=endDate.getDate()
	}else{
		numDaysInMonth=aNumDays[monthSelected]
	}
	datePointer=0;
	dayPointer=startDate.getDay()-startAt;
	if(dayPointer<0){
		dayPointer=6
	}
	sHTML='<table cellspacing="0" style="font-family:Verdana;font-size:10px;border:0px none;">'+'<tr id="abe_calendarDaysList">';
	for(var i=new Number(0);i<vhcSC.step1Container.date.daysShort.length;i++){
		sHTML+='<td style="width:24px;font-weight:bold;text-align:right;">'+vhcSC.step1Container.date.daysShort[i]+'</td>'
	}
	sHTML+='</tr><tr>';
	for(var i=1;i<=dayPointer;i++){
		sHTML+="<td>&nbsp;</td>"
	}
	for(datePointer=1;datePointer<=numDaysInMonth;datePointer++){
		dayPointer++;
		sHTML+="<td align=right>";
		sStyle=styleAnchor;
		if((datePointer==odateSelected)&&(monthSelected==omonthSelected)&&(yearSelected==oyearSelected)){
			sStyle+=styleLightBorder
		}
		sHint="";
		for(k=0;k<HolidaysCounter;k++){
			if((parseInt(Holidays[k].d)==datePointer)&&(parseInt(Holidays[k].m)==(monthSelected+1))){
				if((parseInt(Holidays[k].y)==0)||((parseInt(Holidays[k].y)==yearSelected)&&(parseInt(Holidays[k].y)!=0))){
					sStyle+="background-color:#FFDDDD;";
					sHint+=sHint==""?Holidays[k].desc:"\n"+Holidays[k].desc
				}
			}
		}
		var regexp=/\"/g;
		sHint=sHint.replace(regexp,"&quot;");
		if(((datePointer<dayMin)&&(monthSelected==monthMin)&&(yearSelected==yearMin))||(monthSelected<monthMin)&&(yearSelected==yearMin)||(yearSelected<yearMin)){
			sHTML+="&nbsp;<span style='"+styleNoneSelect+"'>"+datePointer+"</span>&nbsp;"
		}else if(((datePointer>dayMax)&&(monthSelected==monthMax)&&(yearSelected==yearMax))||(monthSelected>monthMax)&&(yearSelected==yearMax)||(yearSelected>yearMax)){
			sHTML+="&nbsp;<span style='"+styleNoneSelect+"'>"+datePointer+"</span>&nbsp;"
		}else{
			sHTML+="<a title=\""+sHint+"\" style='"+sStyle+"' href='javascript:;' onclick='dateSelected="+datePointer+";closeCalendar();'>&nbsp;"+datePointer+"&nbsp;</a>"
		}
		sHTML+="";
		if((dayPointer+startAt)%7==startAt){
			sHTML+="</tr><tr>"
		}
	}
	document.getElementById("abe_calendarContent").innerHTML=sHTML;
	document.getElementById("spanMonth").innerHTML="<div>"+vhcSC.step1Container.date.monthName[monthSelected]+"</div><p id='changeMonth' class='cal_month'></p>";
	document.getElementById("spanYear").innerHTML="<div>"+yearSelected+"</div><p id='changeYear' class='cal_year'></p>"
};

function vhc_changePickupDate(){
	var pickupDate=new Date(vhcID.getValue("datePickup_y"),vhcID.getValue("datePickup_m"),vhcID.getValue("datePickup_d"));
	var dropOffDate=new Date(vhcID.getValue("dateDropoff_y"),vhcID.getValue("dateDropoff_m"),vhcID.getValue("dateDropoff_d"));
	if(pickupDate>=dropOffDate){
		dropOffDate.setDate(pickupDate.getDate()+1);
		var newYear=dropOffDate.getFullYear();
		var newMonth=dropOffDate.getMonth();
		var newDay=dropOffDate.getDate();
		var options,i;
		var yearObject=vhcID.get("dateDropoff_y");
		if(newYear!=yearObject.value){
			options=yearObject.options;
			i=0;
			while(Number(options[i].value)!=newYear){
				i++
			}
			options[i].selected=true
		}
		var monthObject=vhcID.get("dateDropoff_m");
		if(newMonth!=monthObject.value){
			options=monthObject.options;
			i=0;
			while(Number(options[i].value)!=newMonth){
				i++
			}
			options[i].selected=true
		}
		var dayObject=vhcID.get("dateDropoff_d");
		if(newDay!=dayObject.value){
			options=dayObject.options;
			i=0;
			while(Number(options[i].value)!=newDay){
				i++
			}
			options[i].selected=true
		}
	}
};

function vhc_popUpCalendar(where){
	var leftpos=0;
	var toppos=0;
	var element=new String("date"+where+"_");
	var ctl=vhcID.get(element+"d");
	var ctl_m=vhcID.get(element+"m");
	var ctl_y=vhcID.get(element+"y");
	var ctl2=vhcID.get(element+"d");
	var defaultDayInMs=today.getTime();
	var minDayInMs=defaultDayInMs;
	var maxDayInMs=defaultDayInMs;
	maxDayInMs+=(86400000*360);
	var minDate=new Date(minDayInMs);
	dayMin=minDate.getDate();
	monthMin=minDate.getMonth();
	yearMin=minDate.getFullYear();
	var maxDate=new Date(maxDayInMs);
	dayMax=maxDate.getDate();
	monthMax=maxDate.getMonth();
	yearMax=maxDate.getFullYear();
	if(bPageLoaded){
		if(crossobj.visibility=="hidden"){
			bShow=true;
			dateFormat="dd-mmm-yyyy";
			ctlToPlaceValue_d=vhcID.get(element+"d");
			ctlToPlaceValue_m=vhcID.get(element+"m");
			ctlToPlaceValue_y=vhcID.get(element+"y");
			dateSelected=(ctlToPlaceValue_d.value)/1;
			monthSelected=(ctlToPlaceValue_m.value)/1;
			yearSelected=(ctlToPlaceValue_y.value)/1;
			aTag=ctl;
			do{
				aTag=aTag.offsetParent;
				leftpos+=aTag.offsetLeft;
				toppos+=aTag.offsetTop
			}
			while(aTag.tagName!="BODY");
			if(ie){
				crossobj.left=fixedX==-1?ctl.offsetLeft+leftpos:fixedX;
				crossobj.top=fixedY==-1?ctl.offsetTop+toppos+ctl.offsetHeight+2:fixedY
			}else{
				crossobj.left=(vhcID.x-150).toPX();
				crossobj.top=(vhcID.y+20).toPX()
			}
			constructCalendar(1,monthSelected,yearSelected);
			crossobj.visibility="visible";
			hideElement('SELECT',document.getElementById("calendar"));
			hideElement('APPLET',document.getElementById("calendar"));
			bShow=true
		}else{
			hideCalendar();
			if(ctlNow!=ctl){
				popUpCalendar(ctl,ctl2,"dd-mmm-yyyy")
			}
		}
		ctlNow=ctl
	}
};


function vhcUncompressionComplete(){
	return true
};