(function($){$(document).ready(function(){$('.cloud-zoom, .cloud-zoom-gallery').CloudZoom();});function format(str){for(var i=1;i<arguments.length;i++){str=str.replace('%'+(i-1),arguments[i]);}
return str;}
function CloudZoom(jWin,opts){var sImg=$('img',jWin);var img1;var img2;var zoomDiv=null;var $mouseTrap=null;var lens=null;var $tint=null;var softFocus=null;var $ie6Fix=null;var zoomImage;var controlTimer=0;var cw,ch;var destU=0;var destV=0;var currV=0;var currU=0;var filesLoaded=0;var mx,my;var ctx=this,zw;setTimeout(function(){if($mouseTrap===null){var w=jWin.width();jWin.parent().append(format('<div style="width:%0px;position:absolute;top:50%;left:%1px;text-align:center;height:30px;" class="cloud-zoom-loading" >Loading...</div>',w/3,(w/2)-(w/6))).find(':last').css('opacity',0.5);}},200);var ie6FixRemove=function(){if($ie6Fix!==null){$ie6Fix.remove();$ie6Fix=null;}};this.removeBits=function(){if(lens){lens.remove();lens=null;}
if($tint){$tint.remove();$tint=null;}
if(softFocus){softFocus.remove();softFocus=null;}
ie6FixRemove();$('.cloud-zoom-loading',jWin.parent()).remove();};this.destroy=function(){jWin.data('zoom',null);if($mouseTrap){$mouseTrap.unbind();$mouseTrap.remove();$mouseTrap=null;}
if(zoomDiv){zoomDiv.remove();zoomDiv=null;}
this.removeBits();};this.fadedOut=function(){if(zoomDiv){zoomDiv.remove();zoomDiv=null;}
this.removeBits();};this.controlLoop=function(){if(lens){var x=(mx-sImg.offset().left-(cw*0.5))>>0;var y=(my-sImg.offset().top-(ch*0.5))>>0;if(x<0){x=0;}
else if(x>(sImg.outerWidth()-cw)){x=(sImg.outerWidth()-cw);}
if(y<0){y=0;}
else if(y>(sImg.outerHeight()-ch)){y=(sImg.outerHeight()-ch);}
lens.css({left:x,top:y});lens.css('background-position',(-x)+'px '+(-y)+'px');destU=(((x)/sImg.outerWidth())*zoomImage.width)>>0;destV=(((y)/sImg.outerHeight())*zoomImage.height)>>0;currU+=(destU-currU)/opts.smoothMove;currV+=(destV-currV)/opts.smoothMove;zoomDiv.css('background-position',(-(currU>>0)+'px ')+(-(currV>>0)+'px'));}
controlTimer=setTimeout(function(){ctx.controlLoop();},30);};this.init2=function(img,id){filesLoaded++;if(id===1){zoomImage=img;}
if(filesLoaded===2){this.init();}};this.init=function(){$('.cloud-zoom-loading',jWin.parent()).remove();$mouseTrap=jWin.parent().append(format("<div class='mousetrap' style='background-image:url(\".\");z-index:999;position:absolute;width:%0px;height:%1px;left:%2px;top:%3px;\'></div>",sImg.outerWidth(),sImg.outerHeight(),0,0)).find(':last');$mouseTrap.bind('mousemove',this,function(event){mx=event.pageX;my=event.pageY;});$mouseTrap.bind('mouseleave',this,function(event){clearTimeout(controlTimer);if(lens){lens.fadeOut(299);}
if($tint){$tint.fadeOut(299);}
if(softFocus){softFocus.fadeOut(299);}
zoomDiv.fadeOut(300,function(){ctx.fadedOut();});return false;});$mouseTrap.bind('mouseenter',this,function(event){mx=event.pageX;my=event.pageY;zw=event.data;if(zoomDiv){zoomDiv.stop(true,false);zoomDiv.remove();}
var xPos=opts.adjustX,yPos=opts.adjustY;var siw=sImg.outerWidth();var sih=sImg.outerHeight();var w=opts.zoomWidth;var h=opts.zoomHeight;if(opts.zoomWidth=='auto'){w=siw;}
if(opts.zoomHeight=='auto'){h=sih;}
var appendTo=jWin.parent();switch(opts.position){case'top':yPos-=h;break;case'right':xPos+=siw;break;case'bottom':yPos+=sih;break;case'left':xPos-=w;break;case'inside':w=siw;h=sih;break;default:appendTo=$('#'+opts.position);if(!appendTo.length){appendTo=jWin;xPos+=siw;yPos+=sih;}else{w=appendTo.innerWidth();h=appendTo.innerHeight();}}
zoomDiv=appendTo.append(format('<div id="cloud-zoom-big" class="cloud-zoom-big" style="display:none;position:absolute;width:%2px;height:%3px;background-image:url(\'%4\');z-index:99;"></div>',xPos,yPos,w,h,zoomImage.src)).find(':last');if(sImg.attr('title')&&opts.showTitle){zoomDiv.append(format('<div class="cloud-zoom-title">%0</div>',sImg.attr('title'))).find(':last').css('opacity',opts.titleOpacity);}
if($.browser.msie&&$.browser.version<7){$ie6Fix=$('<iframe frameborder="0" src="#"></iframe>').css({position:"absolute",left:xPos,top:yPos,zIndex:99,width:w,height:h}).insertBefore(zoomDiv);}
zoomDiv.fadeIn(500);if(lens){lens.remove();lens=null;}
cw=(sImg.outerWidth()/zoomImage.width)*zoomDiv.width();ch=(sImg.outerHeight()/zoomImage.height)*zoomDiv.height();lens=jWin.append(format("<div class = 'cloud-zoom-lens' style='display:none;z-index:98;position:absolute;width:%0px;height:%1px;'></div>",cw,ch)).find(':last');$mouseTrap.css('cursor',lens.css('cursor'));var noTrans=false;if(opts.tint){lens.css('background','url("'+sImg.attr('src')+'")');$tint=jWin.append(format('<div style="display:none;position:absolute; left:0px; top:0px; width:%0px; height:%1px; background-color:%2;" />',sImg.outerWidth(),sImg.outerHeight(),opts.tint)).find(':last');$tint.css('opacity',opts.tintOpacity);noTrans=true;$tint.fadeIn(500);}
if(opts.softFocus){lens.css('background','url("'+sImg.attr('src')+'")');softFocus=jWin.append(format('<div style="position:absolute;display:none;top:2px; left:2px; width:%0px; height:%1px;" />',sImg.outerWidth()-2,sImg.outerHeight()-2,opts.tint)).find(':last');softFocus.css('background','url("'+sImg.attr('src')+'")');softFocus.css('opacity',0.5);noTrans=true;softFocus.fadeIn(500);}
if(!noTrans){lens.css('opacity',opts.lensOpacity);}
if(opts.position!=='inside'){lens.fadeIn(500);}
zw.controlLoop();return;});};img1=new Image();$(img1).load(function(){ctx.init2(this,0);});img1.src=sImg.attr('src');img2=new Image();$(img2).load(function(){ctx.init2(this,1);});img2.src=jWin.attr('href');}
$.fn.CloudZoom=function(options){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}
this.each(function(){var relOpts,opts;var a={};if(typeof $(this).attr('rel')!=='undefined'){eval('var a = {'+$(this).attr('rel')+'}');}
relOpts=a;if($(this).is('.cloud-zoom')){$(this).css({'position':'relative','display':'block'});$('img',$(this)).css({'display':'block'});if($(this).parent().attr('id')!='wrap'){$(this).wrap('<div id="wrap" style="top:0px;z-index:9999;position:relative;"></div>');}
opts=$.extend({},$.fn.CloudZoom.defaults,options);opts=$.extend({},opts,relOpts);$(this).data('zoom',new CloudZoom($(this),opts));}else if($(this).is('.cloud-zoom-gallery')){opts=$.extend({},relOpts,options);$(this).data('relOpts',opts);$(this).bind('click',$(this),function(event){var data=event.data.data('relOpts');$('#'+data.useZoom).data('zoom').destroy();$('#'+data.useZoom).attr('href',event.data.attr('href'));$('#'+data.useZoom+' img').attr('src',event.data.data('relOpts').smallImage);$('#'+event.data.data('relOpts').useZoom).CloudZoom();return event.preventDefault();});}});return this;};$.fn.CloudZoom.defaults={zoomWidth:'392px',zoomHeight:'392px',position:'inside',tint:false,tintOpacity:0.5,lensOpacity:0.5,softFocus:false,smoothMove:5,showTitle:false,titleOpacity:0.5,adjustX:0,adjustY:0};})(jQuery);;if(jQuery)(function($){$.extend($.fn,{selectBox:function(method,data){var typeTimer,typeSearch='';var init=function(select,data){if(navigator.userAgent.match(/iPad|iPhone|Android/i))return false;if(select.tagName.toLowerCase()!=='select')return false;select=$(select);if(select.data('selectBox-control'))return false;var control=$('<a class="selectBox" />'),inline=select.attr('multiple')||parseInt(select.attr('size'))>1;var settings=data||{};if(settings.autoWidth===undefined)settings.autoWidth=true;control.addClass(select.attr('class')).attr('style',select.attr('style')||'').attr('title',select.attr('title')||'').attr('tabindex',parseInt(select.attr('tabindex'))).css('display','inline-block').bind('focus.selectBox',function(){if(this!==document.activeElement)$(document.activeElement).blur();if(control.hasClass('selectBox-active'))return;control.addClass('selectBox-active');select.trigger('focus');}).bind('blur.selectBox',function(){if(!control.hasClass('selectBox-active'))return;control.removeClass('selectBox-active');select.trigger('blur');});if(select.attr('disabled'))control.addClass('selectBox-disabled');if(inline){var options=getOptions(select,'inline');control.append(options).data('selectBox-options',options).addClass('selectBox-inline').addClass('selectBox-menuShowing').bind('keydown.selectBox',function(event){handleKeyDown(select,event);}).bind('keypress.selectBox',function(event){handleKeyPress(select,event);}).bind('mousedown.selectBox',function(event){if($(event.target).is('A.selectBox-inline'))event.preventDefault();if(!control.hasClass('selectBox-focus'))control.focus();}).insertAfter(select);if(!select[0].style.height){var size=select.attr('size')?parseInt(select.attr('size')):5;var tmp=control.clone().removeAttr('id').css({position:'absolute',top:'-9999em'}).show().appendTo('body');tmp.find('.selectBox-options').html('<li><a>\u00A0</a></li>');optionHeight=parseInt(tmp.find('.selectBox-options A:first').html('&nbsp;').outerHeight());tmp.remove();control.height(optionHeight*size);}
disableSelection(control);}else{var label=$('<span class="selectBox-label" />'),arrow=$('<span class="selectBox-arrow" />');label.text($(select).find('OPTION:selected').text()||'\u00A0');var options=getOptions(select,'dropdown');options.appendTo('BODY');control.data('selectBox-options',options).addClass('selectBox-dropdown').append(label).append(arrow).bind('mousedown.selectBox',function(event){if(control.hasClass('selectBox-menuShowing')){hideMenus();}else{event.stopPropagation();options.data('selectBox-down-at-x',event.screenX).data('selectBox-down-at-y',event.screenY);showMenu(select);}}).bind('keydown.selectBox',function(event){handleKeyDown(select,event);}).bind('keypress.selectBox',function(event){handleKeyPress(select,event);}).insertAfter(select);disableSelection(control);}
select.addClass('selectBox').data('selectBox-control',control).data('selectBox-settings',settings).hide();};var getOptions=function(select,type){var options;switch(type){case'inline':options=$('<ul class="selectBox-options" />');if(select.find('OPTGROUP').length){select.find('OPTGROUP').each(function(){var optgroup=$('<li class="selectBox-optgroup" />');optgroup.text($(this).attr('label'));options.append(optgroup);$(this).find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li);});});}else{select.find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li);});}
options.find('A').bind('mouseover.selectBox',function(event){addHover(select,$(this).parent());}).bind('mouseout.selectBox',function(event){removeHover(select,$(this).parent());}).bind('mousedown.selectBox',function(event){event.preventDefault();if(!select.selectBox('control').hasClass('selectBox-active'))select.selectBox('control').focus();}).bind('mouseup.selectBox',function(event){hideMenus();selectOption(select,$(this).parent(),event);});disableSelection(options);return options;case'dropdown':options=$('<ul class="selectBox-dropdown-menu selectBox-options" />');if(select.find('OPTGROUP').length){select.find('OPTGROUP').each(function(){var optgroup=$('<li class="selectBox-optgroup" />');optgroup.text($(this).attr('label'));options.append(optgroup);$(this).find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li);});});}else{if(select.find('OPTION').length>0){select.find('OPTION').each(function(){var li=$('<li />'),a=$('<a />');li.addClass($(this).attr('class'));a.attr('rel',$(this).val()).text($(this).text());li.append(a);if($(this).attr('disabled'))li.addClass('selectBox-disabled');if($(this).attr('selected'))li.addClass('selectBox-selected');options.append(li);});}else{options.append('<li>\u00A0</li>');}}
options.data('selectBox-select',select).css('display','none').appendTo('BODY').find('A').bind('mousedown.selectBox',function(event){event.preventDefault();if(event.screenX===options.data('selectBox-down-at-x')&&event.screenY===options.data('selectBox-down-at-y')){options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y');hideMenus();}}).bind('mouseup.selectBox',function(event){if(event.screenX===options.data('selectBox-down-at-x')&&event.screenY===options.data('selectBox-down-at-y')){return;}else{options.removeData('selectBox-down-at-x').removeData('selectBox-down-at-y');}
selectOption(select,$(this).parent());hideMenus();}).bind('mouseover.selectBox',function(event){addHover(select,$(this).parent());}).bind('mouseout.selectBox',function(event){removeHover(select,$(this).parent());});disableSelection(options);return options;}};var destroy=function(select){select=$(select);var control=select.data('selectBox-control');if(!control)return;var options=control.data('selectBox-options');options.remove();control.remove();select.removeClass('selectBox').removeData('selectBox-control').removeData('selectBox-settings').show();};var showMenu=function(select){select=$(select);var control=select.data('selectBox-control'),settings=select.data('selectBox-settings'),options=control.data('selectBox-options');if(control.hasClass('selectBox-disabled'))return false;hideMenus();if(settings.autoWidth){options.css('width',control.innerWidth());}else if(options.innerWidth()<control.innerWidth()){options.css('width',control.innerWidth()-parseInt(options.css('padding-left'))-parseInt(options.css('padding-right')));}
options.css({top:control.offset().top+control.outerHeight()-(parseInt(control.css('borderBottomWidth'))),left:control.offset().left});switch(settings.menuTransition){case'fade':options.fadeIn(settings.menuSpeed);break;case'slide':options.slideDown(settings.menuSpeed);break;default:options.show(settings.menuSpeed);break;}
var li=options.find('.selectBox-selected:first');keepOptionInView(select,li,true);addHover(select,li);control.addClass('selectBox-menuShowing');$(document).bind('mousedown.selectBox',function(event){if($(event.target).parents().andSelf().hasClass('selectBox-options'))return;hideMenus();});};var hideMenus=function(){if($(".selectBox-dropdown-menu").length===0)return;$(document).unbind('mousedown.selectBox');$(".selectBox-dropdown-menu").each(function(){var options=$(this),select=options.data('selectBox-select'),control=select.data('selectBox-control'),settings=select.data('selectBox-settings');switch(settings.menuTransition){case'fade':options.fadeOut(settings.menuSpeed);break;case'slide':options.slideUp(settings.menuSpeed);break;default:options.hide(settings.menuSpeed);break;}
control.removeClass('selectBox-menuShowing');});};var selectOption=function(select,li,event){select=$(select);li=$(li);var control=select.data('selectBox-control'),settings=select.data('selectBox-settings');if(control.hasClass('selectBox-disabled'))return false;if(li.length===0||li.hasClass('selectBox-disabled'))return false;if(select.attr('multiple')){if(event.shiftKey&&control.data('selectBox-last-selected')){li.toggleClass('selectBox-selected');var affectedOptions;if(li.index()>control.data('selectBox-last-selected').index()){affectedOptions=li.siblings().slice(control.data('selectBox-last-selected').index(),li.index());}else{affectedOptions=li.siblings().slice(li.index(),control.data('selectBox-last-selected').index());}
affectedOptions=affectedOptions.not('.selectBox-optgroup, .selectBox-disabled');if(li.hasClass('selectBox-selected')){affectedOptions.addClass('selectBox-selected');}else{affectedOptions.removeClass('selectBox-selected');}}else if(event.metaKey){li.toggleClass('selectBox-selected');}else{li.siblings().removeClass('selectBox-selected');li.addClass('selectBox-selected');}}else{li.siblings().removeClass('selectBox-selected');li.addClass('selectBox-selected');}
if(control.hasClass('selectBox-dropdown')){control.find('.selectBox-label').text(li.text());}
var i=0,selection=[];if(select.attr('multiple')){control.find('.selectBox-selected A').each(function(){selection[i++]=$(this).attr('rel');});}else{selection=li.find('A').attr('rel');}
control.data('selectBox-last-selected',li);if(select.val()!==selection){select.val(selection);select.trigger('change');}
return true;};var addHover=function(select,li){select=$(select);li=$(li);var control=select.data('selectBox-control'),options=control.data('selectBox-options');options.find('.selectBox-hover').removeClass('selectBox-hover');li.addClass('selectBox-hover');};var removeHover=function(select,li){select=$(select);li=$(li);var control=select.data('selectBox-control'),options=control.data('selectBox-options');options.find('.selectBox-hover').removeClass('selectBox-hover');};var keepOptionInView=function(select,li,center){if(!li||li.length===0)return;select=$(select);var control=select.data('selectBox-control'),options=control.data('selectBox-options'),scrollBox=control.hasClass('selectBox-dropdown')?options:options.parent(),top=parseInt(li.offset().top-scrollBox.position().top),bottom=parseInt(top+li.outerHeight());if(center){scrollBox.scrollTop(li.offset().top-scrollBox.offset().top+scrollBox.scrollTop()-(scrollBox.height()/2));}else{if(top<0){scrollBox.scrollTop(li.offset().top-scrollBox.offset().top+scrollBox.scrollTop());}
if(bottom>scrollBox.height()){scrollBox.scrollTop((li.offset().top+li.outerHeight())-scrollBox.offset().top+scrollBox.scrollTop()-scrollBox.height());}}};var handleKeyDown=function(select,event){select=$(select);var control=select.data('selectBox-control'),options=control.data('selectBox-options'),totalOptions=0,i=0;if(control.hasClass('selectBox-disabled'))return;switch(event.keyCode){case 8:event.preventDefault();typeSearch='';break;case 9:case 27:hideMenus();removeHover(select);break;case 13:if(control.hasClass('selectBox-menuShowing')){selectOption(select,options.find('LI.selectBox-hover:first'),event);if(control.hasClass('selectBox-dropdown'))hideMenus();}else{showMenu(select);}
break;case 38:case 37:event.preventDefault();if(control.hasClass('selectBox-menuShowing')){var prev=options.find('.selectBox-hover').prev('LI');totalOptions=options.find('LI:not(.selectBox-optgroup)').length;i=0;while(prev.length===0||prev.hasClass('selectBox-disabled')||prev.hasClass('selectBox-optgroup')){prev=prev.prev('LI');if(prev.length===0)prev=options.find('LI:last');if(++i>=totalOptions)break;}
addHover(select,prev);keepOptionInView(select,prev);}else{showMenu(select);}
break;case 40:case 39:event.preventDefault();if(control.hasClass('selectBox-menuShowing')){var next=options.find('.selectBox-hover').next('LI');totalOptions=options.find('LI:not(.selectBox-optgroup)').length;i=0;while(next.length===0||next.hasClass('selectBox-disabled')||next.hasClass('selectBox-optgroup')){next=next.next('LI');if(next.length===0)next=options.find('LI:first');if(++i>=totalOptions)break;}
addHover(select,next);keepOptionInView(select,next);}else{showMenu(select);}
break;}};var handleKeyPress=function(select,event){select=$(select);var control=select.data('selectBox-control'),options=control.data('selectBox-options');if(control.hasClass('selectBox-disabled'))return;switch(event.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:if(!control.hasClass('selectBox-menuShowing'))showMenu(select);event.preventDefault();clearTimeout(typeTimer);typeSearch+=String.fromCharCode(event.charCode||event.keyCode);options.find('A').each(function(){if($(this).text().substr(0,typeSearch.length).toLowerCase()===typeSearch.toLowerCase()){addHover(select,$(this).parent());keepOptionInView(select,$(this).parent());return false;}});typeTimer=setTimeout(function(){typeSearch='';},1000);break;}};var enable=function(select){select=$(select);select.attr('disabled',false);var control=select.data('selectBox-control');if(!control)return;control.removeClass('selectBox-disabled');};var disable=function(select){select=$(select);select.attr('disabled',true);var control=select.data('selectBox-control');if(!control)return;control.addClass('selectBox-disabled');};var setValue=function(select,value){select=$(select);select.val(value);value=select.val();var control=select.data('selectBox-control');if(!control)return;var settings=select.data('selectBox-settings'),options=control.data('selectBox-options');control.find('.selectBox-label').text($(select).find('OPTION:selected').text()||'\u00A0');options.find('.selectBox-selected').removeClass('selectBox-selected');options.find('A').each(function(){if(typeof(value)==='object'){for(var i=0;i<value.length;i++){if($(this).attr('rel')==value[i]){$(this).parent().addClass('selectBox-selected');}}}else{if($(this).attr('rel')==value){$(this).parent().addClass('selectBox-selected');}}});if(settings.change)settings.change.call(select);};var setOptions=function(select,options){select=$(select);var control=select.data('selectBox-control'),settings=select.data('selectBox-settings');switch(typeof(data)){case'string':select.html(data);break;case'object':select.html('');for(var i in data){if(data[i]===null)continue;if(typeof(data[i])==='object'){var optgroup=$('<optgroup label="'+i+'" />');for(var j in data[i]){optgroup.append('<option value="'+j+'">'+data[i][j]+'</option>');}
select.append(optgroup);}else{var option=$('<option value="'+i+'">'+data[i]+'</option>');select.append(option);}}
break;}
if(!control)return;control.data('selectBox-options').remove();var type=control.hasClass('selectBox-dropdown')?'dropdown':'inline',options=getOptions(select,type);control.data('selectBox-options',options);switch(type){case'inline':control.append(options);break;case'dropdown':control.find('.selectBox-label').text($(select).find('OPTION:selected').text()||'\u00A0');$("BODY").append(options);break;}};var disableSelection=function(selector){$(selector).css('MozUserSelect','none').bind('selectstart',function(event){event.preventDefault();});};switch(method){case'control':return $(this).data('selectBox-control');break;case'settings':if(!data)return $(this).data('selectBox-settings');$(this).each(function(){$(this).data('selectBox-settings',$.extend(true,$(this).data('selectBox-settings'),data));});break;case'options':$(this).each(function(){setOptions(this,data);});break;case'value':if(!data)return $(this).val();$(this).each(function(){setValue(this,data);});break;case'enable':$(this).each(function(){enable(this);});break;case'disable':$(this).each(function(){disable(this);});break;case'destroy':$(this).each(function(){destroy(this);});break;default:$(this).each(function(){init(this,method);});break;}
return $(this);}});})(jQuery);;jQuery(document).ready(function(){if(jQuery.browser.webkit){jQuery(".nav-container #custommenu .menu .parentMenu a span").css("letter-spacing","-1px");}
jQuery(".scrollable").scrollable({vertical:true,mousewheel:true});jQuery("#recently-viewed").scrollable().navigator();jQuery(".photozoom button[rel]").overlay({mask:'#000'});jQuery(".playvideo a[rel]").overlay({mask:'#000',effect:'apple'});jQuery(".photozoom button[rel]").live("click",function(e){jQuery("#image_overlay").attr("src",jQuery("#image").attr("src"));e.preventDefault();});jQuery(".items .item").live("click",function(e){if(!jQuery(this).hasClass("current")){jQuery(".items .item").each(function(){jQuery(this).removeClass("current");});jQuery(this).addClass("current");}
e.preventDefault();});jQuery(".selectBox").selectBox();jQuery("ul.tabs").tabs("div.panes > div");jQuery(".informations_fiche ul li.size").overlay({mask:'#000'});jQuery("#sizefit_content_link").overlay({mask:'#000'});jQuery(".catalog-product-view .add-to-cart-box button").click(function(){var canSend=true;jQuery("select.super-attribute-select").each(function(){if(!jQuery(this).val()){canSend=false;if(!jQuery(this).parent().find('a.super-attribute-select').hasClass('validation-failed')){jQuery(this).parent().find('a.super-attribute-select').addClass('validation-failed');}}});if(canSend){productAddToCartForm.submit();}});});;jQuery.noConflict();;function wpShowMenuPopup(objMenu,popupId)
{objMenu=$(objMenu.id);var popup=$(popupId);if(!popup)return;popup.style.display='block';objMenu.addClassName('active');var popupWidth=CUSTOMMENU_POPUP_WIDTH;if(!popupWidth)popupWidth=popup.getWidth();var pos=wpPopupPos(objMenu,popupWidth);popup.style.top=pos.top+'px';popup.style.left=pos.left+'px';if(CUSTOMMENU_POPUP_WIDTH)popup.style.width=CUSTOMMENU_POPUP_WIDTH+'px';}
function wpPopupPos(objMenu,w)
{var pos=objMenu.cumulativeOffset();var wraper=$('custommenu');var posWraper=wraper.cumulativeOffset();var wWraper=wraper.getWidth()-CUSTOMMENU_POPUP_RIGHT_OFFSET_MIN;var xTop=pos.top-posWraper.top+CUSTOMMENU_POPUP_TOP_OFFSET;var xLeft=pos.left-posWraper.left;if((xLeft+w)>wWraper)xLeft=wWraper-w;return{'top':xTop,'left':0};}
function wpHideMenuPopup(element,event,popupId,menuId)
{element=$(element.id);var popup=$(popupId);if(!popup)return;var current_mouse_target=null;if(event.toElement)
{current_mouse_target=event.toElement;}
else if(event.relatedTarget)
{current_mouse_target=event.relatedTarget;}
if(!wpIsChildOf(element,current_mouse_target)&&element!=current_mouse_target)
{if(!wpIsChildOf(popup,current_mouse_target)&&popup!=current_mouse_target)
{popup.style.display='none';$(menuId).removeClassName('active');}}}
function wpIsChildOf(parent,child)
{if(child!=null)
{while(child.parentNode)
{if((child=child.parentNode)==parent)
{return true;}}}
return false;}
