mobile.initializePage("offer",function(){if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="vehicleInsertionCarStart"){var r=$("linkListInsertionStart");
if(r){r.insert({top:new Element("li").update(directInsertLink)})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="vehicleInsertionSelectType"){documentBody.select(".button input").first().observe("click",function(B){if(!typeSelectCheckForm()){B.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)
})
}if($("vehicleDescr")){var c=$("vehicleDescr")
}else{var c=$("ad-enrichedDescription")
}var v=$("wordCounter");
var u=1000;
if(c&&v){v.update(u-c.value.length);
c.observe("keyup",function(){var B=c.value.length;
if(B>=u){c.value=c.value.substring(0,u);
v.update("0")
}else{v.update(u-B)
}})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="vehicleInsertionDetail"&&mobile.siteId!="FRANCE"&&mobile.siteId!="ITALY"&&mobile.siteId!="POLAND"&&mobile.siteId!="ROMANIA"){var x=documentBody.select("input[type='checkbox'][name='price.vatCheckbox']");
if($("price.vatCheckbox").checked){var z=true
}else{var z=false
}if(x){x.invoke("observe","click",function(){if(($("price.vatCheckbox").checked)&&!(z)){$("price.vatRate").mobile_toggle();
z=true
}else{if(($("price.vatCheckbox"))&&z){$("price.vatRate").mobile_toggle();
$("price.vatRate").selectedIndex=0;
z=false
}}})
}}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="contactInsertionData"){var n=$("change-business-status");
var p=$("commercialTipp");
var g=$("commercialBlock");
var k=$("phoneNumber");
var f=$("nameInvisible");
n.observe("change",function(){if(n.value=="true"){f.mobile_toggle();
$("nameInvisibleCheckbox").checked=false;
p.mobile_toggle();
$("companyName").disabled=false;
$("taxIdNumber").disabled=false;
$("imprint").disabled=false;
g.mobile_toggle();
k.mobile_toggle()
}else{f.mobile_toggle();
p.mobile_toggle();
$("companyName").disabled=true;
$("taxIdNumber").disabled=true;
$("imprint").disabled=true;
g.mobile_toggle();
k.mobile_toggle()
}})
}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="contactInsertionData"){var w=$("loginBox");
var q=$("dataBox");
var m=documentBody.select("#loginBox .register-now .button").first();
if(w&&q&&m){m.observe("click",function(){q.setStyle({display:"block"});
w.hide();
var B=documentBody.select(".reloadLink");
B.invoke("setStyle",{display:"block"});
var C=documentBody.select(".backLink");
C.invoke("setStyle",{display:"none"})
})
}mobile.FormHelper.connectSelects("countrySelect","primaryNumberCountryId")
}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="bundleSelectionEnterData"){var o=documentBody.down("div.progressBar");
if(o){var l=documentBody.select("form input[type='radio']");
l.invoke("observe","click",function(B){var C=o.down("li#pay");
if(this.id=="BASIS"){C.setStyle({display:"none"});
o.down("ul").setStyle({width:"624px"})
}else{C.setStyle({display:"block"});
o.down("ul").setStyle({width:"728px"})
}})
}var e=documentBody.select(".cols3 .col ul");
if(e&&e.size()>0){e.invoke("observe","click",function(C){C.stop();
var B=C.element();
if(B){mobile.openInfoLightbox(B)
}})
}mobile.openInfoLightbox=function(B){if(mobile.myLightbox==undefined){mobile.myLightbox=new lightbox(B)
}mobile.myLightbox.activateForControl(B)
}
}if(mobile.PageParams.pageName&&mobile.PageParams.pageName=="paymentEnterData"){var A=documentBody.select("form fieldset");
if(A&&A.size()>0){A.invoke("observe","click",function(){var B=this.down("input[type='radio']");
if(B){B.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 d=documentBody.select("input[type='radio'][name='differentSupportContact']");
var t=documentBody.select("input[type='radio'][name='differentBillingContact']");
var s=false;
var j=false;
if(d){d.invoke("observe","click",function(){if(($("differentSupportContact_yes").checked)&&!(s)){$("altSupportContact").mobile_toggle();
s=true
}else{if(($("differentSupportContact_no").checked)&&s){$("altSupportContact").mobile_toggle();
s=false
}}})
}if(t){t.invoke("observe","click",function(){if(($("differentBillingContact_yes").checked)&&!(j)){$("altBillingContact").mobile_toggle();
j=true
}else{if(($("differentBillingContact_no").checked)&&j){$("altBillingContact").mobile_toggle();
j=false
}}})
}documentBody.select(".make-select select").invoke("observe","change",function(C){var B=C.element().up(".make-select").next();
if(B){B.removeClassName("hiddenBox")
}});
documentBody.select("#locationContactAddressCountry").invoke("observe","change",function(C){var B=$F(C.element());
if(countryIdVatPrefix[B]){$A($("vatId.prefix").options).each(function(D){if(D.value===countryIdVatPrefix[B].prefix){$("vatId.prefix").selectedIndex=D.index
}});
if(countryIdVatPrefix[B].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 y=documentBody.select("input[type='hidden'][name='vatJSEnabled']")[0];
if(y&&y.value=="true"){var h=documentBody.select("input[type='radio'][name='vatIdAvailable']");
h.invoke("observe","click",function(C){var B=$("locationContactAddressCountry").value;
if(countryIdVatPrefix[B]){if($("vatIdAvailable_no").checked){$("vatId.prefix").selectedIndex=0;
$("vatId.prefix").addClassName("invisible");
$("vatId.prefix.disabled").removeClassName("invisible")
}else{$("vatId.prefix").value=countryIdVatPrefix[B].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 i=new mobile.ImageOrderController("sortContainer",{ajaxURL:location.href.replace(/flow.html.*$/,"ajax/fsbo.html")});
Sortable.create("sortContainer",{tag:"div",only:["movable"],onUpdate:i.sortableUpdated.bind(i),onChange:function(){var B=$("sortContainer").select(".movable");
B.each(function(D,C){if(C==0){D.removeClassName("last").addClassName("first")
}else{if(C==B.size()-1){D.removeClassName("first").addClassName("last")
}else{D.removeClassName("first").removeClassName("last")
}}})
}})
}documentBody.select("a.changeImage").invoke("observe","click",function(B){B.stop();
var C=B.element().next();
if(C&&C.id.startsWith("upload")){C.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(C){var B=new mobile.Cookie("ad",{path:"/"});
B.unset()
})
}});