DisplayForm();function DisplayForm(){var a=0;for(a=0;a<document.forms.length;a++){carSearchElement=document.forms[a].parentNode;if(carSearchElement!=null&&carSearchElement.className=="carsearch hide")carSearchElement.className="carsearch show"}}function ValidPostcode(a){if(a.value==a.defaultValue)a.value=""}function populateModel(h,i){var e=[],g=[],c=0,d=h.options.selectedIndex,b=h;while(b.parentNode.tagName!="FORM")b=b.parentNode;b=b.parentNode;var a=b.elements["modeldropdown"];if(d==0){a.disabled=true;if(a.firstChild.nextSibling!=null)while(a.firstChild.nextSibling!=null)a.removeChild(a.firstChild.nextSibling)}else{g=i[d-1][0].split(";");e=i[d-1][1].split(";");while(a.firstChild.nextSibling!=null)a.removeChild(a.firstChild.nextSibling);for(c=0;c<e.length;c++){var f=document.createElement("option");f.setAttribute("value",e[c]);f.appendChild(document.createTextNode(g[c]));a.appendChild(f)}a.disabled=false}enableDisableSubmitButton(b,true)}function DoAction(m,y,w,x){var v="textfield",p="hidden_optionalsection2_",f=null,c="_",o="hidden_optionalsection1_",u="requiredsectiondropdown4_hidden",t="requiredsectiondropdown3_hidden",e="&",d="=";try{var a=m.elements,D=a["makequery"].value,C=a["modelquery"].value,s=a["makedropdown"],A=s.options[s.selectedIndex].value,r=a["modeldropdown"],z=r.options[r.selectedIndex].value,b=D+d+encodeURIComponent(A)+e+C+d+encodeURIComponent(z);if(a[t]){b=b+e+a[t].value+d;var l=a["requiredsectiondropdown3"];b=b+encodeURIComponent(l.options[l.selectedIndex].value)}if(a[u]){b=b+e+a[u].value+d;var l=a["requiredsectiondropdown4"];b=b+encodeURIComponent(l.options[l.selectedIndex].value)}for(optionalIndex1=1;optionalIndex1<=w;optionalIndex1++){var k=[];for(optionalIndex2=1;optionalIndex2<=4;optionalIndex2++)if(a[o+optionalIndex1+c+optionalIndex2]!=f)if(a[o+optionalIndex1+c+optionalIndex2].value!=f){k[optionalIndex2]=a[o+optionalIndex1+c+optionalIndex2].value+d;b=b+e+k[optionalIndex2];var g,j;g=a["dropdown_optionalsection1_"+optionalIndex1+c+optionalIndex2];j=g.options[g.selectedIndex].value;b=b+encodeURIComponent(j)}else break}for(optionalIndex1=1;optionalIndex1<=x;optionalIndex1++){var k=[];for(optionalIndex2=1;optionalIndex2<=4;optionalIndex2++)if(a[p+optionalIndex1+c+optionalIndex2]!=f)if(a[p+optionalIndex1+c+optionalIndex2].value!=f){k[optionalIndex2]=a[p+optionalIndex1+c+optionalIndex2].value+d;b=b+e+k[optionalIndex2];var g,j;g=a["dropdown_optionalsection2_"+optionalIndex1+c+optionalIndex2];j=g.options[g.selectedIndex].value;b=b+encodeURIComponent(j)}else break}if(a[v]!=f){var h=a["textboxvalue"].value;h=h.replace(/^\s+|\s+$/g,"");var n=a["cfdefaultText"].value,B=a["cferrorMessage"].value;if(n!=f&&n.length!=0)if(h==n||h.length==0)try{var q=m.getElementsByTagName("span");for(i=0;i<q.length;i++)if(q[i].className=="errormsg"){q[i].innerHTML=B;return false}}catch(E){return false}b=b+e+a[v].value+d+encodeURIComponent(h)}b=b+y;m.action=m.action+"?"+b}catch(E){return false}}function validateSubmitAction(b){try{var c=b.options.selectedIndex,a=b.form,e=a.elements["makedropdown"],d=e.options.selectedIndex;if(c==0||d==0)enableDisableSubmitButton(a,true);else enableDisableSubmitButton(a,false)}catch(f){return false}}function enableDisableSubmitButton(d,e){var c="enabledbuttontext",b="disabledbuttontext";try{var a=d.lastChild;if(a!=null)if(a.getElementsByTagName("input").length>0){a=a.getElementsByTagName("input")[0];if(a!=null)if(e===true){a.disabled=true;a.className=b}else{a.disabled=false;a.className=c}}}catch(f){return false}};