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"))
}if($("vehicleDescr")){var b=$("vehicleDescr")
}else{var b=$("ad-enrichedDescription")
}var u=$("wordCounter");
var t=1000;
if(b&&u){u.update(t-b.value.length);
b.observe("keyup",function(){var A=b.value.length;
if(A>=t){b.value=b.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"&&mobile.siteId!="POLAND"&&mobile.siteId!="ROMANIA"){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");
var d=$("nameInvisible");
m.observe("change",function(){if(m.value=="true"){d.mobile_toggle();
$("nameInvisibleCheckbox").checked=false;
o.mobile_toggle();
$("companyName").disabled=false;
$("taxIdNumber").disabled=false;
$("imprint").disabled=false;
f.mobile_toggle();
j.mobile_toggle()
}else{d.mobile_toggle();
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)
}mobile.myLightbox.activateForControl(A)
}
}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.connectMultiSelects("supportContactGender",["billingContactGender","locationContactGender"]);
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.connectMultiTextInputs("locationContactPhonePrefix",["supportContactPhonePrefix","billingContactPhonePrefix"]);
mobile.FormHelper.connectTextInputs("locationContactPhoneNumber","billingContactPhoneNumber");
mobile.FormHelper.connectTextInputs("locationContactPhone2Number","billingContactPhone2Number");
mobile.FormHelper.connectMultiTextInputs("locationContactFaxPrefix",["supportContactFaxPrefix","billingContactFaxPrefix"]);
mobile.FormHelper.connectMultiTextInputs("locationContactFaxNumber",["supportContactFaxNumber","billingContactFaxNumber"]);
mobile.FormHelper.connectMultiTextInputs("locationContactCellPhonePrefix",["supportContactCellPhonePrefix","billingContactCellPhonePrefix"]);
mobile.FormHelper.connectTextInputs("locationContactCellPhoneNumber","billingContactCellPhoneNumber");
mobile.FormHelper.connectTextInputs("supportContactEmail","billingContactEmail");
mobile.FormHelper.connectMultiTextInputs("supportContactFirstName",["locationContactFirstName","billingContactFirstName"]);
mobile.FormHelper.connectMultiTextInputs("supportContactName",["locationContactName","billingContactName"]);
var c=documentBody.select("input[type='radio'][name='differentSupportContact']");
var s=documentBody.select("input[type='radio'][name='differentBillingContact']");
var r=false;
var i=false;
if(c){c.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 a=$("captchaForm");
a.observe("submit",function(B){var A=new mobile.Cookie("ad",{path:"/"});
A.unset()
})
}});