/* /v8/global/js/tools/paymentcalculator.js */
var calcForm;var verbage="Call";var defaultRate="6.9";function initialize(a){calcForm=(a==null)?document.forms[0]:document.forms[a];calcForm.rate.value=defaultRate;populate(calculate())}function initializePaymentCalculator(d,c,a){calcForm=(d==null)?document.forms[0]:document.forms[d];var b=calcForm.cash_trade.value;if(b.indexOf("%")!="-1"){price=normalize(calcForm.price.value);b=Math.floor((price*(parseInt(b)/100))/100)*100;calcForm.cash_trade.value=b}calcForm.rate.value=defaultRate;if(!a){calcForm.biMonthly=!!c||false}else{calcForm.biWeekly=!!a||false}}function populate(a){if(calcForm.rate.value==""||calcForm.rate.value=="0."){return}if(a=="0.00"&&parseInt(calcForm.price.value)==0){calcForm.cash_trade.disabled=true;calcForm.retail.disabled=true;calcForm.rate.disabled=true;calcForm.term.disabled=true;calcForm.monthlypayment.value=0;calcForm.monthlypayment.disabled=true;calcForm.price.value=verbage;calcForm.retail.value=verbage;calcForm.monthlypayment.value=verbage;return}else{if(calcForm.cash_trade.value.indexOf("-")!=-1||new Number(normalize(calcForm.cash_trade.value))<0){alert("Your down payment must be greater than zero.\nIf you have any questions, feel free to contact us via email.\nThank You.");return}}calcForm.cash_trade.disabled=false;calcForm.retail.disabled=false;calcForm.rate.disabled=false;calcForm.term.disabled=false;calcForm.monthlypayment.disabled=false;calcForm.monthlypayment.value=a}function rePopulate(a){clearSelector("term");populateTerms(a)}var price;var retail;function calculate(){if(calcForm.rate.value==""){return}price=normalize(calcForm.price.value)-normalize(calcForm.cash_trade.value);retail=normalize(calcForm.retail.value)-normalize(calcForm.cash_trade.value);rate=calcForm.rate.value/100;term=calcForm.term.options[calcForm.term.selectedIndex>=0?calcForm.term.selectedIndex:0].value;if(rate==0){var payment=price/term;if(calcForm.biWeekly){payment=(price/term)/2}else{if(calcForm.biMonthly){payment=(price/term)*2}}pay=new String(payment)}else{var monthIntRate=rate/12;ratePlus=eval(monthIntRate+1);pow=Math.pow(ratePlus,term);var payment=((price)/((1-(1/pow))/monthIntRate));if(calcForm.biWeekly){payment=((price)/((1-(1/pow))/monthIntRate))/2}else{if(calcForm.biMonthly){payment=((price)/((1-(1/pow))/monthIntRate))*2}}pay=new String(payment)}if(pay=="NaN"){return verbage}else{if(pay<0){return 0}}return format(pay)}function populateTerms(a,g,b,e){if(!e){e=""}if(!b){b=12}var d=0;if(e!=""){var f=e.split(",");for(var c=(f.length-1);c>=0;c--){calcForm.term.options[d++]=new Option(f[c]+" mo.",f[c])}}else{for(var c=a;c>=12;(c-=b)){calcForm.term.options[d++]=new Option(c+" mo.",c)}}calcForm.term.value=g;if(calcForm.term.selectedIndex===-1){calcForm.term.selectedIndex=0}}function clearSelector(b){var c=0;var a=calcForm.elements[b].options.length;if(a<c){return false}for(i=a;i>=c;i--){calcForm.elements[b].options[i]=null}}function normalize(a){if(a==null||a==""){a=0}else{a=a.replace(/,/,"");a=a.replace(/$/,"")}return a}function format(b){var a;numerals=new String(b);index=numerals.indexOf(".");if(index!=-1){a=numerals.substring(index,index+3);numerals=numerals.substring(0,index)}ln=numerals.length;beg=numerals.substring(0,ln-3);end=numerals.substring(ln-3);retVal=beg+((ln>3)?",":"")+end+((a==null)?".00":a);return retVal}function calculatePurchasingPower(){var b;var a=calcForm.affordableMonthlyPayment.value;var c=parseFloat(0+calcForm.cash_trade.value);var e=calcForm.rate.value/1200;var d=calcForm.term.value;if(e==0){b=(a*d)+c}else{b=a*((1-(1/Math.pow(1+e,d)))/e)+c}return format(b)}function populatePurchasingPower(a){if(calcForm.rate.value==""||calcForm.rate.value=="0."){return}if(a=="NaN.00"){calcForm.purchasingPower.value=0;calcForm.purchasingPower.disabled=true;calcForm.purchasingPower.value=verbage;return}else{if(calcForm.cash_trade.value.indexOf("-")!=-1||new Number(normalize(calcForm.cash_trade.value))<0){alert("Your down payment must be greater than zero.\nIf you have any questions, feel free to contact us via email.\nThank You.");return}}calcForm.purchasingPower.disabled=false;calcForm.purchasingPower.value=a}function doBoth(){populate(calculate());populatePurchasingPower(calculatePurchasingPower())};
/* /v8/widgets/generic/print/js/print-version-init.js */
var printObject=new Object();printObject.content=new Array();jQuery(function(a){a("#globalPrint").attr("href","javascript:printPageOpen();").attr("title",printObject.msg)});function printPageOpen(){if(printObject.content.length==0){printObject.content.push($("#printContainer").html())}var a=window.open(printObject.url,"printWin","toolbar=yes,location=no,directories=yes,menubar=yes,resizable=yes,scrollbars=yes,width=760,height=420,left=75,top=50");a.focus()}function clearPrintObject(){printObject.content=new Array()};
/* /v8/widgets/automotive/inventory/details/js/style1.js */
var manualTBlinks=1;var loadPopup=function(b,a,d,c){var e=window.open(b,"hello","width="+a+", height="+d+", fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars="+c+",resizable=no,directories=no,location=no");e.focus()};var loadSpins=function(a){spinswindow=window.open(a,"3Dspins","width=700,height=350,fullscreen=no,toolbar=no,status=yes,menubar=no,scrollbars=no,resizable=no,directories=no,location=no")};var loadDiv=function(a){$("#vehicle").find("div.vData").hide();$(a).show()};var player_size=function(){};var tabs={top:0,left:0,init:function(){},load:function(a){loadDiv(a)},ieversion:function(){return parseFloat(navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE")+5))},ie6:function(){return($.browser.msie&&tabs.ieversion()<8)}};jQuery(tabs.init);function resizeImg(a){}var loadPhotoDiv=function(a){$("#vPhotoThumbs").find(".vPhotos:visible").slideUp("slow",function(){$(a).slideDown("5000")})};var navClick=function(a,b){$(a+" a").removeClass("clicked");$(b).addClass("clicked")};var vPhotoCheck=function(a){if(a.src.match(/jato\/stockphoto/)){$("#largePhotoLink").css("background","none")}};var CloseOpenedWindowAndRedirect=function(a){if(window.opener&&window.opener.closed!=="true"){window.opener.focus();window.opener.location=a;self.close()}else{window.location=a;if((window.screen.availWidth>800)&&(window.screen.availHeight>600)){window.resizeTo(970,578)}else{window.resizeTo(window.screen.availWidth,window.screen.availHeight)}}};
/* /v8/global/js/jquery/catfish-jquery.js */
var id=null;var settings=null;$.fn.catfish=function(a){this.settings={closeLink:"none",animation:"slide",height:"50"};if(a){$.extend(this.settings,a)}id=this.attr("id");settings=this.settings;$(this).hide().css("position","fixed").css("bottom","0").css("left","0").css("padding","0").css("margin","0").css("width","100%").css("z-index","100");$("html").css("padding","0 0 "+this.settings.height+"px");if((jQuery.browser.msie)&&(parseFloat(navigator.appVersion.split("MSIE")[1])<7)){$("html").add("body").css("height","100%").css("overflow","hidden").css("width","auto");$(this).css("position","absolute").css("z-index","100").css("overflow","hidden");$("body").append(this)}if(this.settings.animation=="slide"){$(this).slideDown("slow")}else{if(this.settings.animation=="fade"){$(this).fadeIn("slow")}}if(this.settings.closeLink!="none"){$(this.settings.closeLink).click(function(){$.closeCatfish();return false})}};$.closeCatfish=function(){this.catfish=$("#"+id);$(this.catfish).hide();$("html").css("padding","0")};
/* /v8/global/js/jquery/jquery.scrollto.js */
(function(c){var a=c.scrollTo=function(f,e,d){a.window().scrollTo(f,e,d)};a.defaults={axis:"y",duration:1};a.window=function(){return c(c.browser.safari?"body":"html")};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this.each(function(){var m=this,k=c(m),l=f,j,h={},n=k.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(l)){l=b(l);break}l=c(l,this);case"object":if(l.is||l.style){j=(l=c(l)).offset()}}c.each(d.axis.split(""),function(r,s){var t=s=="x"?"Left":"Top",v=t.toLowerCase(),q="scroll"+t,o=m[q],p=s=="x"?"Width":"Height",u=p.toLowerCase();if(j){h[q]=j[v]+(n?0:o-k.offset()[v]);if(d.margin){h[q]-=parseInt(l.css("margin"+t))||0;h[q]-=parseInt(l.css("border"+t+"Width"))||0}h[q]+=d.offset[v]||0;if(d.over[v]){h[q]+=l[u]()*d.over[v]}}else{h[q]=l[v]}if(/^\d+$/.test(h[q])){h[q]=h[q]<=0?0:Math.min(h[q],g(p))}if(!r&&d.queue){if(o!=h[q]){i(d.onAfterFirst)}delete h[q]}});i(d.onAfter);function i(o){k.animate(h,e,d.easing,o&&function(){o.call(this,f)})}function g(o){var p=n?c.browser.opera?document.body:document.documentElement:m;return p["scroll"+o]-p["client"+o]}})};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);
