$(document).ready(function(){ if ($('#value-me').length != 0) { GetNewCaptcha(); } if ($('.largeimage').length != 0) { /* FancyBox */ $("a[rel=superSize]").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'speedIn' : 600, 'speedOut' : 200, 'titlePosition' : 'over', 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return 'Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? '   ' + title : '') + ''; } }); } if ($('#perpage').length != 0) { /* Paging */ $("#perpage").change(function() { document.perpageform.submit(); }); } /* Slideshow */ $('#slideshow').cycle({ fx: 'fade' }); /* Slideshow thumbnail hover */ $('.slideshowpic').live('hover', function() { var newimga=$(this).attr("rel"); newimg = newimga.replace(/[^\d]+/,''); newimg= 'p' + newimg ; //var theVTypeID = theVTypeIDa.replace(/[^\d]+/,''); //alert(newimg); $('#slideshow').cycle('pause'); $('.largeimage').hide(); $('.largeimage').css("opacity","0"); $('#' + newimg).show(); $('#' + newimg).css("opacity","1"); }); /* Search Options - Used Motorhomes, New Motorhomes & Used Cars */ $('#MakeDropDown').live('change', function(event) { $.ajax({ url : '/fetchmodels-new.asp', beforeSend:function() { //alert($('#quicksearch').serialize()); $('#wait').show(); }, type : 'GET', dataType : 'html', data : $('#quicksearch').serialize(), error: function(data) { alert ('ERROR: ' + data); }, success: function( data ) { //alert(data); //console.log('New Model loaded'); $('#ModelDropDown').replaceWith(data); $('#wait').hide(); // $.uniform.update("#ModelDropDown"); } }); }); $('.typeSelect').live('click', function() { var thebranchID=$(this).attr('rel'); var theVTypeIDa=$(this).attr('id'); var theVTypeID = theVTypeIDa.replace(/[^\d]+/,''); $('#vType').val(theVTypeID); $('#branchID').val(thebranchID); $('.selected').removeClass('selected'); $(this).addClass('selected'); $.ajax({ url : '/fetchmakes-new.asp', beforeSend:function() { //alert($('#quicksearch').serialize()); $('#wait').show(); }, type : 'GET', dataType : 'html', data : $('#quicksearch').serialize(), error: function(data) { //alert ('ERROR: ' + data); }, success: function( data ) { //alert(data); $('#MakeDropDown').replaceWith(data); //console.log('New Makes laoded'); $.ajax({ url : '/fetchmodels-new.asp', beforeSend:function() { //alert($('#quicksearch').serialize()); }, type : 'GET', dataType : 'html', data : $('#quicksearch').serialize(), error: function(data) { //alert ('ERROR: ' + data); }, success: function( data ) { //alert(data); $('#ModelDropDown').replaceWith(data); $('#wait').hide(); //console.log('New Models loaded'); } }); } }); return false; }); /* Make model search */ GetModels(0); })