var WEBLINC={};$(document).ready(function(){WEBLINC.focusInputs={init:function($obj){var initVal=$obj.val();$obj.focus(function(){if($(this).val()==initVal)
$(this).val('').removeClass('hint');}).blur(function(){if($(this).val()=='')
$(this).val(initVal).addClass('hint');});}}
var $hoverable=$('.navigation, .navigation > h2, .primary-level > li');$hoverable.hoverIntent({timeout:500,over:function(){$(this).siblings().removeClass('hover');$(this).addClass('hover');},out:function(){$(this).removeClass('hover');}});$('.navigation ul li:last-child > a').addClass('last-link');WEBLINC.productQuickview={init:function(){var $productImg='div.products-grid ul li div.image a:not(.quick-view), div.products table.lineitems td.column-image a:not(.quick-view)',$quickviewBtn='div.products-grid ul li div.image a.quick-view, div.products table.lineitems td.column-image a.quick-view';isFired=false;WEBLINC.productQuickview.bindEvents($productImg,$quickviewBtn);},initMyBuys:function(){var $productImg='#mybuyspagezone1 div.image a:not(.quick-view)',$quickviewBtn='#mybuyspagezone1 div.image a.quick-view';var $productImg2='#mybuyspagezone2 div.image a:not(.quick-view)',$quickviewBtn2='#mybuyspagezone2 div.image a.quick-view';WEBLINC.productQuickview.bindEvents($productImg,$quickviewBtn);WEBLINC.productQuickview.bindEvents($productImg2,$quickviewBtn2);},buildQuickView:function(parentElm){var $quickView=$('<div class="quickview-modal" style="display: none;"><a href="#" class="close">Close Quick View</a><div class="inner-content clearfix"><h2 class="loading">Loading...</h2></div></div>').appendTo(parentElm);if($.browser.msie&&$.browser.version==6)
$("select").css("visibility","hidden");$('a.close',$quickView).click(function(){var $products=$(this).closest('div.products'),productZ=parseInt($products.css('z-index'));isFired=false;$products.css('z-index',function(){return productZ-1;})
$quickView.remove();if($.browser.msie&&$.browser.version==6)
$("select").css("visibility","visible");return false;});$quickView.show();return $quickView;},bindEvents:function($productImg,$quickviewBtn){$($productImg).hover(function()
{$(this).siblings('a').show();},function()
{$(this).siblings('a').hide();});$($quickviewBtn).hover(function()
{$(this).show();},function()
{$(this).hide();}).click(function(){$('#content div.products div.quickview-modal').remove();var $this=$(this),$products=$this.closest('div.products'),productID=$this.attr('rel'),thisXY=$this.offset(),productsXY=$products.offset(),qvTop=(thisXY.top-productsXY.top),$thisQV=WEBLINC.productQuickview.buildQuickView($products),winWidth=($products.width()/2),qvWidth=($thisQV.width()/2),leftPos=((winWidth-qvWidth)-30),leftCoord=thisXY.left+leftPos,leftPadding=10,rightCoord=thisXY.left+leftPos+$thisQV.width(),windowRightBoundary=$(window).width()+$(window).scrollLeft();if(rightCoord>=windowRightBoundary&&leftPos<0){leftPos+=(windowRightBoundary-rightCoord);if(leftPos<=-productsXY.left){leftPos=leftPadding;}}else if(leftCoord<=leftPadding&&leftPos<0){leftPos=leftPadding;}
$thisQV.css({top:qvTop+'px',left:leftPos+'px'});$.ajax({async:true,url:'/index.cfm/fuseaction/product.quickview/productID/'+productID,dataType:"html",cache:true,success:function(data,textStatus)
{$('div.inner-content',$thisQV).html(data);$('.button, .button-alt',$thisQV).buttonize();$('div.product-images a.image-link',$thisQV).removeAttr('title').click(function(){return false;});},error:function()
{$('div.inner-content',$thisQV).html("<h2>An Error Occurred</h2>");}});var productZ=parseInt($products.css('z-index'));$products.css('z-index',function(){return zAdd();})
function zAdd(){if(isFired!=true){isFired=true;return productZ+1;}}
return false;});}};$('.button, .button-alt').buttonize();$('.corners').cornerize();var $guarantees=$('#guarantees'),$guaranteeItems=$('> li',$guarantees),timeout=13000,speed=1000,currentIndex=0;if($.browser.msie){window.setInterval(function(){$guaranteeItems.hide().eq(currentIndex).show();currentIndex++;if(currentIndex>=$guaranteeItems.length){currentIndex=0;}},timeout);}else{$guarantees.cycle({timeout:timeout,speed:speed});}
$('#content ul.category-promotions').each(function(){$('li.category:first',this).addClass('first');$('li.category:last',this).addClass('last');});WEBLINC.focusInputs.init($('input#newsletter-email-address'));WEBLINC.focusInputs.init($('input#personal-name'));WEBLINC.productQuickview.init();$('table.lineitems').find('th.column-select a.button').click(function(e){e.preventDefault();$(this).closest('table').find('td.column-select input:checkbox').each(function(){$(this).get(0).checked=($(this).get(0).checked)?false:true;});});});$.extend({siteSearchInit:function(){var $categoryDropDown=$('#search-category');var ntkValues={"a342d848-c6c9-4133-8449-9ecfffabf614":"dvdsadt","a44dd32f-bbbc-49a3-bf35-579b234952f8":"dvdsadt","2652e2f3-d1d6-4316-a7e7-24b9a55a1665":"primary","4d0d9684-ee36-45d3-9e7f-c414809c1d0d":"music","d1f0b5ec-9eca-4575-ad16-93853cc464d1":"music","a4925031-9894-4b5e-9eda-89ad17dcc7be":"books","b09b71b5-4ae4-412b-a1b4-e3a31f7d1f78":"efp","8fee063d-0609-4e4d-8337-a9b130eb3b0f":"efp","f9bd8faa-7cd8-4120-aa96-8764179ad421":"efp","songs":"songs"};$categoryDropDown.change(function()
{$("#Ntk").val(ntkValues[$('option:selected',this).attr('id')]||"primary");});}});$(document).ready(function(){$('#body-container div.carousel-container').each(function(){var count=0,$cList="",$this=$(this),$cPaging=$('div.carousel-paging',this),itemsPerPage=3,numItems=0,intervalTime=200,intervalMaxIterations=50,verticalScroll=false;if($this.hasClass('carousel-vertical-container')){itemsPerPage=1,verticalScroll=true;}
function calcPageIndex(index){var pageRelation=new Array(),currentPage=1;for(var i=1;i<=numItems;i++){pageRelation[i]=currentPage;if(i%itemsPerPage==0)
currentPage++;}
$('ul li',$cPaging).removeClass('active').filter('.page-'+pageRelation[index]).addClass('active');};function carouselPagination(carousel){var numPages=Math.ceil(numItems/itemsPerPage);if(numPages>1){var $pager=$('<ul></ul>');for(var i=1;i<=numPages;i++){$pager.append('<li class="page-'+i+'"><a href="#">'+i+'</a></li>');}
$pager.appendTo($cPaging);$('ul li a',$cPaging).click(function(){var scrollToPos=$.jcarousel.intval(parseInt(($(this).text())*itemsPerPage)-2);calcPageIndex(scrollToPos);carousel.scroll(scrollToPos);return false;});}};function itemFirstIn(carousel,item,idx,state){calcPageIndex(carousel.last);};function postCarouselLoop($cList,$cItems){var $cPaging=$('div.carousel-paging',$this);if(verticalScroll){var $carousel=$('div.carousel',$this),collapsedHeight=$('li.product:first',$this).outerHeight(true);$carousel.height(collapsedHeight);}
numItems=$cItems.length;$cList.jcarousel({vertical:verticalScroll,visible:itemsPerPage,scroll:itemsPerPage,initCallback:carouselPagination,itemFirstInCallback:itemFirstIn});if($('#mybuyspagezone1',$this).length||$('#mybuyspagezone2',$this).length){WEBLINC.productQuickview.initMyBuys();}}
var interval=setInterval(function(){count++;$cList=$('div.carousel > #mybuyspagezone1 > ul, div.carousel > #mybuyspagezone2 > ul, div.carousel ul',$this);$cItems=$('> li',$cList);if($cList.length||count>intervalMaxIterations){clearInterval(interval);postCarouselLoop($cList,$cItems);}},intervalTime);});});jQuery(document).ready(function(){$("#googleLink").click(function(){$("#googleForm").children("input:image").click();return false;});$('table.cart td.column-quantity a.update').closest('form').submit(function(){var qtyForm=$(this);var qtyVal=$('input[name="quantity"]',qtyForm).val();if(parseInt(qtyVal)&&qtyVal>0)
return true;else
alert("The quantity is required and must be greater than 0. \nPlease use the Remove button to remove the item for your cart.");return false;});$('table.cart td.column-quantity a.update').click(function(){var qtyForm=$(this).closest('form');qtyForm.submit();return false;});WEBLINC.focusInputs.init($('input#vcart-cartdetail-fulfillmentsystemcode1'));var $lineItems=$('#content-container div.v-cart-cartdetail table.lineitems');$('thead th.column-select a.button',$lineItems).click(function(){var $selectAllInput=$('thead th.column-select .select-all',$lineItems),selectAll=$selectAllInput.val(),thisTxt=$.trim($('span',this).text());if(selectAll==0)
{$('tbody td.column-select input.input-checkbox',$lineItems).attr('checked','checked');$selectAllInput.val(1);$('span',this).html(thisTxt.replace(/Select All/,'Deselect All')+'<i/><span/>');}
else
{$('tbody td.column-select input.input-checkbox',$lineItems).attr('checked','');$selectAllInput.val(0);$('span',this).html(thisTxt.replace(/Deselect All/,'Select All')+'<i/><span/>');}
return false;});});$.fn.datasetSelect=function(){return this.each(function(){$(this).hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');}).click(function(){formElementName=$(this).find('input:radio').attr('name');$('input[type="radio"][name="'+formElementName+'"]').parent().parent().parent().removeClass('selected');$(this).find('input:radio').attr('checked','checked').change().end().parent().siblings().andSelf().find('li.option').removeClass('selected').end().end().end().end().addClass('selected');});});};$.fn.populateSavedAddressData=function(addresses){return this.each(function(){var $this=$(this),$addressForm=$this.closest('form'),fields={'Prefix':$('select[name=accountAddressTitleID]',$addressForm),'FirstName':$('input[name=firstName]',$addressForm),'MiddleName':$('input[name=middleName]',$addressForm),'LastName':$('input[name=lastName]',$addressForm),'Address1':$('input[name=address1]',$addressForm),'Address2':$('input[name=address2]',$addressForm),'City':$('input[name=city]',$addressForm),'State':$('select[name=state]',$addressForm),'Zip':$('input[name=zip]',$addressForm),'Country':$('select[name=country]',$addressForm),'DayPhone':$('input[name=dayPhone]',$addressForm),'DayPhoneExtension':$('input[name=dayPhoneExtension]',$addressForm),'EveningPhone':$('input[name=eveningPhone]',$addressForm)};$.each(fields,function(field,input){input.val('');});for(var i=0;i<addresses.length;i++){if(addresses[i].ID==$this.val())
$.each(fields,function(field,input){input.val(addresses[i][field]);});}});};$.extend({cartSummaryInit:function(){var $zoomContainer=$('#zoom-container'),$productColumn=$('#content table.cart-summary tr:not(.spacer) td.column-product');$productColumn.find('a.zoom-button').click(function(){return false;});$productColumn.hover(function(){var imageToLoad=$(this).find('a.zoom-button').attr('href');$zoomContainer.find('img').attr('src',imageToLoad).end().appendTo($(this).find('div.product-container')).show();},function(){$zoomContainer.hide();});WEBLINC.focusInputs.init($('input.hint'));},shippingInit:function(){var $options=$('#content ul.dataset-select li.option'),$shippingPriceContainer=$('#order-summary-shipping'),$totalPriceContainer=$('#order-summary-total'),initialShippingCost=(jQuery.trim($shippingPriceContainer.html().toUpperCase())=='FREE')?0:parseFloat($shippingPriceContainer.html().replace('$','')),initialSubtotal=parseFloat($totalPriceContainer.html().replace('$',''))-initialShippingCost;$options.datasetSelect().find('dt input:radio').change(function(){var $this=$(this),thisPrice=parseFloat($this.parent().siblings('dd').find('div.price').html().replace('$',''));$shippingPriceContainer.html((thisPrice==0)?'FREE':'$'+thisPrice.toFixed(2));$totalPriceContainer.html('$'+((initialSubtotal+thisPrice).toFixed(2)));});},paymentInit:function(){var $paymentForm=$('#checkout-content form.paymentform'),$giftCardForm=$('#checkout-content form.giftcardform'),$paymentButton=$('div.actionlist-pay a.button',$paymentForm).css({float:'right'}),$paymentButtonContainer=$('#paymentbutton-container'),$paymentMethods=$('#checkout-content div.payment-methods div.method'),$methodNew=$paymentMethods.filter('.method-new'),$methodSaved=$paymentMethods.filter('.method-saved'),$methodGiftCard=$paymentMethods.filter('.method-giftcard'),$paymentRadios=$('input[type="radio"][name="accountTenderID"]',$paymentMethods),$paymentTypesList=$('ul.paymenttypes',$paymentMethods),$paymentTypes=$('li.paymenttype',$paymentTypesList),$billingAddressFields=$('div.fields-billingaddress',$paymentMethods).hide(),$newCardFields=$('div.fields-newcard',$paymentMethods).hide(),$newAddressFields=$('div.fields-newaddress',$paymentMethods).hide(),$addressRadios=$('input[type="radio"][name="existingAddress"]',$paymentMethods),$addressRadioContianers=$addressRadios.closest('li.option'),$billMeLaterFields=$('div.fields-billmelater',$paymentMethods).hide(),$cvvInfo=$('#cvv-info'),openClass='open',hoverClass='hover',selectedClass='selected';$('h3:first',$paymentMethods).click(function(){var $thisParent=$(this).parent();$cvvInfo.hide();$paymentMethods.removeClass(openClass);$thisParent.addClass(openClass);$.scrollTo($thisParent,{duration:400,offset:-40});}).hover(function(){$(this).parent().addClass(hoverClass);},function(){$(this).parent().removeClass(hoverClass);});$paymentRadios.click(function(){var $this=$(this),$thisPaymentMethod=$this.closest('div.method'),$thisPaymentType=$this.closest('li.paymenttype');$.each([$paymentMethods,$paymentTypes],function(){this.removeClass(selectedClass);});$.each([$thisPaymentMethod,$thisPaymentType],function(){this.addClass(selectedClass);if(this==$thisPaymentMethod){this.addClass(openClass);}});$.each([$newCardFields,$billMeLaterFields,$billingAddressFields],function(){this.hide();});if($thisPaymentType.hasClass('paymenttype-billmelater')){$.each([$billMeLaterFields,$billingAddressFields],function(){this.show();});}else if($thisPaymentType.hasClass('paymenttype-card')){$.each([$newCardFields,$billingAddressFields],function(){this.show();});}});$addressRadioContianers.click(function(){var $this=$(this),$thisRadio=$this.find('input[type="radio"][name="existingAddress"]')
if($thisRadio.val()=='new-address'){$newAddressFields.show();}
else{$newAddressFields.hide();}});var $tooltip=$('#tooltip-giftcard');function giftCardNotApplied(){return($('input[name=giftCertificateNumber]',$giftCardForm).val()||$('input[name=giftCertificatePin]',$giftCardForm).val())?true:false;}
$('a.apply, a.clear',$tooltip).click(function(){$methodGiftCard.find('h3:first').click();if($(this).hasClass('apply')){$('a.button',$giftCardForm).click();}else if($(this).hasClass('clear')){$('a.clear',$giftCardForm).click();}
$tooltip.hide();return false;});$paymentButtonContainer.append($paymentButton).append($tooltip).hover(function(){if(giftCardNotApplied()){$tooltip.show();}},function(){$tooltip.hide();});$($paymentForm).submit(function(){if(giftCardNotApplied())return false;});$('a.cvv-link',$paymentForm).hover(function(){var tdOffset=$(this).parent().offset();$cvvInfo.css({top:tdOffset.top-40,left:tdOffset.left-360}).show();},function(){$cvvInfo.hide();}).click(function(){return false;});$('a.clear',$giftCardForm).click(function(){$('input',$giftCardForm).val('');giftCardValidator.resetForm();return false;});$paymentTypes.hover(function(){$(this).addClass(hoverClass);},function(){$(this).removeClass(hoverClass);});function savedCardSelected(element){return $(element).closest('tr').find('input[name=accountTenderID]').is(':checked');}
function newCardSelected(element){var $checkedInput=$('input[name=accountTenderID]:checked');return $checkedInput.closest('div.method-new').length&&$checkedInput.closest('li').hasClass('paymenttype-card');}
function billMeLaterSelected(element){var $checkedInput=$('input[name=accountTenderID]:checked');return $checkedInput.closest('div.method-new').length&&$checkedInput.closest('li').hasClass('paymenttype-billmelater');}
function newAddressSelected(element){var $checkedInput=$('input[name=existingAddress]:checked');if($checkedInput.val()=='new-address'){return true;}else{return false;}}
function billingAddressIncluded(element){return newAddressSelected(element);}
function cardSecurityCodeLength(element){var thisID=$('input[name=accountTenderID]:checked').attr("id");if(thisID.indexOf('AmericanExpress')!=-1)return 4;else{var ccType=$("label[for='"+thisID+"']").text();return(ccType.indexOf('AX')!=-1)?4:3;}}
var paymentRules={};$('td.column-cvv input',$methodSaved).each(function(){paymentRules[this.name]={required:{depends:savedCardSelected},digits:{depends:savedCardSelected},exactLength:{param:cardSecurityCodeLength,depends:savedCardSelected}};});paymentRules.accountTenderID={required:true};$('input[name=accountTenderID]',$methodSaved).click(function(){$('label.error',$methodSaved).hide();$(this).closest('form').valid();});var creditCardRequiredFields='firstName lastName address1 city country state zip dayPhone'.split(' ');$.each(creditCardRequiredFields,function(){paymentRules[this]={required:{depends:billingAddressIncluded}};});paymentRules.zip.zip={depends:billingAddressIncluded};paymentRules.dayPhone.phone={depends:billingAddressIncluded};var creditCardRequiredFields='creditCardNumber creditCardExpirationMonth creditCardExpirationYear creditCardSecurityCode'.split(' ');$.each(creditCardRequiredFields,function(){paymentRules[this]={required:{depends:newCardSelected}};});paymentRules.creditCardNumber.creditcard={depends:newCardSelected};paymentRules.creditCardSecurityCode.exactLength={param:cardSecurityCodeLength,depends:newCardSelected};paymentRules.creditCardSecurityCode.digits={depends:newCardSelected};var billMeLaterRequiredFields='dobMonth dobDay dobYear ssn billMeLaterAgreeTerms billMeLaterAgreeTerms2'.split(' ');$.each(billMeLaterRequiredFields,function(){paymentRules[this]={required:{depends:billMeLaterSelected}};});paymentRules.ssn.digits={depends:billMeLaterSelected};paymentRules.ssn.exactLength={param:4,depends:billMeLaterSelected};var validationTriggeredByPageLoad=true;$paymentForm.validate({rules:paymentRules,invalidHandler:function(form,validator){if(validationTriggeredByPageLoad){validationTriggeredByPageLoad=false;}else{$paymentRadios.filter(':checked').closest('div.method').find('h3:first').click();}},messages:{accountTenderID:{required:"Please Select a Payment Method"}},errorPlacement:function(error,element){if(element.attr('name')=='accountTenderID'){$('#payment-method-error').empty();error.appendTo('#payment-method-error')}else error.insertAfter(element);}});function giftCardSelected(){return $paymentMethods.filter('.method-giftcard').hasClass(openClass);}
var giftCardRules={};var giftCardRequiredFields='giftCertificateNumber giftCertificatePin'.split(' ');$.each(giftCardRequiredFields,function(){giftCardRules[this]={required:{depends:giftCardSelected}};});var giftCardValidator=$giftCardForm.validate({rules:giftCardRules});$checkedPaymentRadio=$paymentRadios.filter(':checked').click();if(!$checkedPaymentRadio.length){var $savedPaymentRadios=$paymentMethods.filter('.method-saved').find('input[type="radio"][name="accountTenderID"]');if($savedPaymentRadios.length){$paymentMethods.filter('.method-saved').addClass(openClass);}else{$paymentMethods.filter('.method-new').addClass(openClass);}}
$checkedAddressRadios=$addressRadios.filter(':checked').click();},reviewInit:function(){WEBLINC.focusInputs.init($('input.hint'));}});var loadFlashVideo=function(el,videoPath)
{var $zoomContainers=$('.zoom-container'),$moreImagesZoomLinks=$('#panel-more-images ul li a.image'),$videosAndImageLinks=$('#panel-more-images ul li a');if($(el).hasClass('current'))return false;$videosAndImageLinks.removeClass('current');$(el).addClass('current');$videoDiv=$("#video-"+$(el).attr('id'));$videoDivContainer=$videoDiv.parent();if(!$(el).hasClass('clicked'))
{$(el).addClass('clicked');flashvars.videoPath=videoPath;swfobject.embedSWF(playerPath,$videoDiv.attr('id'),'100%',videoPlayerPublicOptions.playerHeight,'9.0.0',false,flashvars,params,attributes);}
$zoomContainers.hide();$videoDivContainer.fadeIn();return false;}
$.extend({scrollOpenTab:function($tagetTabSet,$targetTab,$targetZoom){$.scrollTo($tagetTabSet,{duration:400,offset:-60,onAfter:function(){$targetTab.trigger('click');if($targetZoom)
$targetZoom.trigger('click');}});},productDetailInit:function(){var $detailTabs=$('#detail-tabs').tabs(),$info=$('#product div.details div.info'),$links=$('div.links',$info),$image=$('div.image',$info),$moreImagesZoomLinks=$('#panel-more-images ul li a.image'),$videosAndImageLinks=$('#panel-more-images ul li a'),$zoomLinks=$('a.zoom-link, a.image-link',$image),$zoomContainers=$('.zoom-container'),$zoomedImage=$('#zoomed-image');$('div.col',$info).equalHeightColumns();$('div.purchase div.prices div.price-compare a',$info).click(function(){$.scrollOpenTab($detailTabs,$('#tab-compare-pricing a'))
return false;});$('a.more-images-link',$image).click(function(){$.scrollOpenTab($detailTabs,$('#tab-more-images a'));return false;});$zoomLinks.click(function(){$.scrollOpenTab($detailTabs,$('#tab-more-images a'),$moreImagesZoomLinks.filter(':first'));return false;});$('#product a.pr-snippet-link').live('click',function(){$.scrollOpenTab($detailTabs,$('#tab-reviews a'));return false;});$moreImagesZoomLinks.click(function(){if($(this).hasClass('current'))return false;$videosAndImageLinks.removeClass('current');$(this).addClass('current');$zoomedImage.addClass('loading');var imageToLoad=new Image();$(imageToLoad).load(function(){$this=$(this);$this.hide();$zoomedImage.removeClass('loading').find('img').replaceWith(this);$this.fadeIn();}).error(function(){$zoomedImage.removeClass('loading').find('img').replaceWith('<p>There was a problem loading your image.</p>');}).attr('src',this.href);$zoomContainers.hide();$zoomedImage.fadeIn();return false;});$('div.print-page a',$links).click(function(){window.print();return false;});$('#product div.savings-club-terms a').click(function(e){e.preventDefault();$.scrollOpenTab($detailTabs,$('#tab-terms a'));});$('div.share-this',$links).hover(function(){$(this).find('> ul').show();},function(){$(this).find('> ul').hide();});}});$.extend({productBrowseInit:function(){var $lineItems=$('#content-container div.products-list table.lineitems')
$itemCheckboxes=$('tbody td.column-select input.input-checkbox',$lineItems);$('thead th.column-select a.button',$lineItems).click(function(){var $selectAllInput=$('thead th.column-select .select-all',$lineItems),selectAll=$selectAllInput.val(),thisTxt=$.trim($('span',this).text());if(selectAll==0)
{$itemCheckboxes.attr('checked','checked');$selectAllInput.val(1);$('span',this).html(thisTxt.replace(/Select All/,'Deselect All')+'<i/><span/>');}
else
{$itemCheckboxes.attr('checked','');$selectAllInput.val(0);$('span',this).html(thisTxt.replace(/Deselect All/,'Select All')+'<i/><span/>');}
return false;});$.selectMultipleProductsInit();},submitForm:function($this,fuseactionVariable)
{var $thisForm=$this.closest('form');$('input[name=fuseaction]',$thisForm).val(fuseactionVariable);$thisForm.submit();},validateAndSubmit:function($this,fuseactionVariable,message){if($this.hasClass('single-product')){$itemCheckboxes.attr('checked','');$this.closest('tr').find('td.column-select input.input-checkbox').attr('checked','checked');}
if($itemCheckboxes.filter(':checked').length){submitForm($this,fuseactionVariable);}else{alert(message);}},selectMultipleProductsInit:function(){var cookieOptions={path:'/',domain:window.location.host};$('div.products-list input[name=productIDs]').click(function(){var $this=$(this),currentCookie=$.cookie('SELECTEDPRODUCTIDS'),productIds=currentCookie?currentCookie.split(','):[],productId=$this.val();if($this.is(':checked'))
{if($.inArray(productId,productIds)<0)
{productIds.push(productId);}}
else
{productIds=$.grep(productIds,function(id){return id!==productId;});}
$.cookie('SELECTEDPRODUCTIDS',productIds.join(),cookieOptions);});}});$(document).ready(function(){var speed=5000,pauseTime=1000000,startpos=0,timer=0;var hero=$('#content div.rotating-hero'),imgWrap=$("div.images",hero),imgLen=$("img",imgWrap).length,counter=$('<ul class="co-nav"></ul>');if(imgLen>1){hero.prepend(counter);for(i=1;i<=imgLen;i++){$(counter).append('<li><a class="image-index" href="#">'+i+'</a></li>');};$(counter).append('<li><a class="rotator-control" href="#"><span>Play/Pause</span></a></li>');};$("ul.co-nav li:first",hero).addClass("first");$("ul.co-nav li:last",hero).addClass("last");$("ul.co-nav a.image-index",hero).hover(function(){var matchIndex=$("ul.co-nav li a.image-index",hero).index(this);clearTimeout(timer);$("a",imgWrap).hide();$("a:eq("+matchIndex+")",imgWrap).show();$("ul.co-nav a",hero).removeClass("active");$(this).addClass("active");$("ul.co-nav a.rotator-control",hero).removeClass("rotator-play");},function(){var matchIndex=$("ul.co-nav li a",hero).index(this);timer=setTimeout("rotateKeepAlive("+matchIndex+")",speed);});$("ul.co-nav a.rotator-control",hero).click(function(){var buttonCurrent=$(this).attr("class");if(buttonCurrent=='rotator-control')
{clearTimeout(timer);var matchIndex=$("ul.co-nav li").index($("ul.co-nav > li:has(a.active)"));timer=setTimeout("rotateKeepAlive("+matchIndex+")",pauseTime);$(this).addClass("rotator-play");}
else
{clearTimeout(timer);var matchIndex=$("ul.co-nav li").index($("ul.co-nav > li:has(a.active)"));timer=setTimeout("rotateKeepAlive("+matchIndex+")",speed);$(".rotator-control").removeClass("rotator-play");}
return false;});$("ul.co-nav a",hero).click(function(){return false;});rotateCallouts=function(current)
{var numLen=$("ul.co-nav li a",hero).length,newPos=current+1;$("a",imgWrap).hide();$("ul.co-nav a.active",hero).removeClass("active");if(newPos==imgLen||newPos==numLen)
{newPos=startpos;$("a:eq(0)",imgWrap).show();$("ul.co-nav li:eq(0) a",hero).addClass("active");}
else
{$("a:eq("+newPos+")",imgWrap).show();$("ul.co-nav li:eq("+newPos+") a",hero).addClass("active");}
timer=setTimeout("rotateKeepAlive("+newPos+")",speed);}
rotateKeepAlive=function(lastPos)
{clearTimeout(timer);rotateCallouts(lastPos);}
rotateCallouts(startpos-1);});

