function MakeChanged_Quote(c,e,f){e=document.getElementById(e.id);if(c.options[c.selectedIndex].text=="--Select Make--"){e.disabled=true}else{for(j=e.length;j>=0;j--){e.options[j]=null}e.options[0]=new Option("Loading...","Loading...");e.disabled=true;var d=c.value;var b=document.getElementById("hdnUrl").value;b=b+"web/ajax/MakeModelListCtrl.Ajax.aspx?from=make&makeId="+d+"&method=ReturnStep2EnabledModels&isReturnEnabled="+f;var a=document.getElementById("hdnBrowser").value;CallMyServer_Quote(b,FillModelDropDown_Quote,a);document.getElementById(e.id).disabled=false}}function ModelChanged_Quote(d){ResetDropDowns_Quote("MODEL");var c=d.value;var b=document.getElementById("hdnUrl").value;b=b+"web/ajax/MakeModelListCtrl.Ajax.aspx?from=model&modelId="+c;var a=document.getElementById("hdnBrowser").value}function MakeChangedAsync_Quote(c){ResetDropDowns_Quote("MAKE");var d=c.value;var b=document.getElementById("hdnUrl").value;b=b+"web/ajax/MakeModelListCtrl.Ajax.aspx?from=make&makeId="+d;var a=document.getElementById("hdnBrowser").value;CallMyServer_Quote(b,FillModelDropDown_Quote,a)}function ModelChangedAsync_Quote(d){ResetDropDowns_Quote("MODEL");var c=d.value;var b=document.getElementById("hdnUrl").value;b=b+"web/ajax/MakeModelListCtrl.Ajax.aspx?from=model&modelId="+c;var a=document.getElementById("hdnBrowser").value;CallMyServer_Quote(b,FillTrimDropDown_Quote,a)}function ResetDropDowns_Quote(a){var b=document.getElementById(document.getElementById("hdnMake_Quote").value);var c=document.getElementById(document.getElementById("hdnModel_Quote").value)}function EnableControl_Quote(b,a){b.disabled=!a;b.options.length=0;var c="--Select--";if(b.id.indexOf(document.getElementById("hdnMake_Quote").value)!=-1){c="--Select Make--"}else{if(b.id.indexOf(document.getElementById("hdnModel_Quote").value)!=-1){c="--Select Model--"}}b.options.add(new Option(c,""))}var httpRequest=false;function CallMyServer_Quote(b,c,a){if(window.XMLHttpRequest){httpRequest=new XMLHttpRequest();if(httpRequest.overrideMimeType){httpRequest.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{httpRequest=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{httpRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}}}if(!httpRequest){}httpRequest.onreadystatechange=c;if(a=="IE"){httpRequest.open("POST",b,true)}else{httpRequest.open("GET",b,true)}httpRequest.send(null)}function CallServerSync_Quote(b,c,a){if(window.XMLHttpRequest){httpRequest=new XMLHttpRequest();if(httpRequest.overrideMimeType){httpRequest.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{httpRequest=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{httpRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}}}if(a=="IE"){httpRequest.open("POST",b,true)}else{httpRequest.open("GET",b,true)}httpRequest.send(null)}function FillMakeDropDown_Quote(){if(httpRequest.readyState==4){if(httpRequest.status==200){var e=httpRequest.responseText;var d=document.getElementById(document.getElementById("hdnMake_Quote").value);d.disabled=false;d.options.length=0;d.options.add(new Option("--Select Make--",""));if(e!=null&&e!=""){var a=e.split("|");for(var b=0;b<a.length;b++){var c=a[b].split("@");d.options.add(new Option(c[1],c[0]))}}}}}function FillModelDropDown_Quote(){if(httpRequest.readyState==4){if(httpRequest.status==200){var e=httpRequest.responseText;var d=document.getElementById(document.getElementById("hdnModel_Quote").value);d.options.length=0;d.options.add(new Option("--Select Model--",""));if(e!=null&&e!=""){var a=e.split("|");for(var b=0;b<a.length;b++){var c=a[b].split("@");d.options.add(new Option(c[1],c[0]))}}}}}function BottomupFillUp_Quote(a){if(a==null||a==""||a=="0"){return}var c=document.getElementById("hdnUrl").value;c=c+"web/ajax/MakeModelListCtrl.Ajax.aspx?from=trim&carId="+a;var b=document.getElementById("hdnBrowser").value;CallMyServer_Quote(c,BottomupFillUpResponse_Quote,b)}function BottomupFillUpResponse_Quote(){if(httpRequest.readyState==4){if(httpRequest.status==200){var n=httpRequest.responseText;var g=n.split("@");var i=g[0];var e=g[1];var a=g[2];var m=g[3];var f=g[4];var d=g[5];var k=document.getElementById(document.getElementById("hdnTrim").value);var b=document.getElementById(document.getElementById("hdnModel_Quote").value);var h=document.getElementById(document.getElementById("hdnMake_Quote").value);var c=document.getElementById(document.getElementById("hdnYear").value);var l=document.getElementById("hdnCarId");c.value=i;YearChangedAsync_Quote(c);FillMakeDropDown_Quote();h.value=e;MakeChangedAsync_Quote(h);FillModelDropDown_Quote();b.value=m;ModelChangedAsync_Quote(b);FillTrimDropDown_Quote();k.value=l.value}}}function EnterKeyValidateMakeModelRedirect(f,h,c,i,g,b,a){if(!f){f=window.event||event}var d=f.keyCode?f.keyCode:f.which;if(d==13){return ValidateMakeModelRedirect(h,c,i,g,b,a)}}function ValidateMakeModelRedirect(e,c,f,d,b,a){if(f.value=="0"){alert("Make not selected");f.focus();return false}else{if(d.length<1){alert("Model not selected");d.focus();return false}else{if(d.options[d.selectedIndex].text=="--Select Model--"){alert("Model not selected");d.focus();return false}else{if(d.options[d.selectedIndex].text=="Select Model"){alert("Model not selected");d.focus();return false}else{if(d.options[d.selectedIndex].text=="Loading..."){alert("Model not selected");d.focus();return false}else{if(b.value==""||b.value=="enter zip"){alert("Please enter valid zip code!!!!!");b.value="";b.focus();return false}else{if(b.value>0){return Redirect(e,c,f.options[f.selectedIndex].text,d.options[d.selectedIndex].text.replace(" & ",".And."),b.value,a)}else{alert("Please enter valid zip code");b.value="";b.focus();return false}}}}}}}};function open_win(c,d){if(navigator.appName=="Microsoft Internet Explorer"){window.open(c,"welcome","width=595,height=510")}else{window.open(c,"welcome","width=595,height=550")}}function FillMaketxtInfoCtrl(n,t,k,m,r,s){CheckUpdateBtn(k,m,r);var q=document.getElementById("hdnFreeTextBox");document.getElementById("divLinkTextInfo").style.display="none";var l=document.getElementById(q.value).value;var o=document.getElementById("hdnUrl").value;o=o+"web/ajax/MakeTxtInfroCtrl.Ajax.aspx?request=update&id="+n+"&text="+escape(l)+"&Type="+t;var p=document.getElementById("hdnBrowser").value;CallServer(o,FillMakeDropDown,p)}function CheckUpdateBtn(e,g,f){if(document.getElementById(e)){window.close();var h=document.getElementById(g).value;window.opener.document.getElementById(document.getElementById("lnkvalue").value).innerHTML=h}}function closeUpdate(b){window.close()}var http_request=false;function CallServer(e,h,f){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP")}catch(g){try{http_request=new ActiveXObject("Microsoft.XMLHTTP")}catch(g){}}}}http_request.onreadystatechange=h;if(f=="IE"){http_request.open("POST",e,false)}else{http_request.open("GET",e,false)}http_request.send(null)}function FillMakeDropDown(){if(http_request.readyState==4){if(http_request.status==200){}}};function open_window(n){var h=navigator.appName.toLowerCase();var m=600;var i=700;var k=(screen.width-m)/2;var l=(screen.height-i)/2;var j="width="+m+", height="+i;j+=", top="+l+", left="+k;if(h=="Microsoft Internet Explorer".toLowerCase()){newwin=window.open(n,"welcome",j+",status=yes,scrollbars=yes,resizable=yes");return false}else{window.open(n,"welcome",j+",status=1,scrollbars=1,resizable=1");return false}return false};function addText(b){if(b.value==""){b.value="zip code"}}function clearText(b){if(!(b.value>0)){b.value=""}}function isValidTextLength(c,d){if(document.getElementById(c).value==""){alert("Please write the text to add.");return false}else{if(document.getElementById(c).value.length>=d){alert("More than "+d+" characters are not allowed.");return false}}};function zipSubmit(j,i,k,h,l,e){if(!j){j=window.event||event}if(j.keyCode==13){if(h.toLowerCase()=="select make"){alert("Make not selected");return false}else{if(l.toLowerCase()=="select model"){alert("Model not selected");return false}else{if(e>0){return Redirect(i,k,h,l,e,false)}else{alert("Please enter valid zip code");return false}}}}}function zipSubmit(k,j,l,e,m,n,i){if(!k){k=window.event||event}if(k.keyCode==13){if(e.toLowerCase()=="select make"){alert("Make not selected");return false}else{if(m.toLowerCase()=="select model"){alert("Model not selected");return false}else{if(n>0){return Redirect(j,l,e,m,n,false,i)}else{alert("Please enter valid zip code");return false}}}}}function GetModel(d,c){if(d.length>0){return d}else{return c}}function Redirect(j,k,n,l,m,h){if(n.toLowerCase()=="select make"){alert("Make not selected");return false}else{if(l.toLowerCase()=="select model"){alert("Model not selected");return false}else{if(m>0){l=l.replace(" & ",".And.");var i=ValidateZip(m,j,k,n,l);if(i!="false"){location.href=i}else{alert("INVALID ZIPCODE!");return false}}else{alert("Please enter valid zip code");return false}}}return false}function Redirect(i,j,g,k,l){if(g.toLowerCase()=="select make"){alert("Make not selected");return false}else{if(k.toLowerCase()=="select model"){alert("Model not selected");return false}else{if(l>0){k=k.replace(" & ",".And.");var h=ValidateZip(l,i,j,g,k);if(h!="false"){location.href=h}else{alert("INVALID ZIPCODE!");return false}}else{alert("Please enter valid zip code");return false}}}return false}function Redirect(k,m,p,n,o,i,l){n=n.replace(" & ",".And.");if(p.toLowerCase()=="--select make--"){alert("Make not selected");return false}else{if(n.toLowerCase()=="--select model--"){alert("Model not selected");return false}else{if(o>0){var j=ValidateZip(o,k,m,p,n,l);if(j!="false"){location.href=j}else{alert("INVALID ZIPCODE!");return false}}else{alert("Please enter valid zip code!!!!");return false}}}return false}function EnterGetQuote(j,i,k,h,l,e){if(!j){j=window.event||event}if(j.keyCode==13){return GetQuote(i,k,h,l,e)}}function GetQuote(h,i,g,j,f){if(null==g||g.options[g.selectedIndex].text=="--Select Make--"||g.options[g.selectedIndex].length==0){alert("Please select a make");return false}if(null==j||j.options[j.selectedIndex].text=="--Select Model--"||j.options[j.selectedIndex].text=="Loading..."||j.options[j.selectedIndex].length==0){alert("Please select a model");return false}return Redirect(h,i,g.options[g.selectedIndex].text,j.options[j.selectedIndex].text.replace(" & ",".And."),f.value)}function setModel(i,j,e){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP")}catch(h){try{http_request=new ActiveXObject("Microsoft.XMLHTTP")}catch(h){}}}}if(j=="Microsoft Internet Explorer"){j="ie"}var g=i+"web/Ajax/ProcessStep2.aspx?request=setModel&Model="+e.options[e.selectedIndex].text;if(j=="ie"){http_request.open("POST",g,true)}else{http_request.open("GET",g,true)}http_request.send(null);return true}function setcarID(i,j,g){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP")}catch(h){try{http_request=new ActiveXObject("Microsoft.XMLHTTP")}catch(h){}}}}if(j=="Microsoft Internet Explorer"){j="ie"}var e=i+"web/Ajax/ProcessStep2.aspx?request=setcarID&CarID="+g.value;if(j=="ie"){http_request.open("POST",e,true)}else{http_request.open("GET",e,true)}http_request.send(null);return true}function ValidateZip(n,m,o,j,p){var k=false;if(window.XMLHttpRequest){k=new XMLHttpRequest();if(k.overrideMimeType){k.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{k=new ActiveXObject("Msxml2.XMLHTTP")}catch(l){try{k=new ActiveXObject("Microsoft.XMLHTTP")}catch(l){}}}}var e=m+"web/ajax/ProcessStep2.aspx?request=validatezip&zipcode="+n+"&Make="+j+"&Model="+p.replace(" & ",".And.");if(o=="ie"){k.open("POST",e,false)}else{k.open("GET",e,false)}k.send(null);return alertContentsValidateZip(k)}function alertContentsValidateZip(c){if(c.readyState==4){if(c.status==200){try{return c.responseText}catch(d){}}}}function ValidateZip(p,n,e,r,o,l){var k=false;if(window.XMLHttpRequest){k=new XMLHttpRequest();if(k.overrideMimeType){k.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{k=new ActiveXObject("Msxml2.XMLHTTP")}catch(m){try{k=new ActiveXObject("Microsoft.XMLHTTP")}catch(m){}}}}var q=n+"web/ajax/ProcessStep2.aspx?request=validatezip&zipcode="+p+"&Make="+r+"&Model="+o+"&Year="+l;if(e=="ie"){k.open("POST",q,false)}else{k.open("GET",q,false)}k.send(null);return alertContentsValidateZipYear(k)}function alertContentsValidateZipYear(c){if(c.readyState==4){if(c.status==200){try{return c.responseText}catch(d){}}}};