if(typeof(mobile)=="undefined"){var mobile={}
}var documentBody;
mobile._initialize=function(){document.fire("mobile:init");
documentBody=$(document.body);
mobile.seleniumTimer=(new Date()).getTime();
mobile.BrowserCheck={IE:Prototype.Browser.IE,IE6:Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6,IE7:Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7,IE8:Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==8,IE9:Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==9,IEDinosaur:Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<9,ieVersion:function(){var c=-1;
if(navigator.appName=="Microsoft Internet Explorer"){var a=navigator.userAgent;
var b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
if(b.exec(a)!=null){c=parseFloat(RegExp.$1)
}}return c
}};
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(){if(mobile.BrowserCheck.IE6){setTimeout(function(){document.fire("mobile:loaded")
},10)
}else{document.fire("mobile:loaded")
}setTimeout(function(){document.fire("mobile:late")
},200);
setTimeout(function(){document.fire("mobile:later")
},2000);
setTimeout(function(){document.fire("mobile:preload")
},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);
var e=(function(g){var f;
if(c.allowNested){f=g.findElement(a)
}else{if(g.element().match(a)){f=g.element()
}}if(f&&f!=document){if(c.stopEvent){g.stop()
}d(g,f)
}}).bindAsEventListener();
if($(c.parentElement)){$(c.parentElement).observe(b,e)
}if(mobile.isDev){console.info("Registered handler for selector %o and event %o on %o",a,b,c.parentElement==documentBody?"document body":c.parentElement)
}return e
};
mobile.require=(function(){var b=function(c){var d=$$("head, body").first();
[c].flatten().each(function(e){var f=new Element("script",{type:"text/javascript",async:true,src:e});
d.insert(f)
})
};
var a=function(c,f){c=$H(c);
var e=c.keys();
mobile.utils.waitFor(e,f);
var d=c.findAll(function(g){return mobile.utils.getObject(g.key)===undefined
}).pluck("value");
b(d)
};
return a
})();
mobile.loadScript=function(b,a){var c=a||Prototype.emptyFunction;
var d=new Element("script",{type:"text/javascript",async:true,src:b});
if(Prototype.Browser.IE){d.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete"){c()
}}
}else{d.observe("load",c)
}$$("head, body").first().insert(d)
};
mobile.preload=function(a){document.observe("mobile:preload",function(){var b=function(c){if(Prototype.Browser.IE){new Image().src=c
}else{var d=new Element("object");
d.data=c;
d.width=0;
d.height=0;
document.body.insert(d)
}};
a.each(b)
})
};
mobile.utils=(function(){function a(f){var g=Object.isArray(f)?f:f.split(".");
if(g[0]=="window"){g.shift()
}try{return g.inject(window,function(i,e){return i[e]
})
}catch(h){return undefined
}}function c(g){var h=g.split(".");
var e=h.pop();
var f=this.getObject(h);
return{object:f,key:e}
}function b(f,g){var h=this._getParentObject(f);
if(h){var i=h.object[h.key];
if(Object.isFunction(i)){g=Object.extend({consolePrefix:"-- ",logBefore:true,logAfter:true},g);
var e=i.wrap(function(){var j=$A(arguments);
var l=j.shift();
if(g.logBefore){console.debug(g.consolePrefix+"Executing %o with arguments %o",f,j)
}var k=l.apply(null,j);
if(g.logAfter){console.debug(g.consolePrefix+"Returning from %o with result %o",f,k)
}return k
});
h.object[h.key]=e;
return e
}}}function d(h,g,f){f=Object.extend({interval:100},f);
var h=[h].flatten();
var e;
var i=function(){var j=h.map(mobile.utils.getObject);
if(j.compact().size()==j.size()){clearInterval(e);
g(j.size()==1?j.first():j)
}};
e=setInterval(i,f.interval);
i()
}return{getObject:a,logMethod:b,waitFor:d}
})();
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
}});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.AdLoader=Class.create({_targets:null,_options:null,initialize:function(a,b){this._targets=Object.isString(a)?[{element:a}]:[a].flatten();
this._options=Object.extend({titleSingle:b.title||"Anzeige",titleMultiple:b.title||"Anzeigen",callbackName:"callback"+Math.floor(new Date().getTime()*Math.random()),onComplete:Prototype.emptyFunction},b);
window[this._options.callbackName]=this._callback.bind(this)
},load:function(){},_createAdHTML:function(a){return mobile.AdLoader.AD_TEMPLATE.evaluate({ad:a,visible_url_escaped:a.visible_url.replace(/'/,"\\'").replace(/"/,"&quot;")})
},_createHeaderHTML:function(a){return mobile.AdLoader.AD_TITLE_TEMPLATE.evaluate({title:a.size()>1?this._options.titleMultiple:this._options.titleSingle})
},_update:function(a){this._targets.each(function(e){var c=$(e.element);
var b=e.numberOfAds?a.splice(0,e.numberOfAds):a;
if(b.size()>0){var d=this._createHeaderHTML(b);
var f=b.map(this._createAdHTML).join("\n");
if(e.wrapper){f=e.wrapper.evaluate({content:f})
}c.update(d+f);
c.show()
}else{c.hide()
}},this)
},_callback:function(a){}});
Object.extend(mobile.AdLoader,{AD_TEMPLATE:new Template('<div class="ad_container"><a href="#" onclick="window.open(\'#{ad.url}\',\'AdWindow\');return false"onmouseout="window.status=\'\';return true" onmouseover="window.status=\'go to #{visible_url_escaped}\';return true" style="text-decoration:none"><span class="ad_line_1">#{ad.line1}</span><span class="ad_line_2">#{ad.line2}</span><span class="ad_line_3">#{ad.visible_url}</span></a></div>'),AD_TITLE_TEMPLATE:new Template('<div class="ad_header">#{title}</div>\n'),AD_SES_TOP_WRAPPER:new Template('#{content}<div class="iconSprite onsiteline"></div>')});
mobile.IframeAdLoader=Class.create(mobile.AdLoader,{_iframe:null,initialize:function($super,a,b){b=b||{};
$super(a,b);
this._options.iframeId=b.iframeId||"adLoaderIframe"+Math.floor(new Date().getTime()*Math.random())
},_loadInIframe:function(d,b,e){var f=this._options.iframeId;
if($(f)){$(f).remove()
}this._iframe=new Element("iframe",{id:f,style:"display: none;"});
if(Prototype.Browser.IE){document.domain=location.hostname.replace(/.*\.([^\.]*\.[^\.\d]*)$/,"$1");
this._iframe.src="javascript:document.write('<script>document.domain=\""+document.domain+"\";<\/script>');document.close();"
}documentBody.insert(this._iframe);
var a="<script type='text/javascript'>\n";
if(Prototype.Browser.IE){a+="document.domain = '"+document.domain+"';\n"
}a+=b;
a+="<\/script>\n";
if(d){a+="<script type='text/javascript' src='"+d+"'><\/script>\n"
}if(e){a+="<script type='text/javascript'>\n"+e+"\n<\/script>\n"
}var c=function(){var g=$(f);
var h=g.contentDocument||g.contentWindow.document;
h.write(a);
if(!Prototype.Browser.IE){h.close()
}};
if(!Prototype.Browser.IE){c()
}else{setTimeout(c,10)
}}});
mobile.AdSenseLoader=Class.create(mobile.IframeAdLoader,{initialize:function($super,a,b){b=b||{};
$super(a,b);
this._options.adType=b.adType||"text"
},load:function(b,c){var a=c?$H(c).map(function(d){return"var "+d.key+" = '"+d.value+"';"
}).join("\n")+"\n":"";
a+="var "+this._options.callbackName+" = parent."+this._options.callbackName+";\n";
this._loadInIframe(b,a)
},_callback:function(a){if(Prototype.Browser.IE){this._iframe.contentWindow.document.close()
}var c=$A(a).findAll(function(d){return d.type==this._options.adType
},this);
var b=c.size();
this._update(c);
this._options.onComplete(b)
}});
mobile.DartLoader=Class.create(mobile.IframeAdLoader,{load:function(b){var a="var __content = '';\n document.write = function(c){__content += c;};\n";
var d="parent."+this._options.callbackName+"(__content);";
var c=Prototype.Browser.IE?"window.onload=function() {"+d+"}":d;
this._loadInIframe(b,a,c)
},_callback:function(a){if(Prototype.Browser.IE){this._iframe.contentWindow.document.close()
}if(a.indexOf("<!DOCTYPE")==0){a=""
}this._targets.each(function(c){var b=$(c.element);
b.removeClassName("loading");
b.update(a)
},this);
this._options.onComplete(a?1:0)
}});
mobile.DomWriteLoader=(function(){var adUrls=[];
var domWriteScripts=[];
document.observe("mobile:domwritescripts",function(){var pointer=domWriteScripts.size();
if(pointer>0){var content=domWriteScripts[pointer-1];
if(content.indexOf("src=")>-1){var scriptSrc=content.match(/src[^=]*=[^'"]*['"]([^'"]*?)['"]/i);
mobile.loadScript(scriptSrc[1])
}else{var inlineScript=" "+content.match(/[^'"]*<script[^>]*>([\s\S]*?)<\/script[^>]*>[^'"]*/gi)+" ";
inlineScript=inlineScript.replace(/[^'"]*<script[^>]*>/gi,"");
inlineScript=inlineScript.replace(/<\/script[^>]*>[^'"]*/gi,"");
eval(inlineScript)
}}});
document.observe("mobile:late",function(){if(adUrls.size()>0){document.write=document.writeln=function(content,placement){if(content!=""){if(content.indexOf("<script")>-1){domWriteScripts.push(content);
document.fire("mobile:domwritescripts")
}else{if(placement){var placementId=placement.match(/<\!--([\s\S]*?)-->/i)[1].trim();
if($(placementId)){if(content.indexOf("<!DOCTYPE")>-1){$(placementId).hide()
}else{$(placementId).insert(content)
}}}}}};
adUrls.each(function(adUrl){mobile.loadScript(adUrl)
})
}});
return function(adUrl){adUrls.push(adUrl)
}
})();
mobile.DartQueue=Object.extend({queues:[[],[],[]],afterShowHandler:[[],[],[]],actualQueue:0,emptyElementSelector:"span img[src*='http://pics.ebaystatic.com/aw/pics/de/mobile_de/1x1.gif'] ,a img[src*='http://static.2mdn.net/viewad/817-grey.gif'] ,a img[src*='http://m1.2mdn.net/viewad/817-grey.gif'] ,a img[src*='http://s0.2mdn.net/viewad/817-grey.gif'] ,table img[src*='http://pics.ebaystatic.com/aw/pics/de/mobile_de/1x1.gif'], table img[src*='http://pics.ebaystatic.com/aw/pics/de/mobile_de/default_2x2.GIF'], table img[src*='http://pics.ebaystatic.com/aw/pics/de/mobile_de/deafult_180x60.GIF']",showAds:function(a){this.actualQueue=a;
this.processQueue(this.queues[this.actualQueue])
},processQueue:function(a){a.each(function(b){var c=$(b[0]);
var d=$(b[1]);
c.childElements().each(function(e){if(e.tagName=="SCRIPT"){e.remove()
}});
d.appendChild(c.show());
d.show()
}.bind(this));
this.afterShowHandler[this.actualQueue].each(function(b){b()
})
}},mobile.DartQueue);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);
document.observe("mobile:zipcodeChanged",this._preboundZipFieldChangedHandler);
this._preboundCountryFieldChangedHandler=this._countryFieldChangedHandler.bind(this);
this._countryField.observe("change",this._preboundCountryFieldChangedHandler);
this._zipCache=this._options.cache;
this._initializing=true;
this._countryFieldChangedHandler()
},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}$/})});var css_browser_selector=function(){var d=navigator.userAgent.toLowerCase(),f=function(b){return d.indexOf(b)!=-1
},e=document.getElementsByTagName("html")[0],a=(!(/opera|webtv/i.test(d))&&/msie (d)/.test(d))?("ie ie"+RegExp.$1):f("gecko/")?"gecko":f("opera/9")?"opera opera9":/opera (d)/.test(d)?"opera opera"+RegExp.$1:f("konqueror")?"konqueror":f("applewebkit/")?"webkit safari":f("mozilla/")?"gecko":"",g=(f("x11")||f("linux"))?" linux":f("mac")?" mac":f("win")?" win":"";
var i=a+g+" js";
e.className+=e.className?" "+i:i
}();if(typeof(mobile)=="undefined"){var mobile={}
}mobile.Cookie=Class.create({_options:null,_name:null,initialize:function(b,a){this._options=Object.extend({path:false,domain: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.domain){b+="; domain="+this._options.domain
}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(){document.cookie=this._name+"= ;expires="+(new Date(0)).toGMTString()
}});
mobile.Cookie.rootDomain=function(){var b=document.location.hostname;
var d=["mobile.de","automobile.fr","automobile.it","pl.mobile.eu","mobile.ro"];
for(var a=0;
a<d.length;
a++){var c=d[a];
if(b.indexOf(c)>=0){return"."+c
}}return b
};
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.emptyDartSelector="span img[src*='http://pics.ebaystatic.com/aw/pics/de/mobile_de/1x1.gif'] ,a img[src*='http://static.2mdn.net/viewad/817-grey.gif'] ,a img[src*='http://m1.2mdn.net/viewad/817-grey.gif'] ,a img[src*='http://s0.2mdn.net/viewad/817-grey.gif'] ,table img[src*='http://pics.ebaystatic.com/aw/pics/de/mobile_de/1x1.gif'], table img[src*='http://pics.ebaystatic.com/aw/pics/de/mobile_de/default_2x2.GIF']";
mobile.DartWatcher=Class.create({_bannerWrapper:null,_options:null,showBanner:false,initialize:function(c,b){this._bannerWrapper=$(c);
this._options=Object.extend({nullHtmlElement:mobile.emptyDartSelector,toggleAction:"display"},b);
if(this._bannerWrapper){var a=this._checkNullElement();
if(!a){if(this._options.toggleAction=="display"){this._bannerWrapper.setStyle({display:"block"})
}else{if(this._options.toggleAction=="visibility"){this._bannerWrapper.setStyle({visibility:"visible"})
}}this.showBanner=true
}else{this._bannerWrapper.hide()
}}},getBannerWrapper:function(){return this._bannerWrapper
},_checkNullElement:function(){var a=this._bannerWrapper.down(this._options.nullHtmlElement);
if(a){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(a)
}}).bindAsEventListener(this))
}else{this._form.getElements("select").invoke("observe","change",function(a){this._method(a.element())
}.bind(this));
this._form.select("input[type=checkbox]").invoke("observe","click",function(a){this._method(a.element())
}.bind(this));
this._form.observe("dom:update",(function(a){a.memo.select("select").invoke("observe","change",function(b){this._method(b.element())
}.bind(this))
}).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(a.element())
}}).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=[]
}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.ImageLateLoader=(function(){var b,a,c=null;
b=function(d){if(c){document.stopObserving("mobile:late",c);
Event.stopObserving(window,"scroll",c)
}if(d){d.each(function(e,f){setTimeout((function(){var g=e.getAttribute("rel");
if(g!==""&&g!=e.src){e.observe("load",function(){var h=e.up(".loaded-later");
if(h){h.removeClassName("loaded-later")
}});
e.src=g
}}).bind(e),10)
})
}};
a=function(d){if(d){if(document.viewport.getScrollOffsets().top>0){b(d)
}else{c=b.curry(d);
document.observe("mobile:late",c);
Event.observe(window,"scroll",c)
}}};
return{load:b,register:a}
})();
mobile.ImageSwitcher=Class.create({_bigImage:null,_thumbsWrapper:null,_spinner:null,_mouseOverTimeout:null,initialize:function(c,a,b){this._bigImage=c;
this._thumbsWrapper=$(a);
this._options=Object.extend({selectEvent:"mouseover",thumbLinkSelector:"a[rel]"},b);
this._bigImage.observe("load",function(){mobile.spinner.hide(this._bigImage)
}.bind(this));
if(this._options.selectEvent=="mouseover"){this._thumbsWrapper.observe("mouseout",function(){clearTimeout(this._mouseOverTimeout);
this._mouseOverTimeout=null
}.bind(this))
}mobile.observe(this._options.thumbLinkSelector,this._options.selectEvent,this._thumbSelectHandler.bind(this),{allowNested:true,parentElement:this._thumbsWrapper})
},_thumbSelectHandler:function(b,a){if(this._options.selectEvent=="mouseover"){if(this._mouseOverTimeout){clearTimeout(this._mouseOverTimeout);
this._mouseOverTimeout=null
}this._mouseOverTimeout=setTimeout(this._switchImage.bind(this,b,a),100)
}else{this._switchImage(b,a)
}},_switchImage:function(b,a){if(a.rel!=this._bigImage.src){mobile.spinner.show(this._bigImage);
this._bigImage.src=a.rel
}}});
mobile.ImageVideoGallerySwitcher=Class.create({_videoImage:null,_bigImage:null,_thumbsWrapper:null,_imageWrapper:null,_videoWrapper:null,_spinner:null,_mouseOverTimeout:null,_thumbs:null,_timer:null,_clickCount:null,_dealer:null,initialize:function(d,h,c,g,b,a,f,e){this._videoImage=d;
this._bigImage=h;
this._thumbsWrapper=$(c);
this._imageWrapper=$(g);
this._videoWrapper=$(b);
this._thumbs=$$("#desThumbnails a.img");
this._timer=mobile.gallery.timer;
this._clickCount=a;
this._count=null;
this._dealer=f;
this._options=Object.extend({selectEvent:"click",thumbLinkSelector:"a[rel]",thumbNameSelector:"a[name]"},e);
if(this._videoImage!=null){this._displayVideo()
}$$(".clickCounter").invoke("observe","click",function(i){this._clicker(this._clickCount,i)
}.bind(this));
this._bigImage.observe("load",function(){mobile.spinner.hide(this._bigImage)
}.bind(this));
if(this._options.selectEvent=="mouseover"){this._thumbsWrapper.observe("mouseout",function(){clearTimeout(this._mouseOverTimeout);
this._mouseOverTimeout=null
}.bind(this))
}mobile.observe(this._options.thumbLinkSelector,this._options.selectEvent,this._thumbSelectHandler.bind(this),{allowNested:true,parentElement:this._thumbsWrapper})
},_thumbSelectHandler:function(b,a){if(this._options.selectEvent=="mouseover"){if(this._mouseOverTimeout){clearTimeout(this._mouseOverTimeout);
this._mouseOverTimeout=null
}this._mouseOverTimeout=setTimeout(this._switchImage.bind(this,b,a),100)
}else{this._switchImage(b,a)
}},_switchImage:function(b,a){this._thumbs.each(function(d,c){d.removeClassName("active")
});
if(a.rel!=this._bigImage.src){if(a.rel==this._videoImage){this._displayVideo()
}else{this._hideVideo();
mobile.spinner.show(this._bigImage);
this._bigImage.src=a.rel
}}a.addClassName("active")
},_displayVideo:function(){this._videoWrapper.update(slideshow);
this._videoWrapper.show();
this._imageWrapper.hide()
},_hideVideo:function(){this._videoWrapper.hide();
this._imageWrapper.show()
},_clicker:function(a,c){a++;
var b=c.element().id;
if(this._dealer==false){if(a==3||a==6){this._loadAd(a);
$("closeAd").observe("click",this._hideAd)
}else{if(a==4||a==7){this._hideAd()
}}}if(b=="galleryLinkPrev"){this._getImageIndexBySrc();
if((this._videoImage!=null&&this._videoWrapper.style.display!="none")||(this._videoImage==null&&this._imgIndex==0)){this._imgIndex=mobile.gallery.size-1
}else{if(this._imgIndex>0){this._imgIndex--
}}if(a!=3&&a!=6){mobile.spinner.show($("currentImage"))
}if(this._videoImage!=null&&this._imgIndex==0){this._displayVideo()
}else{this._hideVideo();
$("currentImage").src=mobile.gallery.picsXXL[this._imgIndex]
}this._thumbs.each(function(e,d){e.removeClassName("active")
});
this._thumbs[this._imgIndex].addClassName("active");
c.stop()
}if(b=="galleryLinkNext"){this._getImageIndexBySrc();
if((this._videoImage!=null&&this._videoWrapper.style.display!="none")){this._imgIndex=1
}else{if(this._imgIndex<mobile.gallery.size-1){this._imgIndex++
}else{if(this._imgIndex==mobile.gallery.size-1){this._imgIndex=0
}}}if(a!=3&&a!=6){mobile.spinner.show($("currentImage"))
}if(this._videoImage!=null&&this._imgIndex==0){this._displayVideo()
}else{this._hideVideo();
$("currentImage").src=mobile.gallery.picsXXL[this._imgIndex]
}this._thumbs.each(function(e,d){e.removeClassName("active")
});
this._thumbs[this._imgIndex].addClassName("active");
c.stop()
}this._clickCount=a;
return this._clickCount
},_loadAd:function(b){if(this._dealer==false){if(this._count){window.clearInterval(this._count)
}if(b==3){dartUrl=mobile.gallery.dartURL_1;
this._adTimer=mobile.gallery.timer
}else{dartUrl=mobile.gallery.dartURL_2;
this._adTimer=mobile.gallery.timer
}var a=new Element("iframe",{"class":"adFrame",width:"300",height:"280",scrolling:"no",marginwidth:"0",frameborder:"0"});
window.setTimeout(function(){a.src=dartUrl;
$("adContent").update(a)
},10);
$("adBox").show();
this._count=setInterval(this._updateTimer.bind(this),1000)
}},_updateTimer:function(){this._adTimer--;
if(this._adTimer==0){$("adContent").update();
$("adBox").fade();
window.clearInterval(this._count)
}},_hideAd:function(a){if(a){a.stop()
}$("adContent").update();
$("adBox").fade()
},_getImageIndexBySrc:function(){var c=this._bigImage.readAttribute("src");
var b=mobile.gallery.picsXXL.length;
for(var a=0;
a<b;
a++){if(c==mobile.gallery.picsXXL[a]){this._imgIndex=a;
return a
}}this._imgIndex=0;
return 0
}});
mobile.MainImageVideoGallerySwitcher=Class.create({_videoImage:null,_bigImage:null,_thumbsWrapper:null,_imageWrapper:null,_videoWrapper:null,_spinner:null,_mouseOverTimeout:null,_thumbs:null,_clickCount:null,_dealer:null,initialize:function(d,h,c,g,b,a,f,e){this._videoImage=d;
this._bigImage=h;
this._thumbsWrapper=$(c);
this._imageWrapper=$(g);
this._videoWrapper=$(b);
this._thumbs=$$("#desThumbnails a.img");
this._clickCount=a;
this._count=null;
this._dealer=f;
this._options=Object.extend({selectEvent:"click",thumbLinkSelector:"a[rel]",thumbNameSelector:"a[name]"},e);
if(this._videoImage!=null){this._displayVideo()
}$$(".clickCounter").invoke("observe","click",function(i){this._clicker(this._clickCount,i)
}.bind(this));
$$(".openGallery").invoke("observe","click",function(k){var l=$$(".galleryLightbox");
l.each(function(p,o){p.remove()
});
var i=this._getImageIndexBySrc();
var j=this._videoImage;
var m=$("galleryLink");
var n=new mobile.lightbox(m,{className:"galleryLightbox",afterClose:function(){this.destroy()
},onRemoteContentLoaded:function(){setTimeout(function(){if(j!=null){if($("currentImage").src.substr($("currentImage").src.length-j.length,$("currentImage").src.length)==j){$("videoWrapper").update("");
$("videoWrapper").hide()
}new mobile.LightboxImageVideoGallerySwitcher(j,0,this._dealer,i,{selectEvent:"click"})
}else{new mobile.LightboxImageVideoGallerySwitcher(null,0,this._dealer,i,{selectEvent:"click"})
}},1000)
}});
n.open();
k.stop();
return false
}.bind(this));
this._bigImage.observe("load",function(){mobile.spinner.hide(this._bigImage)
}.bind(this));
if(this._options.selectEvent=="mouseover"){this._thumbsWrapper.observe("mouseout",function(){clearTimeout(this._mouseOverTimeout);
this._mouseOverTimeout=null
}.bind(this))
}mobile.observe(this._options.thumbLinkSelector,this._options.selectEvent,this._thumbSelectHandler.bind(this),{allowNested:true,parentElement:this._thumbsWrapper})
},_thumbSelectHandler:function(b,a){if(this._options.selectEvent=="mouseover"){if(this._mouseOverTimeout){clearTimeout(this._mouseOverTimeout);
this._mouseOverTimeout=null
}this._mouseOverTimeout=setTimeout(this._switchImage.bind(this,b,a),100)
}else{this._switchImage(b,a)
}},_switchImage:function(b,a){this._thumbs.each(function(d,c){d.removeClassName("active")
});
if(a.rel!=this._bigImage.src){if(a.rel==this._videoImage){this._displayVideo()
}else{this._hideVideo();
mobile.spinner.show(this._bigImage);
this._bigImage.src=a.rel
}}a.addClassName("active")
},_displayVideo:function(){this._videoWrapper.update(slideshow);
this._bigImage.src=this._videoImage;
this._videoWrapper.show();
this._imageWrapper.hide()
},_hideVideo:function(){this._videoWrapper.update("");
this._videoWrapper.hide();
this._imageWrapper.show()
},_clicker:function(a,c){a++;
var b=c.element().id;
this._clickCount=a;
return this._clickCount
},_getImageIndexBySrc:function(){var c=this._bigImage.readAttribute("src");
var b=mobile.gallery.picsL.length;
for(var a=0;
a<b;
a++){if(c==mobile.gallery.picsL[a]){this._imgIndex=a;
return a
}}this._imgIndex=0;
return 0
}});
mobile.LightboxImageVideoGallerySwitcher=Class.create({_lbVideoImage:null,_lbBigImage:null,_lbThumbsWrapper:null,_lbImageWrapper:null,_lbVideoWrapper:null,_lbSpinner:null,_lbMouseOverTimeout:null,_lbThumbs:null,_lbClickCount:null,_lbDealer:null,_lbInitialPic:null,initialize:function(c,a,e,b,d){this._lbVideoImage=c;
that=this;
this._lbBigImage=$("lbCurrentImage");
this._lbThumbsWrapper=$("lbDesThumbnails");
this._lbImageWrapper=$("lbImageDisplay");
this._lbVideoWrapper=$("lbVideoWrapper");
this._lbThumbs=$$("#lbDesThumbnails a.img");
this._lbClickCount=a;
this._count=null;
this._lbDealer=e;
this._lbInitialPic=b;
this._options=Object.extend({selectEvent:"click",thumbLinkSelector:"a[rel]",thumbNameSelector:"a[name]"},d);
if(this._lbVideoImage!=null&&this._lbInitialPic=="0"){this._displayVideo()
}if(this._lbInitialPic!="0"){this._displayImage(this._lbInitialPic)
}$$(".galleryLightbox .clickCounter").invoke("observe","click",function(f){this._clicker(this._lbClickCount,f)
}.bind(this));
$$(".window-close").invoke("observe","click",function(f){if($("currentImage").src.substr($("currentImage").src.length-that._lbVideoImage.length,$("currentImage").src.length)==that._lbVideoImage){$("videoWrapper").update(slideshow);
$("videoWrapper").show()
}});
this._lbBigImage.observe("load",function(){mobile.spinner.hide(this._lbBigImage)
}.bind(this));
if(this._options.selectEvent=="mouseover"){this._lbThumbsWrapper.observe("mouseout",function(){clearTimeout(this._lbMouseOverTimeout);
this._lbMouseOverTimeout=null
}.bind(this))
}mobile.observe(this._options.thumbLinkSelector,this._options.selectEvent,this._lbThumbselectHandler.bind(this),{allowNested:true,parentElement:this._lbThumbsWrapper})
},_lbThumbselectHandler:function(b,a){this._switchImage(b,a)
},_switchImage:function(b,a){this._lbThumbs.each(function(d,c){d.removeClassName("active")
});
if(a.rel!=this._lbBigImage.src){if(a.rel==this._lbVideoImage){this._displayVideo()
}else{this._hideVideo();
mobile.spinner.show(this._lbBigImage);
this._lbBigImage.src=a.rel
}}a.addClassName("active")
},_displayVideo:function(){this._lbVideoWrapper.update(slideshowXL);
this._lbVideoWrapper.show();
this._lbImageWrapper.hide();
$("lbImageWrapper").removeClassName("imgLoading")
},_hideVideo:function(){this._lbVideoWrapper.hide();
this._lbImageWrapper.show()
},_clicker:function(a,c){a++;
var b=c.element().id;
if(b=="lbGalleryLinkPrev"||b=="lbGalleryLinkPrevBottom"){$(b).blur();
this._getImageIndexBySrc();
if((this._lbVideoImage!=null&&this._lbVideoWrapper.style.display!="none")||(this._lbVideoImage==null&&this._imgIndex==0)){this._imgIndex=mobile.gallery.size-1
}else{if(this._imgIndex>0){this._imgIndex--
}}mobile.spinner.show(this._lbBigImage);
if(this._lbVideoImage!=null&&this._imgIndex==0){this._displayVideo()
}else{this._hideVideo();
var d=mobile.gallery.picsXXL[this._imgIndex];
$(this._lbBigImage).src=d
}this._lbThumbs.each(function(f,e){f.removeClassName("active")
});
this._lbThumbs[this._imgIndex].addClassName("active");
c.stop()
}if(b=="lbGalleryLinkNext"||b=="lbGalleryLinkNextBottom"){$(b).blur();
this._getImageIndexBySrc();
if((this._lbVideoImage!=null&&this._lbVideoWrapper.style.display!="none")){this._imgIndex=1
}else{if(this._imgIndex<mobile.gallery.size-1){this._imgIndex++
}else{if(this._imgIndex==mobile.gallery.size-1){this._imgIndex=0
}}}mobile.spinner.show(this._lbBigImage);
if(this._lbVideoImage!=null&&this._imgIndex==0){this._displayVideo()
}else{this._hideVideo();
var d=mobile.gallery.picsXXL[this._imgIndex];
$(this._lbBigImage).src=d
}this._lbThumbs.each(function(f,e){f.removeClassName("active")
});
this._lbThumbs[this._imgIndex].addClassName("active");
c.stop()
}this._lbClickCount=a;
return this._lbClickCount
},_displayImage:function(a){this._hideVideo();
var b=mobile.gallery.picsXXL[a];
$(this._lbBigImage).src=b;
this._lbThumbs.each(function(d,c){d.removeClassName("active")
});
this._lbThumbs[a].addClassName("active");
$("lbImageWrapper").removeClassName("imgLoading")
},_getImageIndexBySrc:function(){var c=this._lbBigImage.readAttribute("src");
var b=mobile.gallery.picsXXL.length;
for(var a=0;
a<b;
a++){if(c==mobile.gallery.picsXXL[a]){this._imgIndex=a;
return a
}}this._imgIndex=0;
return 0
}});
mobile.GalleryImageLayer=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._setImpressionTracker(a)
}this._setInfoBoxAlignment(a);
c.show();
if(mobile.BrowserCheck.IE6){this._helper.showBackgroundFrame(this._getInfoBox())
}},_setImpressionTracker:function(b){var a=b.next().getAttribute("impression-tracker");
var c=b.next().getAttribute("impression-tracker-id");
if(!(!a)&&!(!c)){if(!$(c)){var d=new Element("iframe",{id:c,src:a+";ord="+Math.random()*10000000000000000,style:"display: none;"});
documentBody.insert({bottom:d})
}}},_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")
});document.observe("mobile:ready",function(){if(!a()){var b=$$("input[type=text][placeholder]");
b.each(function(e){var d=e.readAttribute("placeholder");
if(!$F(e)){e.addClassName("placeholder");
e.value=d
}e.observe("focus",function(){if($F(e)==d){e.value="";
e.removeClassName("placeholder")
}});
e.observe("blur",function(){if(!$F(e)){e.addClassName("placeholder");
e.value=d
}})
});
$$("form").invoke("observe","submit",c);
document.observe("mobile:ajaxCall",c);
Event.observe(window,"unload",c)
}function a(){var d=document.createElement("input");
return !!("placeholder" in d)
}function c(){b.each(function(d){if($F(d)==d.readAttribute("placeholder")){d.value=""
}})
}});var ir_questionnaire="http://survey1.irquest.com/irqirq/Start?si=389&cs=16310245&p0=1";
var ir_feedback_protocol="http";
if(window.location.protocol.indexOf("https")>-1){ir_feedback_protocol="https"
}var ir_feedback_container='<div id="ir-feedback-container"></div>';
var ir_feedback='<div id="ir-feedback" style="visibility: hidden; z-index: 200000; width: 840px; height: 630px; position: fixed; top: 20px; left: 100px; margin-bottom:20px; box-shadow: 0 0 5px #000; -moz-box-shadow: 0 0 5px #000; -webkit-box-shadow: 0 0 5px #000; border: 1px solid #666; background: #fff;">	<div style="display: block; width: 98%; padding:1px; height:14px; cursor:pointer; text-align: right;">		<a href="javascript:ir_turnfeedback(0);" style="font: 13px/16px Verdana; color:#666;">			schlie&szlig;en		</a>	</div>	<iframe id="ir_questionnaire" src="'+ir_questionnaire+'" width="840px" height="613px" frameborder="0" scrolling="auto"></iframe></div>';
document.write(ir_feedback_container);
function ir_turnfeedback(a){if(a==1){document.getElementById("ir-feedback-container").innerHTML=ir_feedback
}var b=0,e=document.getElementsByTagName("object"),c=e.length;
while(b<c){e[b++].style.visibility=a?"hidden":"visible"
}document.getElementById("ir-feedback").style.visibility=a?"visible":"hidden";
if(a==0){var g=document.getElementById("ir-feedback-container");
var f=document.getElementById("ir-feedback");
g.removeChild(f)
}};document.observe("mobile:ready",function(){var a=true;
mobile.observe(".jslink","click",function(f,d){if(a){var c=d;
if(c.hasAttribute("data-href")){a=false;
Event.stop(f);
var b=c.readAttribute("data-href");
try{if(c.hasAttribute("target")&&c.readAttribute("target")=="_blank"){window.open(b);
setTimeout(function(){a=true
},1000)
}else{location.href=b;
setTimeout(function(){a=true
},1000)
}}catch(g){}}}},{allowNested:true,stopEvent:false})
});
function sm_callTracker(item,nw){if(nw==1){var w=window.open(encodeURI(item));
w.focus()
}else{if(nw==2){var linkURL=encodeURI(item);
if(linkURL&&linkURL.indexOf("?")!=-1){linkURL+="&isPopup=true"
}else{linkURL+="?isPopup=true"
}var w=window.open(linkURL,"popup","width=1024,height=786,left=50,top=50,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes");
if(w){w.focus
}}else{eval(["docume","nt.loc","ation.hr","ef="].join("")+"'"+encodeURI(item)+"'")
}}}function sm(i,c,f,j){var g=i.getAttribute("base");
var h=i.getAttribute("type");
var d=i.getAttribute("nw");
if(i.getAttribute("mode")){var e=i.getAttribute("mode")
}else{var e=""
}var a="http"+e+((c)?"://www.":"://");
a+=((g&&i.lang)?g+"."+i.lang+"/":window.location.host+"/");
a+=f.join(((j)?j:"/"))+((h)?"."+h:"");
sm_callTracker(a,((parseInt(d))?parseInt(d):0))
};if(typeof(mobile)=="undefined"){var mobile={}
}mobile.loader=Class.create({initialize:function(b,a){this._element=b;
this._loadingWrapper=new Element("div",{"class":"loadingWrapper"});
this._loadingImage=new Element("div",{"class":"loadingImage"});
this._loadingText=new Element("span",{"class":"loadingText"});
this._elementPosition=this._element.cumulativeOffset();
this._options=Object.extend({imageClassName:"",text:"",textClassName:"",zIndex:50000,opacity:0.5,insertIntoElement:false},a);
if(this._options.imageClassName!=""){this._loadingImage.removeClassName("loadingImage");
this._loadingImage.addClassName(this._options.imageClassName)
}if(this._options.textClassName!=""){this._loadingText.removeClassName("loadingText");
this._loadingText.addClassName(this._options.textClassName)
}if(this._options.text!=""&&this._loadingText.empty){this._loadingText.insert(this._options.text)
}},show:function(){this._loadingWrapper.insert(this._loadingImage);
this._loadingWrapper.insert(this._loadingText);
this._loadingWrapper.setStyle({zIndex:this._options.zIndex});
this._loadingWrapper.hide();
if(this._options.insertIntoElement){this._element.setStyle({position:"relative"});
this._element.insert(this._loadingWrapper)
}else{documentBody.insert(this._loadingWrapper)
}this._centerElement(this._loadingWrapper,this._element);
this._element.setOpacity(this._options.opacity);
this._loadingWrapper.show()
},hide:function(){if(this._loadingWrapper){if(this._options.insertIntoElement){this._element.setStyle({position:"static"})
}this._element.setOpacity(1);
this._loadingWrapper.remove()
}},_centerElement:function(g,d){g.absolutize();
if(this._options.insertIntoElement){var f=0;
var b=0
}else{var f=d.cumulativeOffset().left;
var b=d.cumulativeOffset().top
}var h=d.getWidth();
var j=d.getHeight();
var c=g.positionedOffset()[0];
var a=g.positionedOffset()[1];
var k=g.getWidth();
var i=g.getHeight();
var l=(b+(j/2))-(a+(i/2));
var e=(f+(h/2))-(c+(k/2));
g.setStyle({left:e+"px",top:l+"px"})
}});mobile.localStorage=(function(){var b=mobile.PageParams.jsPath+"lib/jstorage/jstorage.js";
var c=function(d,e){mobile.require({"$.jStorage":b},function(){$.jStorage.set(d,e)
})
};
var a=function(d,e){mobile.require({"$.jStorage":b},function(){e($.jStorage.get(d))
})
};
return{set:c,withKey:a}
})();if(typeof(mobile)=="undefined"){var mobile={}
}mobile.displaymanager=(function(){var b;
function e(f){return Object.prototype.toString.call(f)
}function a(g){var f=[];
var h=g.firstChild;
while(h){if(h.nodeType===1){f.push(h)
}h=h.nextSibling
}if(f.length>1){return true
}return false
}function c(f){f.style.display="block"
}function d(f){var g;
var h=0;
if(!f||e(f)!=="[object Array]"){return
}for(h;
h<f.length;
h++){b=document.getElementById(f[h].toString());
if(!(!b)&&a(b)){c(b)
}}}return{updateElementDisplayStyle:d}
}());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",useDefaultMakeOption:true,useDefaultModelOption:true,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,true))
}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 h=this.constructor._modelCache.get(this._options.makesPath);
var b;
if(h){b=h.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,defaultSelect:this._options.useDefaultMakeOption,lang:mobile.language||"de"},this.constructor._additionalParams);
var c=new Ajax.Updater({success:this._makeElement},d,{parameters:e,method:"get",onSuccess:function(i){if(typeof(this._options.firstOptionMake)=="string"){i.responseText=this._addFirstOption(this._options.firstOptionMake,i.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 g=this.constructor._modelCache.get(this._options.modelsPath);
var b;
if(g){b=g.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),defaultSelect:this._options.useDefaultModelOption},f)
}var d=new Ajax.Updater({success:this._modelElement},e,{parameters:f,method:"get",onSuccess:function(h){if(typeof(this._options.firstOptionModel)=="string"){h.responseText=this._addFirstOption(this._options.firstOptionModel,h.responseText)
}}.bind(this),onComplete:this._modelListUpdated.bind(this,c,a)})
}},_makeListUpdated:function(d,c,b){var e=this.constructor._modelCache.get(this._options.makesPath);
if(!e){this.constructor._modelCache.set(this._options.makesPath,$H());
this.constructor._modelCache.get(this._options.makesPath).set(d,this._makeElement.innerHTML)
}else{if(!e.get(d)){e.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){var d=this.constructor._modelCache.get(this._options.modelsPath);
if(!d){this.constructor._modelCache.set(this._options.modelsPath,$H());
this.constructor._modelCache.get(this._options.modelsPath).set(c,this._modelElement.innerHTML)
}else{if(!d.get(c)){d.set(c,this._modelElement.innerHTML)
}}var a=b;
if(a){this._modelElement.setValue(a)
}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);
this._updateDescription(false)
},_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(c){if(this._descriptionElement){var b=this._descriptionElement.hasAttribute("data-prefilled");
if(this._modelElement.selectedIndex==0&&!c){this._descriptionElement.value="";
return
}if(!b){var a=this._modelElement.options[this._modelElement.selectedIndex];
this._descriptionElement.value=a.value?a.text:"";
this._descriptionElement.focus()
}else{this._descriptionElement.writeAttribute("data-prefilled",false)
}}},_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($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(){var f=false;
try{f=typeof top.document.referrer!="undefined"
}catch(g){}if(f){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","www.google.de/product_url?q=","images.google.de/images","maps.google.de/maps","www.google.de/imgres","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){if(b&&b.indexOf("?")!=-1){b+="&isPopup=true"
}else{b+="?isPopup=true"
}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()
});mobile.SearchUrlBuilder={build:function(a,f){if(!this.isUndefined(f.get("useCase"))){return a.getAttribute("action")
}var e="";
if(mobile.language==mobile.appLanguage){var g=this.getMakeModelVariants(f);
var l=this.getFuelEnums(f);
var j=this.getCategoryFieldName(f);
var d=this.getCategoryEnums(f,j);
if(this.isNoList(g)&&this.isNoList(l)&&this.isNoList(d)){if(!this.isUndefined(g)){var i=this.getMakeName(a,f,g[0]);
var h=this.getModelName(a,f,g[0]);
var k=this.getModelDescription(f,g[0]);
e=this.append(e,i);
e=this.append(e,h);
e=this.append(e,k)
}if(!this.isUndefined(l)){var b=this.getFuelName(a,f,l[0]);
e=this.append(e,b)
}if(!this.isUndefined(d)){var c=this.getCategoryName(a,f,j,d[0]);
e=this.append(e,c)
}}}if(e==""){e="search"
}e=this.append(e,"html");
result=this.currentUrl(a).replace(/\/[^\/]+\.html/,"/"+e);
return result
},getMakeName:function(a,b,c){return this.getSelectBoxOptionLabel(a,b,"makeModelVariant"+c+".makeId")
},getModelName:function(a,b,c){return this.getSelectBoxOptionLabel(a,b,"makeModelVariant"+c+".modelId")
},getModelDescription:function(a,b){return a.get("makeModelVariant"+b+".modelDescription")
},getFuelEnums:function(b){var a=b.get("fuels");
return typeof a=="string"?new Array(a):a
},getFuelName:function(b,d,c){var a=this.getLabel("fuel_"+c);
if(this.isUndefined(a)){a=this.getSelectBoxOptionLabel(b,d,"fuels")
}return a
},getCategoryFieldName:function(a){if(!this.isUndefined(a.get("categories"))){return"categories"
}if(!this.isUndefined(a.get("category"))){return"category"
}if(!this.isUndefined(a.get("vehicleCategory"))){return"vehicleCategory"
}return undefined
},getCategoryEnums:function(b,c){var a=b.get(c);
return typeof a=="string"?new Array(a):a
},getCategoryName:function(b,c,e,d){var a=this.getLabel(d);
if(this.isUndefined(a)){a=this.getLabel("category_"+d)
}if(this.isUndefined(a)){a=this.getSelectBoxOptionLabel(b,c,e)
}return a
},getMakeModelVariants:function(h){var b=new Array();
var g=h.get("makeModelVariant1.makeId");
var f=h.get("makeModelVariant2.makeId");
var d=h.get("makeModelVariant3.makeId");
var e=h.get("makeModelVariant1.modelDescription");
var c=h.get("makeModelVariant2.modelDescription");
var a=h.get("makeModelVariant3.modelDescription");
if(!this.isUndefined(g)||!this.isUndefined(e)){b.push(1)
}if(!this.isUndefined(f)||!this.isUndefined(c)){b.push(2)
}if(!this.isUndefined(d)||!this.isUndefined(a)){b.push(3)
}return b
},isNoList:function(a){return this.isUndefined(a)||typeof a=="string"||(a instanceof Array&&a.length<2)
},isUndefined:function(a){return typeof a=="undefined"||a==""||(a instanceof Array&&a.length==0)
},getSelectBoxOptionLabel:function(c,f,g){var a=undefined;
var e=$(c.id)[g];
var d=f.get(g);
if(typeof d!=="undefined"){a=e.options[e.selectedIndex].innerHTML;
if(!this.isUndefined(a)&&a.match("^&nbsp;&nbsp;")&&e.selectedIndex>0){var b=e.options[e.selectedIndex-1].innerHTML;
a=a.replace(/^&nbsp;&nbsp;/,"");
a=b+a
}}return a
},getLabel:function(b){var a=$$('label[for="'+b+'"]');
if(!this.isUndefined(a)&&!this.isUndefined(a[0])&&!this.isUndefined(a[0].childNodes[0])){return a[0].childNodes[0].nodeValue
}return undefined
},append:function(a,b){if(!this.isUndefined(b)){if(!a==""){a=a+"."
}a=a+this.normalize(b);
return a
}return a
},normalize:function(b){var a=b.replace(/&nbsp;/g," ");
a=a.replace(/^\s*(\S*(?:\s+\S+)*)\s*$/,"$1");
a=a.replace(/[\/]/g,"-");
a=a.toLowerCase();
a=encodeURIComponent(a);
return a
},currentUrl:function(a){if(typeof a.getAttribute("action")!=="undefined"){return a.getAttribute("action")
}return""
}};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 b=$H();
var d=$w("lang _features bodyStyleRadio");
var a=$H(mobile.defaultSearchParams);
c.each(function(e){if(!e.value){return
}if(d.include(e.key)){return
}if(mobile.defaultSearchParams&&a.get(e.key)&&a.get(e.key).indexOf(e.value)>-1){return
}if(e.key=="minPowerAsArray"||e.key=="maxPowerAsArray"){if(e.value[0]==""){return
}}b.set(e.key,e.value)
},this);
return b
},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)
},submitSearchForm:function(c,a){var d=this.getMinimalValidSearchParams($H(Form.serialize(c,true)));
var b=a||mobile.SearchUrlBuilder.build(c,d);
location.href=b+"?"+d.toQueryString()
},addSessionParamsToLink:function(b,a,g){var e=b.href;
var c=(g)?g:e.split("?")[0];
var d=$H(e.toQueryParams());
var a=$H(a.toQueryParams());
var f=a.merge(d);
c=c+"?"+f.toQueryString();
return c
}});if(typeof(mobile)=="undefined"){var mobile={}
}mobile.shortUrl={create:function(b,g,a){var f="__callback"+(new Date()).getTime();
var c=false;
var e=new Element("script",{type:"text/javascript"});
e.src=mobile.PageParams.shortUrlServiceUrl+"share?callback=mobile.shortUrl."+f+"&url="+encodeURIComponent(b);
var d=setTimeout(function(){c=true;
g(a||"http://mobile.de");
this[f]=Prototype.emptyFunction
},1500);
this[f]=function(h){if(!c){clearTimeout(d);
g(h)
}};
documentBody.insert(e);
return f
},createWithAnalytics:function(b,d,c,a){var b=c?this.urlWithAnalytics(b,c):b;
return this.create(b,d,a)
},createForCurrentPage:function(d,c,a){var b=c?this.urlWithAnalytics(document.URL,c):document.URL;
return this.create(b,d,a)
},urlWithAnalytics:function(a,c){var h=["utm_medium","utm_campaign","utm_source"];
var l=["utm_medium=socialmedia","utm_campaign=generic","utm_source="+c];
var b=a.split("?");
if(b.length>=2){var k=b[1].split("#");
var d=k[0].split(/[&;]/g);
for(var e=d.length-1;
e>=0;
e--){if(d[e].length==0){d.splice(e,1)
}}for(var f=0;
f<h.length;
f++){var g=h[f]+"=";
for(var e=d.length-1;
e>=0;
e--){if(d[e].lastIndexOf(g,0)!==-1){d.splice(e,1)
}}}l=l.concat(d);
a=b[0]+"?"+l.join("&");
if(k.length>=2){a=a+"#"+k[1]
}}else{a=b[0]+"?"+l.join("&")
}return a
}};if(typeof(mobile)=="undefined"){var mobile={}
}mobile.spinner=Class.create({_element:null,_wrapper:null,_cover:null,_image:null,_imageLoaded:false,_lastShown:null,initialize:function(b,a){this._element=$(b);
this._options=Object.extend({opacity:0.7,image:mobile.PageParams.imagePath+"loader_grey_small.gif",minShowTime:0,styles:{}},a);
this._image=new Image();
this._image.onload=function(){this._imageLoaded=true
}.bind(this);
this._image.onerror=function(c){console.log("error: ",c)
};
this._image.src=this._options.image
},show:function(a){if(!this._wrapper){this._wrapper=new Element("div",{style:"position: absolute;"});
this._wrapper.hide();
this._cover=new Element("div",{style:"background-color: white; width: 100%; height: 100%;"});
this._wrapper.insert(this._cover);
this._wrapper.setStyle(this._options.styles);
documentBody.insert(this._wrapper);
this._showImage()
}this.showTimeout=setTimeout((function(){var c=this._element.cumulativeOffset();
var b=this._element.getDimensions();
var d=this._element.getStyle("zIndex");
this._wrapper.setStyle({width:b.width+"px",height:b.height+"px",left:c.left+"px",top:c.top+"px",zIndex:d?d+1:20000});
this._cover.setOpacity(a?1:this._options.opacity);
this._wrapper.show();
this._lastShown=new Date()
}).bind(this),10)
},_showImage:function(){if(!this._imageLoaded){this._showImage.bind(this).delay(0.1)
}else{this._wrapper.insert(this._image);
this._image=this._wrapper.down("img");
this._image.setStyle({position:"absolute",top:"50%",left:"50%",marginLeft:"-"+this._image.width/2+"px",marginTop:"-"+this._image.height/2+"px"});
this._image.show()
}},hide:function(){if(!this._wrapper){return
}var a=new Date()-this._lastShown;
if(!this._lastShown||a>=this._options.minShowTime*1000){clearTimeout(this.showTimeout);
this.showTimeout=null;
this._wrapper.hide()
}else{this.hide.bind(this).delay(this._options.minShowTime-a/1000+10/1000)
}}});
Object.extend(mobile.spinner,{_defaults:{},setDefaults:function(a){this._defaults=a
},getSpinner:function(b,a){b=$(b);
var d=b.retrieve("spinner");
if(!d){var c=Object.extend(this._defaults,a);
d=new mobile.spinner(b,c);
b.store("spinner",d)
}return d
},show:function(b,a){this.getSpinner(b,a).show()
},hide:function(a){this.getSpinner(a).hide()
}});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()
}}};if(typeof(mobile)=="undefined"){var mobile={}
}if(typeof(mobile.webAnalyticsParams)=="undefined"){mobile.webAnalyticsParams={}
}mobile.webAnalyticsParams.basePageCode=(mobile.PageParams.isDealer)?"/"+mobile.language+"/dealer":"/"+mobile.language+"/public";
mobile.GoogleWebAnalyticsTrackEvent=Class.create({_options:null,_elements:null,_match:null,initialize:function(b,a){this._elements=$H(b||{});
this._options=Object.extend({parentElement:documentBody,allowNested:false,stopEvent:false,skipTextInputFields:true},a||{})
},track:function(a){if(!(a.tagName=="INPUT"&&a.getAttribute("type")=="text"&&this._options.skipTextInputFields)){this._elements.keys().each(function(b){if(a.match(b)){_gaq.push(this._elements.get(b))
}}.bind(this))
}},trackEvents:function(a){var b=this._elements.keys().join(", ");
mobile.observe(b,"click",function(d,c){this.track(c)
}.bind(this),{parentElement:this._options.parentElement,allowNested:this._options.allowNested,stopEvent:this._options.stopEvent})
}});
