var popups=new Array();function popup(url,name,option,width,height){if(width){var left=(screen.availWidth-width)/2;}if(height){var top=(screen.availHeight-height)/2;}var scroll="no";var resize="no";var status="no";var tool="no";if(option){if(option.search(/c/)!=-1){scroll="yes";}if(option.search(/r/)!=-1){resize="yes";}if(option.search(/s/)!=-1){status="yes";}if(option.search(/t/)!=-1){tool="yes";}}var options="scrollbars="+scroll+",toolbar="+tool+",directories=no,Location=no,resizable="+resize+",status="+status;var pop=window.open(url,name,options+",width="+width+",height="+height+",left="+left+",top="+top);popups[name]=pop;popups[name].focus();}function encstr(input){stra=input.split("");var out_="";for(i=0;i<=stra.length-1;i++){if(i%2){out_+=stra[i];}}return out_;}function dcrypt(valu){return eval("encstr('"+valu+"')").replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});}var cacheImage=new Image;function image_get(theImage,theId){jQuery(document).ready(function(){border_colour(theId,"cc0000");$("#mainImage").fadeOut("slow",function(){$("#mainImage").attr("src",(cacheImage.src?cacheImage.src:theImage));$("#mainImage").fadeIn("slow");border_colour(theId,"ccc");});});}function image_load(theImage){cacheImage.src=theImage;}function border_colour(theId,theColour){jQuery(document).ready(function(){$("#"+theId).attr("style","border:1px solid #"+theColour+";");});}function do_submit(action){if(action=="reset_all"){document.getElementById("make_id").value="";document.getElementById("model_id").value="";document.getElementById("fuel_type").value="";}else{if(action=="reset_make"){document.getElementById("make_id").value="";document.getElementById("fuel_type").value="";}else{if(action=="preserve"){document.getElementById("preserve_make_model").value=1;}}}document.getElementById("filterer").submit();}