jQuery(window).load(function(){ jQuery("#carousel li:first-child").addClass("first"); jQuery("#carousel li:last-child").addClass("last"); var $count = 0; jQuery('#carousel li').each(function() { $count ++; if (jQuery(this).hasClass('selected')) { window.start = $count; // window.start = ($count - 1); // alert(window.start); } }); jQuery('#carousel').jcarousel({ wrap: 'circular', animation: 1500, // visible: 7, start: window.start, easing: 'easeInOutQuint' }); }); jQuery(document).ready(function(){ jQuery('body').removeClass('no-js'); jQuery('#header a, #carousel li a, .product-thumbs a, #sidebar a').live('click', function(e){ e.preventDefault(); var $this = jQuery(this); jQuery('html').fadeOut(400, function() { window.location = $this.attr('href'); }); }) jQuery(window).bind('pageshow',function(){ jQuery('html').show(); }); jQuery('.fade').fadeTo("fast", 0.8); jQuery('.fade').hover(function() { jQuery(this).filter(':not(:animated)').fadeTo("slow", 1); }, function() { jQuery(this).fadeTo("slow", 0.8); }); jQuery("li.selected a").after(""); // Tool Tips function ToolTips() { jQuery('a[rel=tooltip]').mouseover(function(e) { var tip = jQuery(this).attr('title'); jQuery(this).attr('title',''); jQuery('body').append('

' + tip + '

'); jQuery('#tooltip').css('top', e.pageY - 75 ); jQuery('#tooltip').css('left', e.pageX - 100 ); jQuery('#tooltip').fadeIn('500'); }).mousemove(function(e) { jQuery('#tooltip').css('top', e.pageY - 75 ); jQuery('#tooltip').css('left', e.pageX - 100 ); }).mouseout(function() { jQuery(this).attr('title',jQuery('#tooltip').text()); jQuery('#tooltip').remove(); }); } ToolTips(); jQuery(".cboxElement").colorbox({width:"90%", height:"90%"}); // add target=_blank to external links jQuery('a[rel="external"]').attr('target','_blank'); // Animate the header Navigation jQuery("#nav ul.sub-menu").hide(); jQuery("ul#nav li").hover( function () { jQuery(this).find("ul.sub-menu").stop(true,true).slideToggle(300); },function () { jQuery(this).find("ul.sub-menu").stop(true,true).slideToggle(300); }); jQuery(".hide").hide(); jQuery("div#signup a").click( function () { jQuery(".hide").stop(true,true).slideToggle(300); jQuery(this).text(jQuery(this).text() == 'Sign-Up For Our Newsletter' ? 'No Thanks, Maybe Later' : 'Sign-Up For Our Newsletter'); return false; }); // jQuery('#product-search label').click(function(){ // jQuery(this).toggleClass('selected'); // }); jQuery("#product-search .check").change(function() { if(jQuery(this).is(':checked')) { jQuery(this).parent().addClass("selected"); } else { jQuery(this).parent().removeClass("selected"); } }).change(); jQuery('#product-search form').live('submit', function(e){ e.preventDefault(); var products_link = '?' + jQuery(this).serialize(); jQuery('html, body').animate( { scrollTop: 0 }, 'slow' ); jQuery('.product-thumbs a').fadeOut('slow'); jQuery('body').append(''); jQuery(".product-thumbs").load(products_link + ' .product-thumbs a', function(response, status, xhr) { if (status == "error") { // var msg = "Sorry but there was an error: "; // alert(msg + xhr.status + " " + xhr.statusText); } else { jQuery('.product-thumbs a').fadeIn('slow'); jQuery('#product-loader').fadeOut('slow'); jQuery('#product-loader').remove(); ToolTips(); } }); }); var $scrollingDiv = jQuery("#product-search"); jQuery(window).scroll(function(){ $scrollingDiv .stop() .animate({"marginTop": (jQuery(window).scrollTop()) + "px"},"slow"); }); }); // End Doc Ready