var itemList=[],origHeight=290,origWidth=220,smlHeight=244,smlWidth=185;function mycarousel_itemFirstInCallback(carousel,item,i,state){if(state=='init'){jQuery('img',item).css({width:smlWidth,height:smlHeight,"opacity":0.4,"margin-top":18});jQuery(item).next().addClass("jcarousel-item-active");}};function mycarousel_itemLastInCallback(carousel,item,i,state){if(state=='init'){jQuery('img',item).css({width:smlWidth,height:smlHeight,"opacity":0.4,"margin-top":18});}};function mycarousel_itemVisibleInCallback(carousel,item,i,state,evt){var idx=carousel.index(i,itemList.length);carousel.add(i,mycarousel_getItemHTML(itemList[idx-1]));if(state=='init')
return;if(state=='next'){jQuery(".jcarousel-item-"+(i-1)+" img").animate({width:origWidth,height:origHeight,"opacity":1,"margin-top":0},{duration:300});jQuery(".jcarousel-item-"+(i-1)+" .product-details").fadeIn(350);jQuery(".jcarousel-item-"+(i-2)+" img").animate({width:smlWidth,height:smlHeight,"opacity":0.4,"margin-top":18},{duration:300});jQuery(".jcarousel-item-"+(i-2)+" .product-details").fadeOut(350);}
if(state=='prev'){jQuery(".jcarousel-item-"+(i+1)+" img").animate({width:origWidth,height:origHeight,"opacity":1,"margin-top":0},{duration:300});jQuery(".jcarousel-item-"+(i+1)+" .product-details").fadeIn(350);jQuery(".jcarousel-item-"+(i+2)+" img").animate({width:smlWidth,height:smlHeight,"opacity":0.4,"margin-top":18},{duration:300});jQuery(".jcarousel-item-"+(i+2)+" .product-details").fadeOut(350);}
jQuery('img',item).css({width:smlWidth,height:smlHeight,"opacity":0.4,"margin-top":18});};function mycarousel_itemVisibleOutCallback(carousel,item,i,state,evt){carousel.remove(i);};function mycarousel_getItemHTML(item){return item;};jQuery(document).ready(function(){jQuery("option:first","select#search-recipient").remove();jQuery("#cat-search-submit").click(function(e){e.preventDefault();window.location=jQuery("#cat-search-list").val()+"?recipient="+jQuery("#search-recipient").val();});jQuery('#product_carousel li').each(function(index){itemList.push(jQuery(this).html());});jQuery('#product_carousel').jcarousel({wrap:'circular',scroll:1,itemFirstInCallback:mycarousel_itemFirstInCallback,itemLastInCallback:mycarousel_itemLastInCallback,itemVisibleInCallback:{onBeforeAnimation:mycarousel_itemVisibleInCallback},itemVisibleOutCallback:{onAfterAnimation:mycarousel_itemVisibleOutCallback}});});
