/* MODIFICATIONS Wednesday, January 28, 2009 - Fixed lot code issue - wrong lot code being passed to inline "contact us" form */ function detailsTab_onClick(x, s) { var vURL = '' $('wmDivTest').innerHTML = '

' + x + '

'; var tab = document.getElementById(oldTab); var nextSource = s; var sTemp = ''; tab.className = 'notCurrent'; tab = document.getElementById('tab' + x); tab.blur(); oldTab = 'tab' + x; tab.className = 'current'; var objCI = $('divCertifiedImage'); objCI.style.display = 'none'; switch(x){ case '1': vURL = '/templates/vehicleDetails/Details2_Functions.asp?'; vURL += 'sg=' + sg; vURL += '&serialnumber=' + VIN; vURL += '&vid=' + xVID; vURL += '&src=' + nextSource; vURL += '&stocknumber=' + SN; new Ajax.Request(vURL, { onSuccess: function(transport) { $('detailsLeftDetails').innerHTML = transport.responseText; doDetailsPageSlideshow(); setTimeout(vehicleDetails.setCertifiedImage, 1000); } }); break; case '7': $('detailsLeftDetails').innerHTML=$('divNetlookreviews').innerHTML.replace(/\*/g, '

'); break; case '8': $('detailsLeftDetails').innerHTML=$('divReasonstobuy').innerHTML.replace(/\*/g, '

'); break; default: if(pe)pe.stop();slideshowImageCounter = 0; updateContainer('/templates/vehicleDetails/Details2_Functions.asp?sg=' + sg + '&serialnumber=' + VIN + '&vid=' + xVID + '&src=' + nextSource, 'detailsLeftDetails'); break; } if(x==3){setTimeout('loadVideo()', 1500);} } function setVehicleImageFromThumbnail(s,t){var ctl = document.getElementById('vehDetailImage');ctl.src = s;if(t){if(pe){pe.stop();} slideshowImageCounter = 0;addWhiteThumbBorders();stopSlideshow();}} function loadVideo(){ var c = '{ controlsOverVideo: true, '; c += 'showMenu: false, '; c += 'showMuteVolumeButton: true, '; c += 'showVolumeSlider: true, '; c += 'showPlayButton: true, '; c += 'showStopButton: true, '; c += 'showFullScreenButton: false, '; c += 'menuItems: [ false, false, false, false, false, false ], '; c += 'playList: [{ url: \'/vimages/' + VIN + '.flv\' }], '; // c += 'playList: [{ url: \'http://www.youtube.com/watch?v=4Q3D75vgENw\' }], '; c += 'autoRewind: false }'; var fo = new SWFObject("/FlowPlayerLight.swf", "FlowPlayer", "370", "281", "9", "#fff", true); fo.addVariable("config", c); fo.write("detailsvideo"); } function showpay(){ if ((document.calc.loan.value - 0) <= ((document.calc.down.value - 0)+(document.calc.trade.value - 0))){ document.getElementById('pay').innerHTML = '$ 0.00 '; return; } if((document.calc.loan.value==null||document.calc.loan.value.length==0)||(document.calc.months.value==null||document.calc.months.value.length==0)||(document.calc.rate.value==null||document.calc.rate.value.length==0)){document.getElementById("pay").innerText=""}else{var D=document.calc.loan.value;var E=document.calc.trade.value;var C=document.calc.months.value;var F=document.calc.down.value;var B=document.calc.rate.value;if(B==0){B=0.001}intr=B/1200;D-=E;D-=F;var A=D*intr/(1-(Math.pow(1/(1+intr),C)));document.getElementById("pay").innerHTML="$ "+A.toFixed()+" "}}; function Stretch(Q, L, c) { var S = Q; if (c.length>0) while (S.length arrTemp.length || arrTemp[slideshowImageCounter] == '')slideshowImageCounter=0; $('detailsImage' + slideshowImageCounter).style.border='1px solid black'; setVehicleImageFromThumbnail(arrTemp[slideshowImageCounter]); vehicleDetails.setCertifiedImage(); } function addWhiteThumbBorders(){var AE = $$('.tdDetailsImage');for(var i=1;i&serialnumber=' + VIN + '&vid=' + xVID + '&src=contact', 'contactUsForm'); // $('testCode').innerHTML = '/templates/vehicleDetails/Details2_Functions.asp?lotcode=' + L + '&parlotcode=' + PL + '&sg=' + sg + '&p=' + p + '&stocknumber=' + SN + '&newusedflag=&serialnumber=' + VIN + '&vid=' + xVID + '&src=contact' updateContainer('/autocheck_exec.aspx?report=R&template=2&vin=' + VINA + '&sg=' + sg + '&sid=' + ECID, 'divAutoCheckReport'); if(queryStr('fromReturnLink')=='1'){ Modalbox.show('

Thanks for your submission!

Expect to hear from one of our associates very soon!

',{title:'Thank you!'}) } $$('[showFor]').each(function(C){ if(C.getAttribute('showFor') == PL){ // alert(PL + ': ' + C.getAttribute('showFor')); C.style.display = 'block'; } else { C.style.display = 'none'; } });}); function setCalculatorDefaults(){ var vLoan = 0, vDown = 0, vTrade = 0; vLoan = $F('loan'); vDown = $F('down'); if(vLoan > 10000) { vDown = parseInt(vLoan * .2); vTrade = 5000; } else if(vLoan > 5000){ vDown = parseInt(vLoan * .15); vTrade = 1000; } else { vDown = parseInt(vLoan * .1); vTrade = 500; } $('down').value = vDown; $('trade').value = vTrade; showpay(); } var vehicleDetails = function(){ return { button_onClick:function(url){ if(window.opener) { try { window.opener.document.location = url + '&fromVehDetailsPopup=1'; window.opener.focus(); } catch(err) { document.location = url; } } else { document.location = url; } }, addWhiteThumbBorders:function(){var AE = $$('.tdDetailsImage');for(var i=1;i