function disableSelection(target){if(typeof target.onselectstart!="undefined")target.onselectstart=function(){return false};else if(typeof target.style.MozUserSelect!="undefined")target.style.MozUserSelect="none";else target.onmousedown=function(){return false};target.style.cursor="default"}var message="";function clickIE(){if(document.all){(message);return false}}function clickNS(e){if(document.layers||(document.getElementById&&!document.all)){if(e.which==2||e.which==3){(message);return false}}}if(document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS}else{document.onmouseup=clickNS;document.oncontextmenu=clickIE}document.oncontextmenu=new Function("return false");function updateModels(makeSel){var ajaxURL=$('#ajaxURL').val();$.post(ajaxURL,{ajaxAction:"updateModels",make:makeSel},function(data){$('#modelSel').html(data)})}addEvent(window,'load',init,false);function init(){var frmInputs=document.getElementsByTagName('input');var allLinks=document.getElementsByTagName('a');for(var i=0;i<frmInputs.length;i++){var theInput=frmInputs[i];if(theInput.type=='text'&&theInput.className.match(/\bcleardefault\b/)){addEvent(theInput,'focus',clearDefaultText,false);addEvent(theInput,'blur',replaceDefaultText,false);if(theInput.value!=''){theInput.defaultText=theInput.value}}}for(var i=0;i<allLinks.length;i++){var theLink=allLinks[i];if(theLink.title==''&&theLink.innerHTML.length<15){theLink.title=theLink.innerHTML}}}function clearDefaultText(e){var target=window.event?window.event.srcElement:e?e.target:null;if(!target)return;if(target.value==target.defaultText){target.value=''}}function replaceDefaultText(e){var target=window.event?window.event.srcElement:e?e.target:null;if(!target)return;if(target.value==''&&target.defaultText){target.value=target.defaultText}}function addEvent(element,eventType,lamdaFunction,useCapture){if(element.addEventListener){element.addEventListener(eventType,lamdaFunction,useCapture);return true}else if(element.attachEvent){var r=element.attachEvent('on'+eventType,lamdaFunction);return r}else{return false}}function popup(url,winName,height,width){var width=width;var height=height;var left=(screen.width-width)/2;var top=(screen.height-height)/2;var params='width='+width+', height='+height;params+=', top='+top+', left='+left;params+=', directories=no';params+=', location=no';params+=', menubar=no';params+=', resizable=no';params+=', scrollbars=yes';params+=', status=no';params+=', toolbar=no';var newwin=window.open(url,winName,params);if(window.focus){newwin.focus()}return false}function updateStateCombo(countrySel,stateField,updateField){var ajaxURL=$('#ajaxURL').val();$.post(ajaxURL,{ajaxAction:"updateStates",country:countrySel,fieldname:stateField},function(data){$('#'+updateField).html(data)})}function updateShipping(countrySel,updateDiv){var ajaxURL=$('#ajaxURL').val();var shipZip=$('#shipZipcode').val();$.post(ajaxURL,{ajaxAction:"updateShipping",country:countrySel,zipcode:shipZip},function(data){$('#'+updateDiv).html(data)})}function updateTotalCharges(){var subTotal=$('#subTotal').val();var totalCharges=$('#totalCharges');var shippingCharges=$('#shippingCharges').val();var newPrice=parseFloat(subTotal)+parseFloat(shippingCharges);totalCharges.html("$"+newPrice.toFixed(2))}
