mobile.initializePage("offer",function(){if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="vehicleInsertionCarStart"){var Q=$("linkListInsertionStart");
if(Q){Q.insert({top:new Element("li").update(directInsertLink)})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="vehicleInsertionSelectType"){documentBody.select(".button input").first().observe("click",function(a){if(!typeSelectCheckForm()){a.stop()
}})
}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="vehicleInsertionDetail"){if($("syiForm")){mobile.FormHelper.submitOnce($("syiForm"))
}var A=$("modelListSelect");
if(A){A.observe("change",function(){mobile.modelHelper.modelChange(this).bindAsEventListener(this)
})
}var C=$("vehicleDescr");
var U=$("wordCounter");
var T=1000;
if(C&&U){C.observe("keyup",function(){var a=C.value.length;
if(a>=T){C.value=C.value.substring(0,T);
U.update("0")
}else{U.update(T-a)
}})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="vehicleInsertionDetail"&&mobile.siteId!="FRANCE"&&mobile.siteId!="ITALY"){var W=documentBody.select("input[type='checkbox'][name='price.vatCheckbox']");
if($("price.vatCheckbox").checked){var Y=true
}else{var Y=false
}if(W){W.invoke("observe","click",function(){if(($("price.vatCheckbox").checked)&&!(Y)){$("price.vatRate").mobile_toggle();
Y=true
}else{if(($("price.vatCheckbox"))&&Y){$("price.vatRate").mobile_toggle();
$("price.vatRate").selectedIndex=0;
Y=false
}}})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="contactInsertionData"){var M=$("change-business-status");
var O=$("commercialTipp");
var F=$("commercialBlock");
var J=$("phoneNumber");
M.observe("change",function(){if(M.value=="true"){O.mobile_toggle();
$("companyName").disabled=false;
$("taxIdNumber").disabled=false;
$("imprint").disabled=false;
F.mobile_toggle();
J.mobile_toggle()
}else{O.mobile_toggle();
$("companyName").disabled=true;
$("taxIdNumber").disabled=true;
$("imprint").disabled=true;
F.mobile_toggle();
J.mobile_toggle()
}})
}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="contactInsertionData"){var V=$("loginBox");
var P=$("dataBox");
var L=documentBody.select("#loginBox .register-now .button").first();
if(V&&P&&L){L.observe("click",function(){P.setStyle({display:"block"});
V.hide();
var a=documentBody.select(".reloadLink");
a.invoke("setStyle",{display:"block"});
var b=documentBody.select(".backLink");
b.invoke("setStyle",{display:"none"})
})
}mobile.FormHelper.connectSelects("countrySelect","primaryNumberCountryId")
}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="bundleSelectionEnterData"){var N=documentBody.down("div.progressBar");
if(N){var K=documentBody.select("form input[type='radio']");
K.invoke("observe","click",function(a){var b=N.down("li#pay");
if(this.id=="BASIS"){b.setStyle({display:"none"});
N.down("ul").setStyle({width:"624px"})
}else{b.setStyle({display:"block"});
N.down("ul").setStyle({width:"728px"})
}})
}var E=documentBody.select(".cols3 .col ul");
if(E&&E.size()>0){E.invoke("observe","click",function(b){b.stop();
var a=b.element();
if(a){mobile.openInfoLightbox(a)
}})
}mobile.openInfoLightbox=function(a){if(mobile.myLightbox==undefined){mobile.myLightbox=new lightbox(a)
}else{mobile.myLightbox.content=a.href
}mobile.myLightbox.activate()
}
}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="paymentEnterData"){var Z=documentBody.select("form fieldset");
if(Z&&Z.size()>0){Z.invoke("observe","click",function(){var a=this.down("input[type='radio']");
if(a){a.checked=true
}})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="dealerRegistrationForm"){mobile.FormHelper.connectMultiSelects("locationContactAddressCountry",["locationContactPhoneInternationalPrefix","locationContactPhone2InternationalPrefix","locationContactFaxInternationalPrefix","locationContactCellPhoneInternationalPrefix","supportContactAddressCountry","supportContactPhoneInternationalPrefix","supportContactFaxInternationalPrefix","supportContactCellPhoneInternationalPrefix","billingContactAddressCountry","billingContactPhoneInternationalPrefix","billingContactFaxInternationalPrefix"]);
mobile.FormHelper.connectMultiSelects("supportContactAddressCountry",["supportContactPhoneInternationalPrefix","supportContactFaxInternationalPrefix","supportContactCellPhoneInternationalPrefix"]);
mobile.FormHelper.connectMultiSelects("billingContactAddressCountry",["billingContactPhoneInternationalPrefix","billingContactFaxInternationalPrefix"]);
mobile.FormHelper.connectTextInputs("locationContactCompanyName","billingContactCompanyName");
mobile.FormHelper.connectTextInputs("locationContactAddressStreet","billingContactAddressStreet");
mobile.FormHelper.connectTextInputs("locationContactAddressHouseNumber","billingContactAddressHouseNumber");
mobile.FormHelper.connectTextInputs("locationContactAddressStreet2","billingContactAddressStreet2");
mobile.FormHelper.connectTextInputs("locationContactAddressZipcode","billingContactAddressZipcode");
mobile.FormHelper.connectTextInputs("locationContactAddressCity","billingContactAddressCity");
mobile.FormHelper.connectTextInputs("locationContactPhonePrefix",["supportContactPhonePrefix","billingContactPhonePrefix"]);
mobile.FormHelper.connectTextInputs("locationContactPhoneNumber","billingContactPhoneNumber");
mobile.FormHelper.connectTextInputs("locationContactPhone2Number","billingContactPhone2Number");
mobile.FormHelper.connectTextInputs("locationContactFaxPrefix",["supportContactFaxPrefix","billingContactFaxPrefix"]);
mobile.FormHelper.connectTextInputs("locationContactFaxNumber",["supportContactFaxNumber","billingContactFaxNumber"]);
mobile.FormHelper.connectTextInputs("locationContactCellPhonePrefix",["supportContactCellPhonePrefix","billingContactCellPhonePrefix"]);
mobile.FormHelper.connectTextInputs("locationContactCellPhoneNumber","billingContactCellPhoneNumber");
mobile.FormHelper.connectTextInputs("supportContactEmail","billingContactEmail");
mobile.FormHelper.connectTextInputs("supportContactCompanyName","billingContactCompanyName");
mobile.FormHelper.connectTextInputs("supportContactFirstName","billingContactFirstName");
mobile.FormHelper.connectTextInputs("supportContactName","billingContactName");
var D=documentBody.select("input[type='radio'][name='differentSupportContact']");
var S=documentBody.select("input[type='radio'][name='differentBillingContact']");
var R=false;
var I=false;
if(D){D.invoke("observe","click",function(){if(($("differentSupportContact_yes").checked)&&!(R)){$("altSupportContact").mobile_toggle();
R=true
}else{if(($("differentSupportContact_no").checked)&&R){$("altSupportContact").mobile_toggle();
R=false
}}})
}if(S){S.invoke("observe","click",function(){if(($("differentBillingContact_yes").checked)&&!(I)){$("altBillingContact").mobile_toggle();
I=true
}else{if(($("differentBillingContact_no").checked)&&I){$("altBillingContact").mobile_toggle();
I=false
}}})
}documentBody.select(".make-select select").invoke("observe","change",function(b){var a=b.element().up(".make-select").next();
if(a){a.removeClassName("hiddenBox")
}});
documentBody.select("#locationContactAddressCountry").invoke("observe","change",function(b){var a=$F(b.element());
if(countryIdVatPrefix[a]){$A($("vatId.prefix").options).each(function(c){if(c.value===countryIdVatPrefix[a].prefix){$("vatId.prefix").selectedIndex=c.index
}});
if(countryIdVatPrefix[a].required){$("vatIdAvailable_no").checked="";
$("vatIdAvailable_yes").checked="checked";
$("vatId_label").addClassName("important");
$("vatId.prefix").setAttribute("readonly","true",0)
}else{$("vatId.prefix").setAttribute("readonly","false",0);
$("vatId.prefix").removeAttribute("readonly");
$("vatIdAvailable_yes").checked="";
$("vatIdAvailable_no").checked="checked";
$("vatId_label").removeClassName("important")
}}else{$("vatId.prefix").selectedIndex=0;
$("vatId.prefix").setAttribute("readonly","false",0);
$("vatId.prefix").removeAttribute("readonly");
$("vatIdAvailable_yes").checked="";
$("vatIdAvailable_no").checked="checked";
$("vatId_label").removeClassName("important")
}});
var X=documentBody.select("input[type='hidden'][name='vatJSEnabled']")[0];
if(X&&X.value=="true"){var G=documentBody.select("input[type='radio'][name='vatIdAvailable']");
G.invoke("observe","click",function(b){var a=$("locationContactAddressCountry").value;
if(countryIdVatPrefix[a]){if($("vatIdAvailable_no").checked){$("vatId.prefix").selectedIndex=0;
$("vatId.prefix").addClassName("invisible");
$("vatId.prefix.disabled").removeClassName("invisible")
}else{$("vatId.prefix").value=countryIdVatPrefix[a].prefix;
$("vatId.prefix.disabled").addClassName("invisible");
$("vatId.prefix").removeClassName("invisible")
}$("vatId.prefix").removeClassName("error")
}})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="imageAdminList"){mobile.FormHelper.submitOnce($("continue"));
if(mobile.ImageOrderController!==undefined){var H=new mobile.ImageOrderController("sortContainer",{ajaxURL:location.href.replace(/flow.html.*$/,"ajax/fsbo.html")});
Sortable.create("sortContainer",{tag:"div",only:["movable"],onUpdate:H.sortableUpdated.bind(H),onChange:function(){var a=$("sortContainer").select(".movable");
a.each(function(c,b){if(b==0){c.removeClassName("last").addClassName("first")
}else{if(b==a.size()-1){c.removeClassName("first").addClassName("last")
}else{c.removeClassName("first").removeClassName("last")
}}})
}})
}documentBody.select("a.changeImage").invoke("observe","click",function(a){a.stop();
var b=a.element().next();
if(b&&b.id.startsWith("upload")){b.toggle()
}});
if(mobile.BrowserCheck.IE6){new mobile.IE6Hover({handlers:documentBody.select(".imageAdminList .movable"),toggler:".MoveUpArrow",toggleStyles:[{backgroundPosition:"-3px -11px"},{backgroundPosition:"-3px 0"}]});
new mobile.IE6Hover({handlers:documentBody.select(".imageAdminList .movable"),toggler:".MoveDownArrow",toggleStyles:[{backgroundPosition:"-84px -11px"},{backgroundPosition:"-84px 0"}]});
new mobile.IE6Hover({handlers:documentBody.select(".imageAdminList .movable"),toggler:".col-img img",toggleStyles:[{border:"2px solid #ff691f",padding:"0"},{border:"1px solid #d3d1d2",padding:"1px"}]})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="adPreview"){var B=$("captchaForm");
B.observe("submit",function(b){var a=new mobile.Cookie("ad",{path:"/"});
a.unset()
})
}});