var userInfo=userInfo||null;var form_utils={currentPage:"gaq",curSubPage:"",curVehicle:"brand",curPreference:"phone",family:getParameter("family"),model:getParameter("model"),model_year:getParameter("year"),zip_code:getParameter("zip"),selectedDealer:getParameter("dealer_id"),stockNumber:getParameter("stock_number"),vin:getParameter("vin"),app:getParameter("app"),target:getParameter("target"),gaqErrorSlide:"",selected_vehicle:"",tempDomain:"",argMonth:"",argDay:"",monthDays:new Array(12),monthIdx:new Array(12),hrefLocation:location.href.toLowerCase(),userKey:"",jsonRequest:"",submitForm:function(a){this.setFormValidationRequirements(a);var b=form_validation.validate(a,"form_errors",this.target);linkTrack("application_form",document.forms.application.action_name.value);if(b){if(document.forms.application.additional_requests.value=="Enter your preferences for color, engine and any options here. Or type a message to your selected dealer."||document.forms.application.additional_requests.value=="Write a message to your dealer here."){document.forms.application.additional_requests.value="";}document.forms.application.additional_requests.value=document.forms.application.additional_requests.value.replace(/\r|\n/g," ");return true;}else{return false;}},makeTips:function(d,c,a){if(window.ie6||navigator.appVersion.indexOf("Mac")!=-1){var b=new Tips($$(c),{className:a,offsets:d});}else{var b=new Tips($$(c),{className:a,offsets:d,initialize:function(){this.fx=new Fx.Style(this.toolTip,"opacity",{duration:500,wait:false}).set(0);},onShow:function(e){this.fx.start(1);},onHide:function(e){this.fx.start(0);}});}},newAccordion:function(a){this.content=[];this.togglers=[];},initAccordion:function(name,content_selector,toggler_selector,argShow,argAlwaysHide,myFunction){argShow=argShow?0:-1;argAlwaysHide=argAlwaysHide||false;myFunction=myFunction||function(){};if(typeof(accordions)!="object"){accordions=[];}accordions[name]=new this.newAccordion();acc=accordions[name];acc.content=$$(content_selector);acc.content.each(function(item){item.setStyles({height:"0",overflow:"hidden"});});acc.togglers=$$(toggler_selector);this.setTogglerEvents(name,acc.togglers);acc.myAccordion=new Fx.Accordion(acc.togglers,acc.content,{display:argShow,alwaysHide:argAlwaysHide,opacity:false,start:false,transition:Fx.Transitions.quadOut,wait:false,onComplete:eval(myFunction)});},setTogglerEvents:function(a,c){var b="";if(a=="user_info"){if(b==""){b=$("contact_information").getFirst();}acc.togglers.each(function(d){d.addEvent("click",function(){if(this!=b){d.getFirst().setStyle("display","none");d.removeClass("infoTogglerClosed");if(b){b.getFirst().setStyle("display","inline");b.addClass("infoTogglerClosed");}}else{d.getFirst().setStyle("display","inline");d.addClass("infoTogglerClosed");if(b){b.getFirst().setStyle("display","none");b.removeClass("infoTogglerClosed");}}b=this;});});}},phoneTab:function(a){if(a.name!="phoneLineNumber"){if(a.value&&a.value.length==a.getAttribute("maxlength")){$(a).getNext("input").focus();}}else{if((a.value&&a.value.length==a.getAttribute("maxlength"))&&$("form_email").getStyle("display")!="none"){$("form_email").getLast().getFirst().focus();}}},textAreaClear:function(c){var b="Enter your preferences for color, engine and any options here. Or type a message to your selected dealer.";var a="Write a message to your dealer here.";if(c.value==b||c.value==a){c.value="";}},textAreaLimit:function(b){var a=$(b).getProperty("maxLength");if(parseInt(b.value.length)>parseInt(a)*1){b.value=b.value.substring(0,parseInt(a)*1);$("countLimitMessage").setHTML("500 character limit reached.");}else{$("countLimitMessage").setHTML("<br />");}},setPreferenceValidation:function(a){if(this.curPreference){$("form_"+form_utils.curPreference).getFirst().getFirst().setStyle("visibility","hidden");}$("form_"+a).getFirst().getFirst().setStyle("visibility","visible");this.curPreference=a;},setEmailPreference:function(a){$("option_1").setAttribute("checked",true);this.setPreferenceValidation("email");},addressLine:function(a){if(a.value&&a.value.length==a.getAttribute("maxlength")){$("form_address_2").setStyle("display","block");}},setForm:function(){var d=Math.random()+"";this.userKey=Math.round(d*10000000000000);if(this.hrefLocation.search("gaq")!=-1&&this.target==""){this.target="gaq";this.currentPage="gaq";}else{if(this.hrefLocation.search("satd")!=-1&&(this.target==""||this.target=="testdrive")){this.target="satd";this.currentPage="satd";}}if(this.app=="preownedinventory"){this.app="cpov";}else{if(this.app=="newinventory"){this.app="sni";}else{if(this.app=="priceequip"){this.app="bmo";}}}if(this.zip_code){document.forms.application.zipcode.value=this.zip_code;document.findDealer.zipcode.value=this.zip_code;dealerConnector.zip=this.zip_code;}var f="/hostb/leadbroker/leadbrokercontroller";f="https://"+document.domain+f;document.application.action=f;if(this.target=="gaq"){if(brand_id=="ramtrucks"){$("header_title").getFirst().setHTML("Get a Quote");$("form_message").setHTML('Complete the areas below so that your selected dealer can offer you a vehicle quote. Your dealer will contact you within one business day. It is important that we receive accurate information, or your dealer may not be able to reach you. Thank you for your interest. Required fields are marked with the symbol <span class="required_color">**</span>.');}if(brand_id=="jeep"){$("header_title").getFirst().setHTML("Get a Quote");$("form_message").setHTML('Complete the areas below so that your selected dealer can offer you a vehicle quote. Your dealer will contact you with your quote within one business day. It is important that we receive accurate information, or your dealer may not be able to reach you. Thank you for your interest. Required fields are marked with an <span class="required_color">**</span>.');}else{if(brand_id=="chrysler"||brand_id=="dodge"){$("header_title").getFirst().setHTML("Get a Quote");$("form_message").setHTML('Complete the areas below so that your selected dealer can offer you a vehicle quote. Your dealer will contact you with your quote within one business day. It is important that we receive accurate information, or your dealer may not be able to reach you. Thank you for your interest. Required fields are marked with an <span class="required_color">*</span>.');}}$("contact_information").getFirst().getFirst().setStyle("display","none");$("trade_information").getFirst().addClass("infoTogglerClosed");$("satd_schedule_time").setStyle("display","none");this.initAccordion("user_info","div.infoAccordion","h1.infoToggler",true,false);document.forms.application.action_name.value="submitgaq";this.currentPage="gaq";}else{if(this.target=="satd"){if(brand_id=="ramtrucks"){$("header_title").getFirst().setHTML("Schedule a Test Drive");$("form_message").setHTML('Complete the areas below so that your selected dealer can prepare for your test drive. Your dealer will contact you within one business day. It is important that you provide accurate information, or your dealer may not be able to reach you. Thank you for your interest. Required fields are marked with the symbol <span class="required_color">**</span>.');}if(brand_id=="jeep"){$("header_title").getFirst().setHTML("Schedule a Test Drive");$("form_message").setHTML('We&#39;re pretty proud of our trucks and would love for you to test one out for yourself. We think you&#39;d love it. But don&#39;t take our word for it. Please complete the areas below so that your selected dealer can prepare for your test drive. Your dealer will contact you within one business day. It is important that you provide accurate information, or your dealer may not be able to reach you. Thank you for your interest. Required fields are marked with the symbol <span class="required_color">**</span>.');}else{if(brand_id=="chrysler"||brand_id=="dodge"){$("header_title").getFirst().setHTML("Schedule a Test Drive");$("form_message").setHTML('We&#39;re pretty proud of our trucks and would love for you to test one out for yourself. We think you&#39;d love it. But don&#39;t take our word for it. Please complete the areas below so that your selected dealer can prepare for your test drive. Your dealer will contact you within one business day. It is important that you provide accurate information, or your dealer may not be able to reach you. Thank you for your interest. Required fields are marked with the symbol <span class="required_color">*</span>.');}}$("trade_information").setStyle("display","none");$$(".form_height_holder").setStyle("height","373px");$$(".infoToggler_message").setStyle("display","none");this.scheduleMonthFields();document.forms.application.action_name.value="submitsatd";this.currentPage="satd";}}if(this.app!="bmo"&&this.app!="sni"&&this.app!="cpov"){if(this.target=="gaq"){$("form_preferred_dealer_quote").getFirst().clone().inject($("form_vehicle_selector").getLast(),"inside");}else{if(this.target=="satd"){$("form_preferred_dealer_testdrive").getFirst().clone().inject($("form_vehicle_selector").getLast(),"inside");}}$("form_vehicle_selector").getLast().getFirst().setProperty("tabindex","1");$("form_vehicle_selector").getLast().getFirst().removeClass("menu_select_field");var m=$$("#form_vehicle_selector .vehGroup option");if(this.model_year&&this.family){if((this.target=="gaq"&&vehicle_data[this.model_year][this.family].flags.get_a_quote==true)||(this.target=="satd"&&vehicle_data[this.model_year][this.family].flags.testdrive==true)){this.selected_vehicle=this.model_year+this.family;}}for(var e=0;e<m.length;e++){if(m[e].value==this.selected_vehicle){m[e].selected="selected";}}document.forms.application.vehicle.addEvent("change",form_utils.setVehicle);if(this.selected_vehicle){document.forms.application.vehicle.value=this.selected_vehicle;this.setVehicle();}this.showForm();}else{if(this.app=="bmo"){jQuery("#dealer_message_edit a").css("display","none");var c=Cookie.get("autodata.bmostate");if(c){var k=unescape(c);var h=Json.evaluate(k);var a="/hostd/getconfigvehiclesummary.xml?ccode="+h.cCode+"&llpCode="+h.llpCode+"&stateString="+h.stateString;var l=new Ajax(a,{method:"get",onComplete:function(o,n){form_utils.setBMOvehicle(o,n);}.bind(this),onFailure:function(n){form_utils.appDown();}.bind(this)});l.request.delay(200,l);}else{this.appDown();}document.forms.application.action_name.value=document.forms.application.action_name.value+"bmo";}else{if(this.app=="sni"||this.app=="cpov"){var b="/hostd/getinventorydetail.json?dealerCode="+this.selectedDealer+"&inventoryStockNumber="+this.stockNumber+"&vin="+this.vin;var g=new Json.Remote(b,{method:"get",onComplete:function(n){form_utils.setInventoryVehicle(n);},onFailure:function(){form_utils.appDown();}}).send();if(this.app=="cpov"){document.forms.application.action_name.value=document.forms.application.action_name.value+"cpov";}else{if(this.app=="sni"){document.forms.application.action_name.value=document.forms.application.action_name.value+"sni";}}}}}this.gaqErrorSlide=new Fx.Slide("form_errors",{duration:500,wait:false});this.gaqErrorSlide.slideOut();this.dealerErrorSlide=new Fx.Slide("dealer_form_errors",{duration:500,wait:false});this.dealerErrorSlide.slideOut();dealerConnector.setDealerLocator();if(this.hrefLocation.search("iwov-prod")!=-1){if(this.hrefLocation.search("chrysler")!=-1){this.tempDomain="http://iwov-prod.organic.com/iw/cci/meta/no-injection/iw-mount/default/main/US/Chrysler/us/en/working/WORKAREA/ognc_det/htdocs";}else{if(this.hrefLocation.search("dodge")!=-1){this.tempDomain="http://iwov-prod.organic.com/iw/cci/meta/no-injection/iw-mount/default/main/US/Dodge/us/en/working/WORKAREA/ognc_det/htdocs";}else{if(this.hrefLocation.search("jeep")!=-1){this.tempDomain="http://iwov-prod.organic.com/iw/cci/meta/no-injection/iw-mount/default/main/US/Jeep/us/en/working/WORKAREA/ognc_det/htdocs";}}}}if(this.family&&this.model_year){document.forms.application.thankyou_page.value=this.tempDomain+"/en/"+this.target+"/thankyou.html?family="+this.family+"&year="+this.model_year+"&app="+this.app+"&target="+this.target+"&zip="+this.zip_code;document.forms.application.error_page.value=this.tempDomain+"/en/"+this.target+"/error.html?family="+this.family+"&year="+this.model_year+"&app="+this.app+"&target="+this.target+"&zip="+this.zip_code;}else{document.forms.application.thankyou_page.value=this.tempDomain+"/en/"+this.target+"/thankyou.html";document.forms.application.error_page.value=this.tempDomain+"/en/"+this.target+"/error.html";}document.forms.application.preference[0].checked=true;if(userInfo){this.preFillForm();}else{this.setEmailPreference();}},appDown:function(){window.location.replace("/en/"+this.target+"/error.html?family="+this.family+"&year="+this.model_year+"&app="+this.app+"&target="+this.target+"&dealer_id="+this.selectedDealer+"&error_code=service");return false;},setBMOvehicle:function(p,h){var c=h.getElementsByTagName("VEHICLE")[1];var f=c.getAttribute("VARIATION")+" "+c.getAttribute("TRIM");var g=c.getAttribute("YEAR")+" "+c.getAttribute("MODEL");var k=h.getElementsByTagName("MSRP")[2].getAttribute("BASE");var d=Cookie.get("autodata.bmostate");var o=Json.evaluate(unescape(d));var l='<input type="hidden" name="cookie_id" value="'+this.userKey+'"/><input type="hidden" name="vehicle" value="'+g+'"/>';var e="<strong>"+g+"</strong>";$("form_vehicle_selector").getFirst().setHTML("Vehicle ");$("form_vehicle_selector").getFirst().setStyle("padding-right","8px");$("form_vehicle_selector").getLast().setHTML(e+l);$("form_vehicle_selector").getLast().setStyle("font-size","11px");var m="/shared/images/application/vehicles/default.png";$("vehicle_image").setHTML('<img src="'+m+'"/>');if(f){var a='<input type="hidden" name="model" value="'+f+'"/>';var b="<strong>"+f+"</strong>";$("form_model_selector").getLast().setHTML(b+a);$("form_model_selector").getLast().setStyle("font-size","11px");$("form_model_selector").setStyle("display","block");}var n='<span class="input_container"><a>View Vehicle Summary</a></span>';new Element("div",{id:"form_vehicle_summary","class":"form_field"}).injectAfter("form_model_selector").setHTML(n);$("form_vehicle_summary").onclick=function(){linkTrack("application_form","view_vehicle_summary");var q="/bridge/index.html?app=summary&cookie_id="+form_utils.userKey;window.open(q,"_blank","height=900, width=825, status=0, menubar=0, scrollbars=yes, toolbar=0");};document.forms.application.additional_requests.value="Write a message to your dealer here.";if(k){}this.showForm();},setInventoryVehicle:function(d){var l=d[0]["result"];if(l=="ERROR"){this.appDown();}else{var m=d[0]["data"]["inventoryVehicle"]["description"];var f=d[0]["data"]["inventoryVehicle"]["yearDescription"]+" "+d[0]["data"]["inventoryVehicle"]["modelDescription"];var q=d[0]["data"]["inventoryVehicle"]["MSRP"];var g=d[0]["data"]["inventoryVehicle"]["vin"];var o=d[0]["data"]["inventoryVehicle"]["numberOfImages"];var t=d[0]["data"]["inventoryVehicle"]["extImage"];var c="";var s="";if(this.app=="sni"){if(t){c=t.split("\\");}}else{if(this.app=="cpov"){if(o!="0"){c=d[0]["data"]["inventoryImages"][0]["name"];}}}var e="";var p='<input type="hidden" name="stock_number" value="'+this.stockNumber+'"/><input type="hidden" name="vin" value="'+this.vin+'"/><input type="hidden" name="vehicle" value="'+f+'"/>';var n="<strong>"+f+"</strong>";$("form_vehicle_selector").getFirst().setHTML("Vehicle ");$("form_vehicle_selector").getFirst().setStyle("padding-right","8px");$("form_vehicle_selector").getLast().setHTML(n+p);$("form_vehicle_selector").getLast().setStyle("font-size","11px");if(this.app=="sni"){e="&width=285&height=177&NOIMG=CC_NOIMAGE_W.jpg";}if(c){if(this.app=="sni"){c=c[0]+"\\"+c[1];s="http://images.ascchus.com/?IMG=EAL_IMAGES\\"+c+e;}else{if(this.app=="cpov"){s="http://"+c.split("http://")[1];$("vehicle_image").setStyle("width","auto");$("vehicle_image").setStyle("text-align","center");$("photo_disclaimer").setStyle("display","none");}}}new Asset.images(s,{onComplete:function(){$("vehicle_image").setHTML('<img src="'+s+'"/>');if(form_utils.app=="cpov"){$("vehicle_image").getFirst().setProperty("height","214");$("vehicle_image").getFirst().setProperty("width","285");}},onFailure:function(u){$("vehicle_image").setHTML('<img src="/shared/images/application/vehicles/default.png"/>');}});if(m){var h='<input type="hidden" name="model" value="'+m+'"/>';var b="<strong>"+m+"</strong>";$("form_model_selector").getLast().setHTML(b+h);$("form_model_selector").getLast().setStyle("font-size","11px");$("form_model_selector").setStyle("display","block");}if(this.app=="sni"){var k='<span class="input_container"><a href="/bridge/index.html?app=sticker&vin='+g+'" target="_new">View Window Sticker</a></span>';var r='<span class="input_name">VIN</span>';var a='<span class="input_container"><strong>'+g+"</strong></span>";new Element("div",{id:"form_vehicle_vin","class":"form_field"}).injectAfter("form_model_selector").setHTML(r+a).setStyle("font-size","11px");new Element("div",{id:"form_vehicle_summary","class":"form_field"}).injectAfter("form_vehicle_vin").setHTML(k);$("form_vehicle_summary").onclick=function(){linkTrack("application_form","view_window_sticker");};}else{if("cpov"){var k='<span class="input_container"><a href="/bridge/index.html?app=cpovdetail&dealerid='+this.selectedDealer+"&stock_number="+this.stockNumber+'" target="_new">Photos and Vehicle Features</a></span>';new Element("div",{id:"form_vehicle_summary","class":"form_field"}).injectAfter("form_model_selector").setHTML(k);$("form_vehicle_summary").onclick=function(){linkTrack("application_form","photos_and_vehicle_features");};}}document.forms.application.additional_requests.value="Write a message to your dealer here.";if(q){}this.showForm();}},setPrice:function(b){var c="";b+="";x=b.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var a=/(\d+)(\d{3})/;while(a.test(x1)){x1=x1.replace(a,"$1,$2");}b=x1;new Element("div",{id:"form_vehicle_price","class":"form_field"}).injectAfter("form_additional_requests").setHTML(c);},scheduleMonthFields:function(){var a=new Date();this.argMonth=a.getMonth(),this.argDay=a.getDate(),this.monthDays[0]=31;this.monthIdx[0]="Jan";this.monthDays[1]=28;this.monthIdx[1]="Feb";this.monthDays[2]=31;this.monthIdx[2]="Mar";this.monthDays[3]=30;this.monthIdx[3]="Apr";this.monthDays[4]=31;this.monthIdx[4]="May";this.monthDays[5]=30;this.monthIdx[5]="Jun";this.monthDays[6]=31;this.monthIdx[6]="Jul";this.monthDays[7]=31;this.monthIdx[7]="Aug";this.monthDays[8]=30;this.monthIdx[8]="Sep";this.monthDays[9]=31;this.monthIdx[9]="Oct";this.monthDays[10]=30;this.monthIdx[10]="Nov";this.monthDays[11]=31;this.monthIdx[11]="Dec";for(i=0;i<=2;i++){if((this.argMonth+i)<=11){document.forms.application.scheduledMonth[i]=new Option(this.monthIdx[this.argMonth+i],this.monthIdx[this.argMonth+i]);}else{if((this.argMonth+i)==12){document.forms.application.scheduledMonth[i]=new Option(this.monthIdx[0],this.monthIdx[0]);}else{if((this.argMonth+i)==13){document.forms.application.scheduledMonth[i]=new Option(this.monthIdx[1],this.monthIdx[1]);}}}}$("scheduledMonth").addEvent("change",form_utils.upDateDays);this.upDateDays();},upDateDays:function(){var b=document.forms.application.scheduledMonth.value;var a=0;$("scheduledDayList").empty();if(b==form_utils.monthIdx[form_utils.argMonth]){for(j=form_utils.argDay;j<=form_utils.monthDays[form_utils.argMonth];j++){document.forms.application.scheduledDayList[a]=new Option(j,j);a++;}}else{for(j=1;j<=form_utils.monthDays[form_utils.argMonth];j++){document.forms.application.scheduledDayList[a]=new Option(j,j);a++;}}},preFillForm:function(){if(userInfo.zipcode!=""){var a=userInfo.vehicle.substring(4);if(a==this.family){document.forms.application.vehicle.value=userInfo.vehicle;this.setVehicle();if(userInfo.model){document.forms.application.model.value=userInfo.model;this.setModel();}if(userInfo.poi){document.forms.application.poi.value=userInfo.poi;}if(userInfo.additional_requests){document.forms.application.additional_requests.value=userInfo.additional_requests;}}document.forms.application.first_name.value=userInfo.first_name;document.forms.application.last_name.value=userInfo.last_name;document.forms.application.address_1.value=userInfo.address_1;document.forms.application.address_2.value=userInfo.address_2;document.forms.application.city.value=userInfo.city;document.forms.application.state.value=userInfo.state;if(userInfo.address_2){$("form_address_2").setStyle("display","block");}if(this.zip_code){document.forms.application.zipcode.value=this.zip_code;document.findDealer.zipcode.value=this.zip_code;dealerConnector.zip=this.zip_code;}else{if(userInfo.zipcode){document.forms.application.zipcode.value=userInfo.zipcode;document.findDealer.zipcode.value=userInfo.zipcode;dealerConnector.zip=userInfo.zipcode;}}var b=document.forms.application.preference;var c=b.length;if(userInfo.preference.toString()=="Day Phone"){b[1].checked=true;form_utils.setPreferenceValidation("phone");}else{b[0].checked=true;form_utils.setPreferenceValidation("email");}document.forms.application.areaCode.value=userInfo.areaCode;document.forms.application.phonePrefix.value=userInfo.phonePrefix;document.forms.application.phoneLineNumber.value=userInfo.phoneLineNumber;document.forms.application.email.value=userInfo.email;if(this.target=="gaq"){document.forms.application.trade_in_make.value=userInfo.trade_in_make;document.forms.application.trade_in_model.value=userInfo.trade_in_model;document.forms.application.trade_in_year.value=userInfo.trade_in_year;document.forms.application.trade_in_mileage.value=userInfo.trade_in_mileage;}else{if(this.target=="satd"){if(userInfo.scheduledMonth!="null"){document.forms.application.scheduledMonth.value=userInfo.scheduledMonth;}if(userInfo.scheduledDayList!="null"){document.forms.application.scheduledDayList.value=userInfo.scheduledDayList;}if(userInfo.scheduledSession!="null"){document.forms.application.scheduledSession.value=userInfo.scheduledSession;}}}}},showForm:function(){$("vehicle_selection").setStyle("visibility","visible");$("your_information").setStyle("visibility","visible");$("dealer_information").setStyle("visibility","visible");$("form_submit").setStyle("visibility","visible");this.setFormValidationRequirements(document.forms.application);},setVehicle:function(){var e=document.forms.application.vehicle.value.substring(0,4);var l=document.forms.application.vehicle.value.substring(4);if(l){var g=vehicle_data[e][l].display;document.forms.application.vehicle_name.value=g;var o=vehicle_data[e][l].vehicle_poi;document.forms.application.poi.value=o;}document.forms.application.thankyou_page.value=form_utils.tempDomain+"/en/"+form_utils.target+"/thankyou.html?family="+l+"&year="+e+"&app="+form_utils.app+"&target="+form_utils.target+"&zip="+form_utils.zip_code;document.forms.application.error_page.value=form_utils.tempDomain+"/en/"+form_utils.target+"/error.html?family="+l+"&year="+e+"&app="+form_utils.app+"&target="+form_utils.target+"&zip="+form_utils.zip_code;if(vehicle_data[e]){if(brand_id=="jeep"){var m="/shared/images/application/vehicles/default.png";}else{m="/shared/images/application/vehicles/"+e+l+".png";}new Asset.images(m,{onComplete:function(){if(brand_id=="dodge"){$("vehicle_image").setStyle("right","0px");}$("vehicle_image").setHTML('<img src="'+m+'"/>');}});form_utils.selected_vehicle=document.forms.application.vehicle.value;var b=vehicle_data[e][l].models;var n='<option value="">Select a Model</option>';var p=1;$("model").empty();document.forms.application.model[0]=new Option("Select a Model","");for(_m in b){document.forms.application.model[p]=new Option(b[_m],_m);p++;}document.forms.application.model.addEvent("change",form_utils.setModel);$("form_model_selector").setStyle("display","block");if(window.ie6){iePngFix();}}else{if(brand_id=="dodge"){$("vehicle_image").setStyle("right","28px");m="/shared/images/application/vehicles/default.png";Asset.images(m,{onComplete:function(){$("vehicle_image").setHTML('<img src="'+m+'"/>');}});$("form_model_selector").setStyle("display","none");}}var h=document.findDealer;var d=h.zipcode.value;var k=h.city.value;var c=h.state.value;var a=h.dealername.value;if(form_utils.selected_vehicle&&(d||a||(k&&c))){if(!form_utils.selectedDealer&&!form_utils.family){try{if(brand!="jeep"&&typeof(gwoObj)!="object"){dealerConnector.submitFindDealer(document.findDealer);}}catch(f){}}}},setModel:function(){var d=document.forms.application.model.value;var f=document.forms.application.vehicle.value.substring(0,4);var e=document.forms.application.vehicle.value.substring(4);var a=vehicle_data[f][e].vehicle_poi;var b=vehicle_data[f][e].models;var c=vehicle_data[f][e].models_poi;if(d){document.forms.application.model_name.value=b[d];document.forms.application.poi.value=c[d];}else{document.forms.application.model_name.value=" ";document.forms.application.poi.value=a;}},setFormValidationRequirements:function(a){a.vehicle.required="Vehicle";a.vehicle.subtype="vehicle";a.first_name.required="First Name";a.last_name.required="Last Name";a.address_1.required="Address";if(brand=="jeep"&&typeof(gwo_test_csz)!="undefined"){if(gwo_test_csz=="cs"){a.city.required="City";a.state.required="State";}else{if(gwo_test_csz=="z"){a.zipcode.required="ZIP";}else{a.city.required="City";a.state.required="State";a.zipcode.required="ZIP";}}}else{a.city.required="City";a.state.required="State";a.zipcode.required="ZIP";}if(this.curPreference=="email"){a.email.required="Email";a.areaCode.required="";a.phonePrefix.required="";a.phoneLineNumber.required="";}else{if(this.curPreference=="phone"){a.areaCode.required="Phone Area Code";a.phonePrefix.required="Phone Prefix";a.phoneLineNumber.required="Phone Line Number";a.email.required="";}}a.address_2.label="Address 2/Suite";a.address_2.subtype="alphaNum";a.zipcode.label="ZIP";a.zipcode.subtype="zipcode";a.email.label="Email";a.email.subtype="email";a.address_1.label="Address";a.address_1.subtype="alphaNum";a.areaCode.label="Phone Area Code";a.areaCode.subtype="areaCode";a.phonePrefix.label="Phone Prefix";a.phonePrefix.subtype="phonePrefix";a.phoneLineNumber.label="Phone Line Number";a.phoneLineNumber.subtype="phoneLineNumber";a.trade_in_make.label="Trade-In Make";a.trade_in_make.subtype="alphaNum";a.trade_in_model.label="Trade-In Model";a.trade_in_model.subtype="alphaNum";a.trade_in_year.label="Trade-In Year";a.trade_in_year.subtype="validYear";a.trade_in_mileage.label="Trade-In Mileage";a.trade_in_mileage.subtype="validMileage";return true;}};onload_register("form_utils.setForm()");onload_register('form_utils.initAccordion("advanced_search","#advanced_search_container","#advance_search_button", false, true)');
