$(document).ready(function(){ //per page $("#perpage").change(function() { document.perpageform.submit(); }); //music $('.menu').initMenu(); //cycle $('.slideshow').cycle({ fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc... }); //used car feature cycle $('.slideshowHome').cycle({ fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc... }); // hover overs $(".carphoto").hover( function() { $(this).stop().animate({"opacity": "0.6"}, "slow"); }, function() { $(this).stop().animate({"opacity": "1"}, "slow"); }); $("#caractions a").hover( function() { $(this).stop().animate({"opacity": "0.6"}, "fast"); }, function() { $(this).stop().animate({"opacity": "1"}, "fast"); }); $(".fademe a").hover( function() { $(this).stop().animate({"opacity": "0.6"}, "fast"); }, function() { $(this).stop().animate({"opacity": "1"}, "fast"); }); }); function showDirection() { var sourcePcode1 = document.getElementById('txtPostcodeA').value; var sourcePcode2 = document.getElementById('txtPostcodeB').value; var destPcodeFull = document.getElementById('myDestPcode').value.replace(' ', '+'); var sourcePcodeFull = sourcePcode1; if(sourcePcode2 != '') { sourcePcodeFull += '+' + sourcePcode2; } window.open('http://maps.google.co.uk/maps?saddr=' + sourcePcodeFull + '&daddr=' + destPcodeFull + '&hl=en', 'googleDirections', 'status=0, toolbar=0, menubar=0,resizable=1, height=600, width=800, top=0, left=0'); } function CarQuickCalc() { form = document.financeform price= form.price.value DownPayment= form.deposit.value Prin=(price-DownPayment).toFixed(2) form.amountofinance.value=Prin AnnualInterestRate = form.InterestRate.value/100 Years= form.NumberOfYears.value MonthRate=AnnualInterestRate/12 NumPayments=Years*12 MonthPayment=Math.floor((Prin*MonthRate)/(1-Math.pow((1+MonthRate),(-1*NumPayments)))*100)/100 form.NumberOfPayments.value=NumPayments form.MonthlyPayment.value=MonthPayment.toFixed(2) form.totalpayable.value=(MonthPayment*NumPayments).toFixed(2) form.interestpayable.value=((MonthPayment*NumPayments)-Prin).toFixed(2) }