$(document).ready(function(){$('#filter_form :input').change(function(){$('#filter_form').submit()});$('ul#slideshow').innerfade({speed:1000,timeout:5000,containerheight:'400px'});$('#search_form').sform();$('#promo_form').sform({response_text:'Promotion Code',default_text:'Promotion Code',field_name:'promocode'});if($('#extra_images').length>0){var b=$('#gallery').width();var c=0.75;$('#extra_images li img:not(.active)').css({cursor:'pointer',opacity:c});$('#extra_images li img').each(function(i){$(this).click(function(){var t=$(this);if($(t).attr('class')!='active'&&!$('#gallery ul').is(':animated')){$('#extra_images li img.active').css({cursor:'pointer'}).fadeTo('fast',c).removeClass('active');$('#gallery ul').animate({marginLeft:'-'+(i*b)+'px'},'slow','easeInOutExpo',function(){$(t).css({cursor:'default'}).fadeTo('fast',1.0).addClass('active')})}})});$(window).load(function(){var a=$('#gallery').height();$('#gallery ul li img:not(.enlarge)').each(function(){$(this).css({padding:Math.floor((a-$(this).parents('li:eq(0)').height())/2)+'px 0'})})})}$('#gallery a:not(.lightbox_ignore), #content a.lightbox:not(.lightbox_ignore)').lightBox();$('form.validate_form').jform({convert_text:true});$('form.buy_form').jform({prepend_all_errors:true});$('#main a[rel="external"]').attr('title','Visit website (Opens in a new window)').click(function(){return!window.open('/?out='+this.href)});$('#footer a[rel="external"], #main a[rel="new"]').click(function(){return!window.open(this.href)});$('#featured .scroll .scroll_container div, .catsup').hover(function(){if($(this).hasClass('feature')){$(this).find('a:last').css('color','#a61100')}var a=$(this).find('a:last').attr('href');if(a!=null){window.status=a;$(this).css('cursor','pointer').click(function(){window.location=a})}},function(){if($(this).hasClass('feature')){$(this).find('a:last').css('color','#000')}window.status=''});$('#empty_basket').submit(function(){return confirm('Are you sure you want to empty your ENTIRE Shopping Bag?')});$('a.remove_saved').click(function(){return confirm('Are you sure you want to permanently remove this Saved Order?')});$('#user a.logout').click(function(){if(confirm('Are you sure you want to Log-out?')){this.href=this.href+'?true'}else{return false}});$('div.toggle_order').hide().before('<span>[View Details]</span>').prev('span').css('cursor','pointer').click(function(){if($(this).html()=='[View Details]'){$(this).html('[Hide Details]').next('div').slideDown()}else{$(this).html('[View Details]').next('div').slideUp()}});if(location.hash){$('table.basket tr td div#'+location.hash.slice(1).replace('order_','oid_')).slideDown().prev('span').html('<span>[Hide Details]</span>');}$('.h_spec').prepend('<span>[+]</span> View ').css({marginBottom:'10px',cursor:'pointer'}).next('.spec').hide().end().click(function(){if($(this).text().indexOf('View')!=-1){$(this).html($(this).html().replace('<span>[+]</span> View','<span>[-]</span> Hide')).next('.spec').slideDown()}else if($(this).text().indexOf('Hide')!=-1){$(this).html($(this).html().replace('<span>[-]</span> Hide','<span>[+]</span> View')).next('.spec').slideUp()}});$('label.js_back').append('<input type="button" value="&#8249; Back" />').children(':input').addClass('back').click(function(){history.go(-1)});$('img#cap').after('<span>[Reload image characters]</span>').next('span').addClass('re_cap').click(function(){var a=$(this).prev('img');$(a).attr('src',$(a).attr('src').replace(/[\d]+$/g,'')+Math.round(Math.random()*100000))});$('.live_stock').jStock({eleHeight:'200px'});$('#print_page').append('<span>Print<img src="/res/sys/icon_print.gif" alt="" /></span>').children('span').css({cursor:'pointer',opacity:0.5}).attr('title','Print this page').click(function(){window.print()}).hover(function(){$(this).css('opacity',1)},function(){$(this).css('opacity',0.5)});$('#featured').featured();$('form.validate_checkbox').submit(function(){if($('input[class*="cbg_Req"]:checked').length==0){alert('You must select at least one newsletter');return false}})});