if(typeof(mobile)=="undefined"){var mobile={}
}var documentBody;
mobile._initialize=function(){document.fire("mobile:init");
documentBody=$(document.body);
mobile.BrowserCheck={IE6:Prototype.Browser.IE&&(typeof(document.body.style.maxHeight)=="undefined")};
document.fire("mobile:early");
if(mobile.BrowserCheck.IE6){setTimeout(function(){document.fire("mobile:ready")
},10)
}else{document.fire("mobile:ready")
}};
if(mobile._domLoaded){mobile._initialize()
}else{document.observe("dom:loaded",mobile._initialize)
}Event.observe(window,"load",function(){document.fire("mobile:loaded");
setTimeout(function(){document.fire("mobile:late")
},3000)
});
mobile.initializePage=function(b,c,a){a=a||"mobile:ready";
document.observe(a,function(){if(documentBody.hasClassName(b)){c()
}})
};
mobile.observe=function(a,b,d,c){c=Object.extend({parentElement:documentBody,allowNested:false,stopEvent:true},c);
$(c.parentElement).observe(b,(function(f){var e;
if(c.allowNested){e=f.findElement(a)
}else{if(f.element().match(a)){e=f.element()
}}if(e&&e!=document){if(c.stopEvent){f.stop()
}d(f,e)
}}).bindAsEventListener());
if(mobile.isDev){console.info("Registered handler for selector %o and event %o on %o",a,b,c.parentElement==documentBody?"document body":c.parentElement)
}};
Element.addMethods({__visible:function(a){return $(a).getStyle("display")!="none"
},mobile_toggle:function(a){a=$(a);
Element[Element.__visible(a)?"hide":"__show"](a);
return a
},__show:function(a){a=$(a);
a.style.display="block";
return a
}});
mobile.debug={logMethod:function(b,c){var d=this._getParentObject(b);
if(d){var e=d.object[d.key];
if(Object.isFunction(e)){c=Object.extend({consolePrefix:"-- ",logBefore:true,logAfter:true},c);
var a=e.wrap(function(){var f=$A(arguments);
var h=f.shift();
if(c.logBefore){console.debug(c.consolePrefix+"Executing %o with arguments %o",b,f)
}var g=h.apply(null,f);
if(c.logAfter){console.debug(c.consolePrefix+"Returning from %o with result %o",b,g)
}return g
});
d.object[d.key]=a;
return a
}}},_getParentObject:function(c){var d=c.split(".");
if(d[0]=="window"){d.shift()
}var a=d.pop();
try{var b=d.inject(window,function(g,e){return g[e]
})
}catch(f){return null
}return{object:b,key:a}
}};if(Object.isUndefined(mobile)){var mobile={}
}mobile.AmbitSearchController=Class.create({_zipField:null,_countryField:null,_radiusField:null,_options:null,_zipValid:false,_zip:null,_zipCache:null,initialize:function(a){this._options=Object.extend({zipField:"zipcode",countryField:"ambitCountry",radiusField:"zipcodeRadius",defaultCountry:"DE",setDefaultCountry:false,onChange:Prototype.emptyFunction,zipValidatorUrl:null,cache:$H(),matchers:this.constructor.ZIP_MATCHERS},a);
this._zipField=$(this._options.zipField);
this._countryField=$(this._options.countryField);
this._radiusField=$(this._options.radiusField);
if(!this._zipField||!this._countryField||!this._radiusField){throw new Exception("Could not find all required input fields!");
return false
}if(this._options.setDefaultCountry){this._countryField.setValue(this._options.defaultCountry)
}this._preboundZipFieldChangedHandler=this._zipFieldChangedHandler.bind(this);
this._zipField.observe("keyup",this._preboundZipFieldChangedHandler);
this._preboundCountryFieldChangedHandler=this._countryFieldChangedHandler.bind(this);
this._countryField.observe("change",this._preboundCountryFieldChangedHandler);
this._zipCache=this._options.cache;
this._initializing=true;
this._countryFieldChangedHandler();
requestHits()
},stop:function(){this._zipField.stopObserving("keyup",this._preboundZipFieldChangedHandler);
this._countryField.stopObserving("change",this._preboundCountryFieldChangedHandler)
},_zipFieldChangedHandler:function(c){var b=$F(this._zipField).strip();
var a=$F(this._countryField);
if(!c||(b!=this._zip)){if(b.length>0){if(!this._isGeoSearchSupported(a)){this._countryField.setValue(this._options.defaultCountry.toUpperCase());
this._countryFieldChangedHandler();
return
}}this._zip=b
}this._isValidZip(b,a,this._isValidZipCallback.bind(this,b,a,!c))
},_countryFieldChangedHandler:function(c){var a=$F(this._countryField);
var b=this._isGeoSearchSupported(a);
if(b){this._countryBecameSupporting()
}else{this._countryBecameUnsupporting()
}this._zipFieldChangedHandler()
},_zipBecameValid:function(){this._zipValid=true;
mobile.FormHelper.enableFieldAndLabel(this._radiusField);
if(!$F(this._radiusField)&&!this._initializing){this._radiusField.setValue(100)
}},_zipBecameInvalid:function(){this._zipValid=false;
mobile.FormHelper.disableFieldAndLabel(this._radiusField);
this._radiusField.setValue("")
},_countryBecameSupporting:function(){},_countryBecameUnsupporting:function(){this._zipField.setValue("")
},_isValidZip:function(c,d,e){d=(d||"").toUpperCase();
var b=this._options.matchers.get(d||this._options.defaultCountry)||this._options.matchers.get(this._options.defaultCountry);
if(b.validateOnServer){var a=b.regExp.test(c);
if(a){this._validateZipOnServer(c,d,e)
}else{e(a)
}}else{if(b instanceof RegExp){var a=b.test(c);
e(a)
}else{if(Object.isFunction(b)){b(c,d,e)
}else{if(Object.isString(b)){e(b==c)
}else{}}}}},_isValidZipCallback:function(a,d,b,c){if(b||(c!=this._zipValid)){if(c){this._zipBecameValid()
}else{this._zipBecameInvalid()
}if(!b){this._options.onChange(c)
}}this._initializing=false
},_hasCountrySelection:function(){return(this._countryField.type!="hidden")
},_isGeoSearchSupported:function(a){return this._options.matchers.keys().include(a)
},_validateZipOnServer:function(a,d,e){var c=this._cacheKey(d,a);
if(this._zipCache.keys().include(c)){e(this._zipCache.get(c));
return
}var b={ambitCountry:d,zipcode:a};
new Ajax.Request(this._options.zipValidatorUrl,{method:"get",parameters:b,onSuccess:(function(g){var f=false;
if(g){f=(g.responseText=="true")
}this._zipCache.set(c,f);
e(f)
}).bind(this)})
},_cacheKey:function(b,a){return b+"__"+a
}});
Object.extend(mobile.AmbitSearchController,{ZIP_MATCHERS:$H({DE:{validateOnServer:true,regExp:/^\d{5}$/},PL:{validateOnServer:true,regExp:/^\d{2}-\d{3}$/},RO:{validateOnServer:true,regExp:/^\d{6}$/},DEx:/^\d{5}$/})});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.Cookie=Class.create({_options:null,_name:null,initialize:function(b,a){this._options=Object.extend({path:false,duration:false},a);
this._name=b
},set:function(b){b=encodeURIComponent(b);
if(this._options.path){b+="; path="+this._options.path
}if(this._options.duration){var a=new Date();
a.setTime(a.getTime()+this._options.duration*24*60*60*1000);
b+="; expires="+a.toGMTString()
}document.cookie=this._name+"="+b
},get:function(){var a=document.cookie.match("(?:^|;)\\s*"+RegExp.escape(this._name)+"=([^;]*)");
return(a)?decodeURIComponent(a[1]):null
},unset:function(){this._options.duration=-1;
this.set("")
}});
mobile.Cookie.cookiesAllowed=function(){var a=new mobile.Cookie("testCookie");
a.set("null");
if(a.get()!==null){a.unset();
return true
}else{return false
}};if(typeof(mobile)=="undefined"){var mobile={}
}mobile.FormHelper=Object.extend({},{enableFieldAndLabel:function(c,b,d){c=$(c);
if(c){b=b||c.id;
d=d||"inactive";
c.enable();
var a=$$('label[for="'+b+'"]').first();
if(a){a.removeClassName(d)
}}},disableFieldAndLabel:function(c,b,d){c=$(c);
if(c){b=b||c.id;
d=d||"inactive";
c.disable();
var a=$$('label[for="'+b+'"]').first();
if(a){a.addClassName(d)
}}},checkBoxes:function(b,a){b=$(b);
b.select("input[type=checkbox]").each(function(c){c.checked=a
})
},connectSelects:function(a,b){a=$(a);
b=$(b);
if(a&&b){a.observe("change",function(c){b.setValue(this.value)
})
}},connectMultiSelects:function(a,b){b.each(function(c){this.connectSelects(a,c)
}.bind(this))
},connectTextInputs:function(b,a){b=$(b);
a=$(a);
if(b&&a){b.observe("change",function(){a.value=this.value
})
}},connectMultiTextInputs:function(b,a){a.each(function(c){this.connectTextInputs(b,c)
}.bind(this))
},submitOnce:function(a){a=$(a);
a.observe("submit",function(b){a.down("input[type=submit]").disable()
})
}});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.FormWatcher=Class.create({_form:null,_method:null,_options:null,initialize:function(b,c,a){this._form=$(b);
this._method=c;
this._options=Object.extend({registerKeyHandlers:true,registerChangeHandlers:true},a);
this._initHandlers()
},_initHandlers:function(){if(this._options.registerChangeHandlers){this._initChangeHandlers()
}if(this._options.registerKeyHandlers){this._initKeyUpHandlers()
}},_initChangeHandlers:function(){if(!Prototype.Browser.IE){this._form.observe("change",(function(b){var a=Event.element(b);
if(!(a.tagName.toLowerCase()=="input"&&(a.type||"").toLowerCase()=="text")){this._method()
}}).bindAsEventListener(this))
}else{this._form.getElements("select").invoke("observe","change",this._method);
this._form.select("input[type=checkbox]").invoke("observe","click",this._method);
this._form.observe("dom:update",(function(a){a.memo.select("select").invoke("observe","change",this._method)
}).bindAsEventListener(this))
}},_initKeyUpHandlers:function(){this._form.observe("keyup",(function(a){if((a.keyCode>20&&!this.constructor._SPECIAL_KEY_CODES.include(a.keyCode))||a.keyCode==Event.KEY_BACKSPACE){this._method()
}}).bindAsEventListener(this))
}});
Object.extend(mobile.FormWatcher,{_SPECIAL_KEY_CODES:$w("TAB RETURN ESC LEFT UP RIGHT DOWN HOME END PAGEUP PAGEDOWN INSERT").map(function(a){return Event["KEY_"+a]
})});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.ImageHelper={};
mobile.ImageHelper.preloadImages=function(){if(document.images){if(!document.preloads){document.preloads=new Array()
}var c;
var b=document.preloads.length;
var a=mobile.ImageHelper.preloadImages.arguments;
for(c=0;
c<a.length;
c++){if(a[c].indexOf("#")!=0){document.preloads[b]=new Image;
document.preloads[b++].src=a[c]
}}}};
mobile.ImageHelper.loadAllImages=function(b){document.stopObserving("mobile:late",mobile.ImageHelper.loadAllImagesCurry);
Event.stopObserving(window,"scroll",mobile.ImageHelper.loadAllImagesCurry);
var a=(Prototype.Browser.IE)?200:50;
b.each(function(c,d){var e=a*(d+1);
setTimeout((function(){var f=c.getAttribute("rel");
if(f!==""&&f!=c.src){c.observe("load",function(){var g=c.up("a");
g.removeClassName("loaded-later");
c.setStyle({visibility:"visible"})
});
c.src=f
}}).bind(c),e)
})
};
mobile.ImageHelper.imageLateLoader=function(a){if(document.viewport.getScrollOffsets().top>0){mobile.ImageHelper.loadAllImages(a)
}else{mobile.ImageHelper.loadAllImagesCurry=mobile.ImageHelper.loadAllImages.curry(a);
document.observe("mobile:late",mobile.ImageHelper.loadAllImagesCurry);
Event.observe(window,"scroll",mobile.ImageHelper.loadAllImagesCurry)
}};
mobile.ImageSwitcher=Class.create({_imageElement:null,_thumbnailListElement:null,_options:null,_currentThumbnail:null,_selectionTimeout:null,initialize:function(c,a,b){this._imageElement=$(c);
this._thumbnailListElement=$(a);
this._options=Object.extend({selectEvent:"mouseover",tagName:"a",timeout:100},b);
this._thumbnailListElement.observe(this._options.selectEvent,this._thumbnailSelectHandler.bindAsEventListener(this))
},_thumbnailSelectHandler:function(c){var b=Event.element(c);
var a=(b.tagName.toLowerCase()==this._options.tagName.toLowerCase())?b:b.up(this._options.tagName);
if(a&&a.descendantOf(this._thumbnailListElement)){if(this._currentThumbnail!=a&&a.rel){if(this._selectionTimeout){clearTimeout(this._selectionTimeout)
}this._selectionTimeout=setTimeout(this._switchImage.bind(this,a),this._options.timeout)
}}},_switchImage:function(a){this._currentThumbnail=a;
this._imageElement.src=this._currentThumbnail.rel
}});
mobile.ImageHelper.InventoryGallery=Class.create({_DISPLAY_DELAY:400,_mouseoverTimeout:null,_currentThumbnailElement:null,initialize:function(a){mobile.observe("."+a,"mouseover",function(b){this._startDisplayGalleryImg(b)
}.bind(this));
if(mobile.BrowserCheck.IE6){this.iframeShim=new IframeShim()
}},_startDisplayGalleryImg:function(a){this._stopDisplayGalleryImg(a);
var b=Prototype.Browser.IE?Object.clone(a):a;
this._mouseoverTimeout=setTimeout(this._displayGalleryImg.bind(this,b),this._DISPLAY_DELAY)
},_stopDisplayGalleryImg:function(a){if(this._mouseoverTimeout){clearTimeout(this._mouseoverTimeout);
this._mouseoverTimeout=null
}},_displayGalleryImg:function(b){var a=Event.findElement(b,"a");
var c=this._getImageWrapper();
if(!c.down(".gallery-img")||(c.down(".gallery-img")&&c.down(".gallery-img").src!=a.rel)){this.setImageWrapperAlignment(a);
c.show();
this._loadGalleryImage(a);
a.up(".thumb-wrap").observe(Prototype.Browser.IE?"mouseleave":"mouseout",this._closeImageWrapper.bindAsEventListener(this,c))
}else{this.setImageWrapperAlignment(a);
c.show()
}this._currentThumbnailElement=a
},_getImageWrapper:function(){if(!this._imageWrapperElement){this._imageWrapperElement=this._createImageWrapper()
}return this._imageWrapperElement
},_createImageWrapper:function(){var a=documentBody.down(".imageWrapper");
if(a){return a
}else{var b=new Element("div",{className:"imageWrapper"});
b.setStyle({position:"absolute",zIndex:"10",border:"2px solid #ccc",backgroundColor:"#fff"});
b.innerHTML='<img style="margin: 85px 129px" class="loading-gif" alt="" src="'+mobile.PageParams.imagePath+'loading_big.gif"/>';
if(!(mobile.BrowserCheck.IE6&&documentBody.down(".ie6-position-fixed"))){documentBody.insert({bottom:b})
}else{documentBody.down(".page").insert({bottom:b})
}b.observe(Prototype.Browser.IE?"mouseleave":"mouseout",this._closeImageWrapper.bindAsEventListener(this,b));
return b
}},_closeImageWrapper:function(b,a){if(Prototype.Browser.IE||(b.relatedTarget&&b.relatedTarget!=b.currentTarget&&!b.relatedTarget.childOf(b.currentTarget))){a.hide();
if(this.iframeShim){this.iframeShim.hide()
}b.stop()
}this._stopDisplayGalleryImg()
},_loadGalleryImage:function(a){this._imageWrapperElement.down("img.loading-gif").show();
var b=new Element("img",{className:"gallery-img"});
if(this._imageWrapperElement.down(".gallery-img")){this._imageWrapperElement.select(".gallery-img").invoke("remove")
}b.onload=function(){this._imageWrapperElement.down("img.loading-gif").hide();
this._imageWrapperElement.insert(b,{bottom:b})
}.bind(this);
b.src=a.rel
},setImageWrapperAlignment:function(c){var d=this._getImageWrapper();
var e=c.up(".thumb-wrap");
var b=e.cumulativeOffset();
var a=e.getDimensions();
d.setStyle({top:b.top+"px"});
d.setStyle({left:(b.left+a.width+10)+"px"});
if(this.iframeShim){this.iframeShim.positionUnder(d);
this.iframeShim.show()
}}});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.InfoIconsManager=Class.create({_DISPLAY_INFO_BOX_DELAY:200,_currentInfoIconElement:null,_infoBoxElement:null,_closeInfoBoxHandlerPrebound:null,_mouseoverTimeout:null,initialize:function(a){mobile.observe("."+a,"mouseover",function(b){this._startDisplayInfoBox(b)
}.bindAsEventListener(this));
mobile.observe("."+a,"mouseout",function(b){this._stopDisplayInfoBox(b)
}.bindAsEventListener(this));
mobile.observe("."+a,"click",function(c,b){b.up("a").blur()
});
if(mobile.BrowserCheck.IE6){this._helper=new mobile.IE6Hover()
}},_startDisplayInfoBox:function(a){this._stopDisplayInfoBox();
var b=Prototype.Browser.IE?Object.clone(a):a;
this._mouseoverTimeout=setTimeout(this._displayInfoBox.bind(this,b),this._DISPLAY_INFO_BOX_DELAY)
},_stopDisplayInfoBox:function(){if(this._mouseoverTimeout){clearTimeout(this._mouseoverTimeout);
this._mouseoverTimeout=null
}},_displayInfoBox:function(d){var a=Event.findElement(d,"a");
var c=this._getInfoBox();
if(this._currentInfoIconElement!=a){var b=this._getInfoBoxContent(a);
this._updateInfoBoxContent(b);
this._updateInfoBoxTitle(a.getAttribute("title"));
this._currentInfoIconElement=a
}this._setInfoBoxAlignment(a);
c.show();
if(mobile.BrowserCheck.IE6){this._helper.showBackgroundFrame(this._getInfoBox())
}},_closeInfoBoxHandler:function(b,a){if(Prototype.Browser.IE||(b.relatedTarget!=b.currentTarget&&!b.relatedTarget.childOf(b.currentTarget))){a.hide();
if(mobile.BrowserCheck.IE6){this._helper.hideBackgroundFrame(this._getInfoBox())
}b.stop()
}},_getInfoBox:function(){if(!this._infoBoxElement){this._infoBoxElement=this._createInfoBoxElement()
}return this._infoBoxElement
},_createInfoBoxElement:function(){var a=new Element("div",{className:"infoBoxWrapper"});
a.innerHTML="<div class='shadow'></div><div class='infoBox'><div class='infoIconOrange'></div><h4>Info</h4><a href='#' class='close'></a><div class='content'></div></div>";
if(!(mobile.BrowserCheck.IE6&&documentBody.down(".ie6-position-fixed"))){documentBody.insert({bottom:a})
}else{documentBody.down(".page").insert({bottom:a})
}a.observe(Prototype.Browser.IE?"mouseleave":"mouseout",this._closeInfoBoxHandler.bindAsEventListener(this,a));
a.down(".close").observe("click",(function(b){a.hide();
b.findElement("a").blur();
b.stop()
}).bindAsEventListener());
return a
},_updateInfoBoxContent:function(a){this._getInfoBox().down(".content").update(a)
},_updateInfoBoxTitle:function(a){this._getInfoBox().down("h4").update(a)
},_getInfoBoxContent:function(b){var a=b;
var c=a.next(".infoBoxContent");
while(!c&&a!=documentBody){a=a.up();
c=a.next(".infoBoxContent")
}if(c){return c.innerHTML
}},_setInfoBoxPosition:function(a){this._getInfoBox().clonePosition(a.down("img"),{setWidth:false,setHeight:false,offsetLeft:-11,offsetTop:-11})
},_setInfoBoxAlignment:function(e){var g=this._getInfoBox();
var f=e.down("img");
var k=document.viewport.getDimensions();
var m=f.viewportOffset();
var b=f.cumulativeOffset();
var l=g.getDimensions();
var j=10;
var c=(k.height-m.top-l.height>j);
var a=(m.top-l.height>j);
var d=(k.width-m.left-l.width>j);
var i=(m.left-l.width>j);
var h=g.down(".infoBox");
if(!c&&a){g.setStyle({top:(b.top-l.height+2*j+1)+"px"});
h.addClassName("bottom")
}else{g.setStyle({top:(b.top-j-1)+"px"});
h.removeClassName("bottom")
}if(!d&&i){g.setStyle({left:(b.left-l.width+2*j+1)+"px"});
h.addClassName("right")
}else{g.setStyle({left:(b.left-j-1)+"px"});
h.removeClassName("right")
}}});
document.observe("mobile:ready",function(){new mobile.InfoIconsManager("infoIcon")
});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.ModelHelper=Class.create({_categoryElement:null,_makeElement:null,_modelElement:null,_previousCategoryValue:null,_previousMakeValue:null,_previousModelValue:null,_uriPrefix:null,_options:null,initialize:function(c){this._options=Object.extend({modelsPath:"models.html",makesPath:"makes.html",firstOptionMake:false,firstOptionModel:false,withCategory:false,isFirstUseModelIndexModelId:false},c);
this._categoryElement=$(c.categoryElement||"selectCategory");
this._makeElement=$(c.makeElement||"selectMake");
this._modelElement=$(c.modelElement||"selectModel");
this._descriptionElement=$(c.descriptionElement||"specifics.modelDescription");
if(!this._makeElement||!this._modelElement){return
}if(this._options.withCategory){this._categoryElement.observe("change",this.updateMakeList.bind(this,null))
}this._makeElement.observe("change",this.updateModelList.bind(this,null));
if(this._descriptionElement){this._modelElement.observe("change",this._updateDescription.bind(this))
}if(c.saveState&&mobile.stateHelper){Element.observe(window,"unload",this._saveStateHandler.bind(this))
}if(c.useFormAction){var e=this._makeElement.up("form");
if(e){this._uriPrefix=e.action.replace(/[^\/]*$/,"")
}}else{if(c.urlPrefix){this._uriPrefix=c.urlPrefix
}}if(this._options.withCategory&&$F(this._categoryElement)){var f=c.initialMakeId;
if(c.loadState&&mobile.stateHelper){var b=mobile.stateHelper.readProperty(this._categoryElement.id);
if(b){this._categoryElement.setValue(b)
}f=f||mobile.stateHelper.readProperty(this._makeElement.id)
}}var a=c.initialModelId;
if(c.loadState&&mobile.stateHelper){var d=mobile.stateHelper.readProperty(this._makeElement.id);
if(d){this._makeElement.setValue(d)
}a=a||mobile.stateHelper.readProperty(this._modelElement.id)
}if(this._options.withCategory&&$F(this._categoryElement)){this.updateMakeList(f,a);
if(Prototype.Browser.IE){if(this._modelElement.getDimensions()["width"]!="0"){this._modelElement.setStyle({width:this._modelElement.getDimensions()["width"]+"px"})
}}}else{if($F(this._makeElement)&&this._modelElement.options.length<=1){this.updateModelList(a)
}if(Prototype.Browser.IE){if(this._modelElement.getDimensions()["width"]!="0"){this._modelElement.setStyle({width:this._modelElement.getDimensions()["width"]+"px"})
}}}},updateMakeList:function(c,a){var b=$F(this._categoryElement);
if(b){this._retrieveMakes(b,c,a)
}else{this._deactivateMakeList()
}},updateModelList:function(a){var b=this._makeElement.value;
if(b){if(this._options.withCategory&&$F(this._categoryElement)){if($F(this._categoryElement)==="Car"){this._retrieveModels(b,a)
}else{this._deactivateModelList()
}}else{this._retrieveModels(b,a)
}}else{this._deactivateModelList()
}},_retrieveMakes:function(g,f,a){this._previousMakeValue=$F(this._makeElement);
if(this._previousCategoryValue&&(g!=this._previousMakeValue||this._previousMakeValue==1)){this._previousMakeValue=null
}this._previousCategoryValue=g;
var b=this.constructor._modelCache.get(g);
if(b){this._makeElement.update(b);
this._makeListUpdated(f)
}else{var d=(this._uriPrefix||"")+this._options.makesPath;
var e=Object.extend({category:g,lang:mobile.language||"de"},this.constructor._additionalParams);
var c=new Ajax.Updater({success:this._makeElement},d,{parameters:e,method:"get",onSuccess:function(h){if(typeof(this._options.firstOptionMake)=="string"){h.responseText=this._addFirstOption(this._options.firstOptionMake,h.responseText)
}}.bind(this),onComplete:this._makeListUpdated.bind(this,g,f,a)})
}},_retrieveModels:function(c,a){this._previousModelValue=$F(this._modelElement);
if(this._previousMakeValue&&(c!=this._previousMakeValue||this._previousModelValue==1)){this._previousModelValue=null
}this._previousMakeValue=c;
var b=this.constructor._modelCache.get(c);
if(b){this._modelElement.update(b);
this._modelListUpdated(a)
}else{var e=(this._uriPrefix||"")+this._options.modelsPath;
var f=Object.extend({makeId:c,lang:mobile.language||"de"},this.constructor._additionalParams);
if(this._options.withCategory){f=Object.extend({category:$F(this._categoryElement)},f)
}var d=new Ajax.Updater({success:this._modelElement},e,{parameters:f,method:"get",onSuccess:function(g){if(typeof(this._options.firstOptionModel)=="string"){g.responseText=this._addFirstOption(this._options.firstOptionModel,g.responseText)
}}.bind(this),onComplete:this._modelListUpdated.bind(this,c,a)})
}},_makeListUpdated:function(d,c,b){if(!this.constructor._modelCache.get(d)){this.constructor._modelCache.set(d,this._makeElement.innerHTML)
}var a=c||this._previousMakeValue;
if(a){this._makeElement.setValue(a)
}else{if(this._makeElement.options.length==2){this._makeElement.selectedIndex=1
}}mobile.FormHelper.enableFieldAndLabel(this._makeElement);
if(mobile.BrowserCheck.IE6){setTimeout(this.updateModelList.bind(this,b),100)
}else{this.updateModelList(b)
}},_modelListUpdated:function(c,b){if(!this.constructor._modelCache.get(c)){this.constructor._modelCache.set(c,this._modelElement.innerHTML)
}var a=b||this._previousModelValue;
if(a){this._modelElement.setValue(a)
}else{if(this._modelElement.options.length==2){this._modelElement.selectedIndex=1
}else{if(typeof(modelIndexModelId)!="undefined"){if(modelIndexModelId!=null&&modelIndexModelId.length>0&&!this._options.isFirstUseModelIndexModelId){this._modelElement.setValue(modelIndexModelId);
this._options.isFirstUseModelIndexModelId=true
}}}}if(typeof(maMoDefaultModel)!="undefined"){this._modelElement.value=$F(this._makeElement)+"-"+maMoDefaultModel;
maMoDefaultModel=""
}mobile.FormHelper.enableFieldAndLabel(this._modelElement)
},_deactivateModelList:function(){this._modelElement.selectedIndex=0;
if(this._modelElement.options[0]&&this._modelElement.options[0].text!==""){this._modelElement.options[0].text=""
}mobile.FormHelper.disableFieldAndLabel(this._modelElement)
},_deactivateMakeList:function(){this._makeElement.selectedIndex=0;
if(this._makeElement.options[0]&&this._makeElement.options[0].text!==""){this._makeElement.options[0].text=""
}mobile.FormHelper.disableFieldAndLabel(this._makeElement);
if(this._modelElement.options.length>1){this._deactivateModelList()
}},_updateDescription:function(){if(this._descriptionElement){var a=this._modelElement.options[this._modelElement.selectedIndex];
this._descriptionElement.value=a.value?a.text:"";
this._descriptionElement.focus()
}},_saveStateHandler:function(){if(this._options.withCategory){var a=$F(this._categoryElement)
}var b=$F(this._makeElement);
var c=$F(this._modelElement);
if(this._options.withCategory){mobile.stateHelper.writeProperty(this._categoryElement.id,a)
}mobile.stateHelper.writeProperty(this._makeElement.id,b);
mobile.stateHelper.writeProperty(this._modelElement.id,c)
},_addFirstOption:function(c,a){var b='<option value="">'+c+"</option>";
return(b+a)
}});
Object.extend(mobile.ModelHelper,{_instances:[],_additionalParams:{},_modelCache:$H(),getHelper:function(a){var b=new this(a);
this._instances.push(b);
return b
},updateAllModelLists:function(){this._instances.invoke("updateModelList")
},setAdditionalParams:function(a){this._additionalParams=a;
this._modelCache=$H()
}});(function(){function c(){if(typeof document.location.href!="undefined"&&document.location.href.length>0){return document.location.href
}else{if(typeof window.location.href!="undefined"&&window.location.href.length>0){return window.location.href
}else{if(typeof document.URL!="undefined"&&document.URL.length>0){return document.URL
}}}return""
}function b(){if(typeof document.location.hash!="undefined"){return document.location.hash
}else{if(typeof window.location.hash!="undefined"){return window.location.hash
}}return""
}function d(){if(typeof top.document.referrer!="undefined"){return top.document.referrer
}else{if(typeof document.referrer!="undefined"){return document.referrer
}}return""
}function a(e){var j={GERMANY:"4284-30318-12262-0",ROMANIA:"11425-67711-25143-0",POLAND:"12983-80845-27852-0",FRANCE:"13061-91731-30282-0",ITALY:"13060-91790-30283-0"};
var f=j[e]||j.GERMANY;
var g=d();
if(!g&&(location.search.indexOf("_refQA")>-1)){var k=location.search.toQueryParams();
g=k._refQA
}if(!g){return false
}var n=c();
var h=b();
if(h.length>0&&h.indexOf("#skip_ns")>-1){return false
}var m=["metager.de","suche.infospace.de","metacrawler.com",".excite.com","suche.fireball.","search.yahoo.com","search.msn.",".altavista.com","www.alltheweb.com","search.lycos.com/default.asp",".ask.com/web","www.google.com.au","images.google.com.au","ninemsn.com.au","search.aol.com.au","www.goeureka.com.au","au.anzwers.yahoo.com","www.yellowpages.com.au/search/searchEntry.do","search.bigpond.com","www.google.be/search","images.google.be/images","maps.google.be/maps","www.google.ba/search","images.google.ba/images","www.google.bg/search","images.google.bg/images","diri.bg/search.php","web.search.bg/search.php","www.all.bg","www.baidu.com/","image.baidu.com/","site.baidu.com/","seek.3721.com/","page.zhongsou.com/","hc360.zhongsou.com/","site.zhongsou.com/","search.sina.com.cn/","pic.sina.com.cn/","dir.sina.com.cn/","search.sohu.com/","image.search.sohu.com/","www.sogou.com/","nisearch.163.com/","psearch.163.com/","picsearch.163.com/","search.tom.com/","sitesearch.tom.com/","cn.websearch.yahoo.com/","cn.imagesearch.yahoo.com/","www.yisou.com/search","image.yisou.com/","www.google.dk/search","images.google.dk/images","www.google.de/search","images.google.de/images","maps.google.de/maps","suche.aol.de/aol/search","suche.aol.de/aol/image","suche.freenet.de/suche","shopping.freenet.de/suchergebnis/index.html","suche.t-online.de/fast-cgi/tsc","suche.web.de/search/","dir.web.de","suche.lycos.de","webkatalog.lycos.de","search.live.com/results.aspx","www.google.ee/search","images.google.ee/images","www.google.fi/search","images.google.fi/images","www.google.fr/search","images.google.fr/images","maps.google.fr/maps","www.recherche.aol.fr","www.images.aol.fr","vachercher.lycos.fr/cgi-bin/pursuit","search.ke.voila.fr","recherche.wanadoo.fr","search1-2.free.fr","www.google.ge/search","images.google.ge/images","www.google.gr/search","images.google.gr/images","www.google.co.uk/search","images.google.co.uk/images","maps.google.co.uk/maps","search.aol.co.uk/web_uk.adp","www.ask.co.uk/res.asp","search.lycos.co.uk/cgi-bin/pursuit","search.orange.co.uk/all","www.google.it/search","images.google.it/images","maps.google.it/maps","search.virgilio.it","arianna.libero.it","business.libero.it/arianna/","search.tiscali.it","www.google.ca","ca.yahoo.com","www.toile.qc.ca","www.lycos.ca","www.google.hr/search","images.google.hr/images","www.google.lt/search","images.google.lt/images","search.delfi.lt/search.php","www.google.md/search","images.google.md/images","www.google.nl/search","images.google.nl/images","maps.google.nl/maps","www.ilse.nl/searchresults.dbl","pagina.nl","www.google.no/search","images.google.no/images","suche.lycos.at","www.google.at/search","images.google.at/images","maps.google.at/maps","austronaut.at/page.php","www.google.pl/search","images.google.pl/images","szukaj.onet.pl/query.html","szukaj.wp.pl/szukaj.html","www.google.pt/search","images.google.pt/images","www.google.ro/search","images.google.ro/images","www.google.ru/search","images.google.ru/images","yandex.ru/yandsearch","www.rambler.ru/srch","www.google.se/search","images.google.se/images","www.search.ch","www.google.ch/search","images.google.ch/images","maps.google.ch/maps","www.google.es/search","images.google.es/images","maps.google.es/maps","buscador.terra.es","buscar.ya.com","www2.yatv.com","busca.wanadoo.es/search","www.google.sk/search","images.google.sk/images","best.sk/search.aspx","search.centrum.sk","www.zoznam.sk/hladaj.fcgi","www.azet.sk/katalog/vyhladavanie/internet/","www.pozri.sk/hladaj.php","www.google.si/search","images.google.si/images","tw.yahoo.com","www.google.com.tw","images.google.com.tw","www.pchome.com.tw","image.pchome.com.tw","dir.pchome.com.tw","www.yam.com","wps.yam.com","dir.yam.com","www.msn.com.tw","www.google.cz/search","images.google.cz/images","search.seznam.cz","search.centrum.cz","www.google.ua/search","images.google.ua/images","www.google.hu/search","images.google.hu/images","ok.hu/katalogus","www.looksmart.com","www.google.com/search","images.google.com/images","maps.google.com/maps","directory.google.com","groups.google.com","aolsearch.aol.com","search.aol.com","s.teoma.com/","www.hotbot.com","search.hotbot.de","www.wisenut.com","search.netscape.com","www.bing.com/search","www.bing.com/images/search","www.bing.com/videos/search"];
for(var l=0;
l<m.length;
++l){if(g.indexOf(m[l])>-1){var o=["http://a","dfarm.medi","aplex.com/a","d/lt/",f].join("");
o+="?mpt="+(new Date().getTime());
if(typeof encodeURIComponent=="function"){o+="&mpcl="+encodeURIComponent(n);
o+="&mpvl="+encodeURIComponent(g)
}else{o+="&mpcl="+escape(n);
o+="&mpvl="+escape(g)
}document.write('<img src="'+o+'" alt="" border="0" width="1" height="1" />');
return
}}}if(typeof(mobile)!="undefined"){if(!mobile.dontUseNaturalSearch){a(mobile.siteId)
}}else{a()
}})();if(typeof(mobile)=="undefined"){var mobile={}
}mobile.PopupHelper={initPopupMenus:function(){mobile.observe("a.popup","click",(function(f,e){var b=1024;
var a=768;
var d=new RegExp(/^.*\s(\d{2,4}x\d{2,4}){1}.*$/).exec(e.getAttribute("class"));
if(d){var c=d[d.length-1].split("x");
if(d.length==2){b=c[0];
a=c[1]
}}this.openPopUp(e.getAttribute("href").strip(),b,a,50,50,"no","no","no","no","yes","yes");
return false
}).bind(this),{allowNested:true});
mobile.observe("a.close-popup","click",function(){window.close();
return false
})
},openPopUp:function(b,c,l,d,i,j,k,e,h,g,a){var f=window.open(b,"popup","width="+c+",height="+l+",left="+d+",top="+i+",toolbar="+j+",location="+location+",directories="+k+",status="+e+",menubar="+h+",scrollbars="+g+",resizable="+a+"");
if(f){f.focus()
}},leavePopUpFocusOpener:function(a){window.opener.location.href=a;
window.opener.focus()
}};
document.observe("mobile:ready",function(){mobile.PopupHelper.initPopupMenus()
});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.SearchViewData={};
Object.extend(mobile.SearchViewData,{_relevantSearchParams:null,getRelevantRequestParams:function(){if(!this._relevantSearchParams){var a=$H(location.search.toQueryParams());
this._relevantSearchParams=this.normalizeSearchParams(a)
}return this._relevantSearchParams
},normalizeSearchParams:function(c){var d=$w("isSearchRequest lang _features bodyStyleRadio sortOption.sortBy sortOption.sortOrder pageNumber __lp siteId");
var b=$H({scopeId:"C","export":"NO_EXPORT",damageUnrepaired:"NO_DAMAGE_UNREPAIRED","makeModelVariant1.searchInFreetext":"false","makeModelVariant2.searchInFreetext":"false","makeModelVariant3.searchInFreetext":"false",negativeFeatures:"EXPORT",vehicleCategory:"Car",segment:"Car"});
var a=$H();
c.each(function(e){if(!e.value){return
}if(d.include(e.key)){return
}if(b.get(e.key)==e.value){return
}if(e.key=="minPowerAsArray"||e.key=="maxPowerAsArray"){if(e.value[0]==""){return
}}a.set(e.key,e.value)
},this);
return a
},addRequiredParams:function(a){var b=$H({scopeId:"C",isSearchRequest:true});
return b.merge(a)
},getMinimalValidSearchParams:function(a){var b=this.normalizeSearchParams(a);
return this.addRequiredParams(b)
}});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.stateHelper={_currentHash:null,hasProperty:function(a){return(this.readProperty(a)!==undefined)
},readProperty:function(a){this._readHash();
var b=this._currentHash.get(a);
return b
},writeProperty:function(a,b){this._readHash();
if(this._currentHash.get(a)==b){return
}else{this._currentHash.set(a,b);
this._writeHash()
}},_readHash:function(){if(!this._currentHash){var b;
try{b=window.name.evalJSON(true)
}catch(a){b={}
}this._currentHash=$H(b)
}},_writeHash:function(){if(this._currentHash&&this._currentHash.size()>0){window.name=this._currentHash.toJSON()
}}};