/*HEADER MENU ***************** */ var use_lvm, loadFirst, isFBShop = (location.href.indexOf('/fbshop/')>0); $("#pageWidth .hproduct a:not(.ArticleBuyInfoRow a)").live('click',function(e){ e.preventDefault(); }); $(function(){ isFBShop = ($("#pageWidth, #cartWidth").length>0); //- $("#pageWidth .hproduct a:not(.ArticleBuyInfoRow a, #pageWidth .productPane a, #pageWidth a.addFavorite, #pageWidth a.removeFavorite)").live('click',function(e){ var pane=$(this).closest(".hproduct").find(".productPane"); $("#glassesZoom").hide(); $(".productPane").slideUp(); if (!pane.length){ var prdId=$(this).closest(".hproduct").attr("id"); loadProduct(this,prdId); } else if (!pane.is(":animated")){ pane.slideDown(); } }); jQuery(".closeSveaPop").click(function(){ jQuery(this).closest(".paymentPop").css("visibility", "hidden"); }); jQuery(".closeSveaSsnPop").click(function(){ document.getElementById('orgNo').value = jQuery('#birthDateStrday')[0].value+jQuery('#birthDateStrmonth')[0].value+jQuery('#birthDateStryear')[0].value.substring(2,4)+$('.ssnPop input').attr('value') document.getElementById('nationalId').value = document.getElementById('ssnPopupInput').value if(checkAddressForm()) { jQuery(this).closest(".ssnPop").css("visibility", "hidden"); submitOrder(true); } }); jQuery(".copyAddressPop").click(function(){ jQuery(this).closest(".paymentPop").css("visibility", "hidden"); if (sveaAddressJson != null) { jQuery.each(sveaAddressJson, addressFieldSetter); document.getElementById('usedomicile').value="true"; submitOrder(true); } }); jQuery(".setInitialsPop").click(function(){ jQuery(this).closest(".paymentPop").css("visibility", "hidden"); document.getElementById('initials').value=document.getElementById('initialsBox').value; submitOrder(true); }); $("#sortings").submit(function(){ refilter(true, this); return false; }); $("#sortings #searchboxIcon").click(function(){ $("#sortings").submit(); }); $("#verticalMenuList a, #verticalMenuList2 a, #horizontalMenuList a, #submenus a").live('click',function(){ if (this.href.indexOf("/products")>=0){ $("#searchkeeper").attr("value",""); $("#input").attr("value","").blur(); $("#type").remove(); var params=jQuery(document.forms.filters).serialize(); params=params.replace(/productType\d*=\w*&*/g,''); refilter(true,(''+this.href.match(/productType=\w*/g)).replace(',', '&')+'&'+params); return false; } }); $("#favoritesLink").click(function(e){ $("#horizontalMenuList li.selected").removeClass("selected"); e.preventDefault(); loadFavs(); }); adjustProdList(); $("#pageWidth").css("bottom",0); //window.onresize=adjustProdList; cartAddMenu=$("#addAndFlashContainer"); if (cartAddMenu.length){ $(window).scroll(floatAddAndFlash); } equalColumnHeight(jQuery(".eqHeight")); // Column height equalizer /*equalColumnHeight(jQuery(".newsticker-jcarousellite li"));*/ }); $("#verticalMenuList label, #submenus label").live('click',function(){ $(this).siblings("input")[0].checked=!$(this).siblings("input")[0].checked; refilter(false,this.form); }); jQuery("#nav .navItem").live("mouseenter", function(){ // Reset the menu jQuery("#nav .navItem").clearQueue(); jQuery("#nav .navItem .navContent").hide(); jQuery("#nav .navItem").removeClass("ddBg"); jQuery("#nav .navItem .navCornerLeft,#nav .navItem .navCornerRight").hide(); jQuery("#nav .navItem .navContent").hide(); if (jQuery(".navItemImg").css("background-position-y").length>0){ jQuery(".navItemImg").css("background-position-y","0px"); } else jQuery(".navItemImg").each(function(){ jQuery(this).css("backgroundPosition",jQuery(this).css("backgroundPosition").split(" ")[0]+" 0"); }); // Show and add styles to the selected menu item jQuery(this).addClass("ddBg"); jQuery(this).find(".navCornerLeft, .navCornerRight").show(); jQuery(this).find(".navContent").show(); hideAllVisibleSelectsInIE6() //adjusting menuIcon position if (jQuery(this).find(".navItemImg").css("background-position-y").length>0){ jQuery(this).find(".navItemImg").css("background-position-y","-15px"); } else jQuery(this).find(".navItemImg").css("backgroundPosition",jQuery(this).find(".navItemImg").css("backgroundPosition").split(" ")[0]+" -15px"); }); jQuery("#nav .navItem").live("mouseleave", function(){ jQuery(this).delay(400).queue(function(){ jQuery(this).removeClass("ddBg"); jQuery(this).find(".navCornerLeft, .navCornerRight").hide(); jQuery(this).find(".navContent").hide(); unhideAllVisibleSelectsInIE6(); //re-adjusting menuIcon position if (jQuery(this).find(".navItemImg").css("background-position-y").length>0){ jQuery(this).find(".navItemImg").css("background-position-y","0px"); } else jQuery(this).find(".navItemImg").css("backgroundPosition",jQuery(this).find(".navItemImg").css("backgroundPosition").split(" ")[0]+" 0"); jQuery(this).dequeue(); }); }); $("#pageWidth .hproduct .buyInfo a").live('click',function(evt){ if (this.href.indexOf('javascript:')<0){ if ($(this).closest(".private").length){ evt.preventDefault(); $(this).closest(".hproduct").find(".prodInfo a:first").click(); } else { this.href='/fbshop'+this.getAttribute("href"); // alert('transportToCartMsg@fbshop'); // this.target='_blank'; } } }); $("#pageWidth #favoriter .favoriteLink a").live('click',function(){this.target="_blank";}); $("#pageWidth #thumbnails .thumbFrame a, #pageWidth #thumbnails .thumbModel a").live('click',function(e){ if (this.rev.indexOf('invis.png')<0){ zoom($(this));} e.preventDefault();}); $("#pageWidth #thumbnails .thumbFrame a, #pageWidth #thumbnails .thumbModel a").live('mouseup',function(e){return false;}); $("#productList, .magnifyCloseImg, #gridHorizontalMenu").live('mouseup',function(){ $("#glassesZoom").hide(200); }); $(".customBtn").live('mousedown',function(){ $(this).addClass("depressed"); clearSelection(); }); $(".customBtn").live('mouseup mouseleave blur',function(){ $(this).removeClass("depressed"); }); $(".framePrint, .framePrintBig").live('click',function(){ window.open('/framePrint?prd_id='+$(".framePrint").find("input").attr("value")); }); $(".lvm-btn, .lvm_product").live('click',function(){ if ($("#horizontal_menu_container:not(:animated)").length){ $("#horizontal_menu_container").css("paddingBottom",0).animate({height: 0},{duration: 500*((shiftDown*9)+1),step: adjustProdList,complete: function(){ $(this).hide().css("height","");adjustProdList();}}); $("#virtual_mirror_wrap").show(); $("#virtual_mirror").animate({height: 370, width: 520},{duration: 500*((shiftDown*9)+1)}); $(this).toggleClass("lvm-btn menu-btn").text("Meny"); } clearSelection(); }); $(".menu-btn, #close_lvm_btn").live('click',function(){ if ($("#horizontal_menu_container:not(:animated)").length){ $("#horizontal_menu_container").css("paddingBottom","").slideDown(500*((shiftDown*9)+1)); $("#virtual_mirror").animate({height: 0,width: 236},{duration: 500*((shiftDown*9)+1),step: adjustProdList,complete: function(){ $("#virtual_mirror_wrap").hide();adjustProdList();}}); $(".menu-btn").toggleClass("lvm-btn menu-btn").text("Virtual Mirror"); } clearSelection(); }); $(function(){ $(".popProds:first").css("margin-left", "0px"); $(".popProds:last").css("margin-right", "0px"); jQuery(".frameMeasurementsText li, .frameMeasurementsImg area").bind('mouseover click',function(){ jQuery(".frameMeasurements").addClass(jQuery(this).attr("class")); }); jQuery(".frameMeasurementsText li, .frameMeasurementsImg area").bind('mouseout blur',function(){ jQuery(".frameMeasurements").removeClass("highlight1 highlight2 highlight3 highlight4 highlight5"); }); jQuery(".slider").each(function(){ var sliderwrapper=jQuery(this); sliderwrapper.append('
'); var ticker=jQuery('
').appendTo(sliderwrapper); for (var i=sliderwrapper.find(".slide").length-1;i>=0;i--){ jQuery('
').appendTo(ticker); } if (sliderwrapper.is(".progress") && (!!sliderwrapper.find(".ticker").css("-moz-transform") || !!sliderwrapper.find(".ticker").css("-webkit-transform"))) ticker.addClass("progress"); jQuery('').appendTo(ticker).css({'position': 'absolute','left': 0}); ticker.find("div:last").addClass("current"); slider(sliderwrapper); }); jQuery(".slider").bind('mouseenter',function(){ jQuery(this).data("hover",true); }); jQuery(".slider").bind('mouseleave',function(){ jQuery(this).data("hover",false); }); jQuery(".ticker div").bind('mouseenter',function(e){ e.stopPropagation(); }); jQuery(".ticker div").bind('click',function(){ jQuery(this).closest(".slider").find(":animated").stop(true,true); jQuery(this).closest(".slider").find(".slide").hide(); var newFrame=jQuery(this).closest(".slider").find(".slide:eq("+jQuery(this).attr("data-tick-id")+")"); newFrame.show(); if (newFrame.attr("data-caption")==undefined) jQuery(this).closest(".slider").find(".slider-caption").hide(); else jQuery(this).closest(".slider").find(".slider-caption span.visible").fadeTo(0,1).text(newFrame.attr("data-caption")).parent().show(); jQuery(this).parent().children().removeClass("current"); jQuery(this).addClass("current"); }); }); var transitions={ 'fade': function(d,c,n,cb){ c.fadeOut(parseInt(d)); n.fadeIn(parseInt(d),cb); }, 'slideRight': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'right'); }, 'slideLeft': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'left'); }, 'slideUp': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'up'); }, 'slideDown': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'down'); }, 'slideUpRight': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'upright'); }, 'slideUpLeft': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'upleft'); }, 'slideDownRight': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'downright'); }, 'slideDownLeft': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'downleft'); }, 'revealRight': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revlright'); }, 'revealLeft': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revlleft'); }, 'revealUp': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revlup'); }, 'revealDown': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revldown'); }, 'revealUpRight': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revlupright'); }, 'revealUpLeft': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revlupleft'); }, 'revealDownRight': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revldownright'); }, 'revealDownLeft': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'revldownleft'); }, 'pushRight': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'pushright'); }, 'pushLeft': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'pushleft'); }, 'pushDown': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'pushdown'); }, 'pushUp': function(d,c,n,cb){ this.utilFuncs.slider(d,c,n,cb,'pushup'); }, 'open': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'open'); }, 'close': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'close'); }, 'openHorizontal': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'openhoriz'); }, 'openVertical': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'openverti'); }, 'closeHorizontal': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'closehoriz'); }, 'closeVertical': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'closeverti'); }, 'clipRight': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'right'); }, 'clipLeft': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'left'); }, 'clipUp': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'up'); }, 'clipDown': function(d,c,n,cb){ this.utilFuncs.clipper(d,c,n,cb,'down'); }, 'zoomIn': function(d,c,n,cb){ this.utilFuncs.zoomer(d,c,n,cb,'in'); }, 'zoomOut': function(d,c,n,cb){ this.utilFuncs.zoomer(d,c,n,cb,'out'); }, 'random': function(d,c,n,cb){ var transition=''; var iterateto=Math.floor(Math.random()*1000); var i=0; do{ for (key in this){ if (key.match(/random/)==null && typeof this[key]=='function'){ if (i==iterateto) transition=key; i++; } } }while(!transition.length); this[transition](d,c,n,cb); }, 'utilFuncs': { 'slider': function(d,c,n,cb,direction){ var sldrWidth=c.parent().width(); var sldrHeight=c.parent().height(); var leftto=(direction.match(/right/) ? direction.match(/revl/) ? sldrWidth : n.width() : direction.match(/left/) ? direction.match(/revl/) ? -c.width() : -sldrWidth : 0); var topto=(direction.match(/down/) ? direction.match(/revl/) ? sldrHeight : n.height() : direction.match(/up/) ? direction.match(/revl/) ? -c.height() : -sldrHeight : 0); if (direction.match(/revl/)){ c.css("zIndex",15); n.css("zIndex",10); } else { c.css("zIndex",10); n.css("zIndex",15); n.css({'left': -leftto,'top': -topto}); } n.show().animate({'left': 0,'top': 0},{duration: d}); c.animate({'left': direction.match(/push/) || direction.match(/revl/) ? leftto : 0,'top': direction.match(/push/) || direction.match(/revl/) ? topto : 0},{duration: d,complete: function(){c.hide().css({'left': 0,'top': 0});cb();}}); }, 'clipper': function(d,c,n,cb,direction){ var sldrWidth=c.parent().width(); var sldrHeight=c.parent().height(); var dummy=jQuery('
').appendTo(c.parent()); if (direction.match(/close/)){ c.css("zIndex",15); n.css("zIndex",10); } else { n.css("clip","rect(auto 0px auto auto"); c.css("zIndex",10); n.css("zIndex",15); } n.show(); var animateThis=direction.match(/close/) ? c : n; dummy.animate({width: direction.match(/close|open/) ? Math.round(sldrWidth/2) : sldrWidth,height: direction.match(/close|open/) ? Math.round(sldrHeight/2) : sldrHeight},{duration: d,step: function(){ var clipPointV=direction.match(/open/) ? Math.round(sldrWidth/2)-parseFloat(dummy.css("width")) : parseFloat(dummy.css("width")); var clipPointH=direction.match(/open/) ? Math.round(sldrHeight/2)-parseFloat(dummy.css("height")) : parseFloat(dummy.css("height")); if (direction.match(/close|open/)) animateThis.css("clip","rect("+(direction.match(/verti/)==null ? clipPointH+"px" : "auto")+" "+(direction.match(/horiz/)==null ? sldrWidth-clipPointV+"px" : "auto")+" "+(direction.match(/verti/)==null ? sldrHeight-clipPointH+"px" : "auto")+" "+(direction.match(/horiz/)==null ? clipPointV+"px" : "auto")+")") else animateThis.css("clip","rect("+(direction.match(/up/) ? sldrHeight-clipPointH+"px" : "auto")+" "+(direction.match(/right/) ? clipPointV+"px" : "auto")+" "+(direction.match(/down/) ? clipPointH+"px": "auto")+" "+(direction.match(/left/) ? sldrWidth-clipPointV+"px" : "auto")+")"); },complete: function(){ dummy.remove(); c.hide(); animateThis.css("clip","rect(auto auto auto auto)"); cb(); }}); }, 'zoomer': function(d,c,n,cb,direction){ var sldrWidth=c.parent().width(); var sldrHeight=c.parent().height(); var animateThis=direction.match(/out/) ? c : n; animateThis.wrap(jQuery('
')); tempWrapper=animateThis.parent(); tempWrapper.css({"position": "absolute",'left': animateThis==n ? Math.round(sldrWidth/2) : 0,'top': animateThis==n ? Math.round(sldrHeight/2) : 0,'width': sldrWidth,'height': sldrHeight}); c.css("zIndex",animateThis==n ? 10 : 15); n.css(animateThis==n ? {"zIndex": 15,"zoom": 10/sldrWidth,"-moz-transform": "scale("+10/sldrWidth+")"} : {"zIndex": 10}).show(); c.show(); tempWrapper.animate({'left': animateThis==n ? 0 : Math.round(sldrWidth/2),'top': animateThis==n ? 0 : Math.round(sldrHeight/2)},{duration: d,step: function(){ animateThis.css({"zoom": (sldrWidth-parseInt(tempWrapper.css("left"))*1.99)/sldrWidth,"-moz-transform": "scale("+(sldrWidth-parseInt(tempWrapper.css("left"))*2)/sldrWidth+")",left: !!tempWrapper.css("-moz-transform") ? -parseFloat(tempWrapper.css("left")) : 0,top: !!tempWrapper.css("-moz-transform") ? -parseFloat(tempWrapper.css("top")) : 0}); },complete: function(){ animateThis.unwrap().css({"zoom": "","-moz-transform": ""});c.hide().css({left: 0,top: 0});n.show();cb()} }); } } } function slider(obj){ if (!obj.data("hover")){ // Get current frame var visibleFrame=obj.find(".slide:visible"); if (!visibleFrame.length) visibleFrame=obj.find(".slide:first").show(); if (visibleFrame.attr("data-caption")==undefined) obj.find(".slider-caption").hide(); else obj.find(".slider-caption span").text(visibleFrame.attr("data-caption")); // Get next frame var nextFrame=visibleFrame.next(); if (!nextFrame.length || nextFrame.is(":not(.slide)")) nextFrame=obj.find(".slide:first"); // Get next ticker point var nextTick=obj.find(".ticker .current").prev(); if (!nextTick.length) nextTick=obj.find(".ticker div:last"); // Determine frame duration var duration=parseInt(visibleFrame.attr("data-duration")); if (isNaN(duration)) duration=parseInt(obj.attr("data-duration")); if (isNaN(duration)) duration=5000; // Determine transition duration to next frame var transduration=parseInt(nextFrame.attr("data-transition-duration")); if (isNaN(transduration)) transduration=parseInt(obj.attr("data-transition-duration")); if (isNaN(transduration)) transduration=1000; // Determine transition to next frame var transition=nextFrame.attr("data-transition"); if (typeof transitions[transition]!='function') transition=obj.attr("data-transition"); if (typeof transitions[transition]!='function') transition='fade'; // Get caption for next frame var caption=nextFrame.attr("data-caption"); // Queue transition to next frame obj.find(".ticker.progress .current").append("'"); obj.find(".ticker span").animate({'left': 360},{duration: duration,step: function(){obj.find(".ticker.progress .current").css({"-webkit-transform": "rotate("+parseInt(parseInt(obj.find(".ticker span").css("left"))/5)*5+"deg)","-moz-transform": "rotate("+parseInt(parseInt(obj.find(".ticker span").css("left"))/5)*5+"deg)"})},complete: function(){obj.find(".ticker.progress div").empty().css({"-webkit-transform": "rotate(0deg)","-moz-transform": "rotate(0deg)"});obj.find(".ticker span").css("left",0); if (!obj.data("hover") && nextFrame[0]!=obj.find(".slide:visible")[0]){ obj.find(".ticker div").removeClass("current"); nextTick.addClass("current"); if (transduration>0) transitions[transition](transduration,visibleFrame,nextFrame,function(){ slider(obj)}); else { visibleFrame.hide();nextFrame.show();slider(obj)} if (caption==undefined){ obj.find(".slider-caption").fadeOut(transduration,function(){jQuery(this).find("span").css("opacity",0)}); } else { obj.find(".slider-caption:not(.no-caption .slider-caption)").each(function(){ var viscapt=jQuery(this).find("span.visible") jQuery(this).find("span").not(viscapt).text(caption).addClass("visible").fadeTo(0,0).show().animate({opacity: 1},transduration); viscapt.removeClass("visible").animate({opacity: "0"},transduration); jQuery(this).fadeIn(transduration); }); } } else { setTimeout(function(){ slider(obj);},10); } }}); } else { setTimeout(function(){ slider(obj);},10); } } function clearIEFilter(obj){ var filterObj; if (obj) filterObj=jQuery(obj); else if (this!==window) filterObj=jQuery(this); else filterObj=jQuery("*"); filterObj.css("filter",""); } function clearSelection(){ try { if (document.selection) document.selection.empty(); else if (window.getSelection) window.getSelection().removeAllRanges(); } catch(e){} } function addressFieldSetter(key, valueStr) { if (key.indexOf("Name")==-1 && document.getElementById(key) != null) { document.getElementById(key).value = sveaAddressJson[key]; } } function searchAutoComplete(str) { if (str.length == 0) { document.getElementById("AutoComplete").style.display="none"; document.getElementById("AutoComplete").innerHTML=""; return; } xmlHttp = GetXmlHttpObject() var url = "/searchAutoComplete"; url = url + "?q=" + escape(str); url = url + "&sid=" + Math.random(); xmlHttp.onreadystatechange = autoCompleteCallback; xmlHttp.open("GET", url, true); xmlHttp.send(null); } function updateCategories(query) { if (isFBShop){ var url = "/fbshop/include/categories?" + query; var menuLi=query.match(/productType=\w*/); if (menuLi) menuLi=menuLi[0].replace("productType=",""); $("#horizontalMenuList li.selected").removeClass("selected"); $("#horizontalMenuList li#"+menuLi).addClass("selected"); jQuery.ajax({url: url,complete: function(msg){ jQuery("#submenus").html(msg.responseText); $(".menu-btn").click(); if (use_lvm){ $("#togglebtn.hidden").removeClass("hidden"); $("#virtual_mirror.hidden").removeClass("hidden"); } else { $("#togglebtn").addClass("hidden"); // $("#virtual_mirror").addClass("hidden"); } adjustProdList(); }}); } else { var url = "/include/categories?" + query; jQuery.ajax({url: url,complete: function(msg){ jQuery("#verticalMenuList").html(msg.responseText); }}); } } function updateRightside(query){ var url = "/rightSide?" + query; jQuery.ajax({url: url,complete: function(rs){ jQuery("#rightSide").html(rs.responseText); jQuery("div[qtip]").remove(); if (typeof virtualMirror!='undefined'){ virtualMirror.initGUI(); virtualMirror.updateFBShare(); } }}); } var currentHash=''; function refilter(typeSwitch, filtersForm, page) { var u = ''; if (typeof filtersForm.search=='object') jQuery("#searchkeeper").attr("value",filtersForm.search.value); if (jQuery("input[name='productType']").length==0&&typeof secondaryTypeID=='object') jQuery("#submenus #lensesSubmenu, #verticalMenuList").append(""); if (typeof(filtersForm) == 'object') { u = jQuery(filtersForm).serialize(); } else { u = filtersForm; } if (jQuery("#filters input[name='productType'][value='FRAME']").length>0&&jQuery("#filters input:checkbox:checked").length==0&&u.match(/search=\w+/)) u = u.replace(/productType=FRAME&*/,''); var url=''; // Special case, contact lenses are two different product types if (u.indexOf('productType=LENS')>=0 && u.indexOf('productType=PRIVATE')<0){ u+='&productType=PRIVATE'; } if (typeof page != 'undefined') { if (typeof page=='string' && isNaN(page)) url=page; else u += "&page=" + page; } // URL sanitizer u=u.replace(/&productType2=\w*/,''); u=u.replace(/\w+=&/g,''); u=u.replace(/^\w+=$|&\w+=$/,''); if (typeof(updateProductList) == 'function') { //console.log(u); if (history.pushState){ history.pushState({'queryString': u},'',url.length ? url : (isFBShop ? '/fbshop' : '')+'/products?'+u); notInitialLoad=true; } else { location.hash=u; currentHash=location.hash.replace("#",""); } updateProductList(u,typeSwitch); } else { document.location.href = url.length ? url : (isFBShop ? '/fbshop' : '')+'/products?' + u; } } function loadFavs(){ if ($.support.opacity) $("#productList").find(".hproduct, #favoriter").css("opacity","0.3"); else $(".hproduct").css("visibility","hidden"); if (history.pushState){ history.pushState({'queryString': 'productType=FAVORITES'},'','/fbshop/favorites/view'); notInitialLoad=true; } else { location.hash='productType=FAVORITES'; currentHash='productType=FAVORITES'; } var d=$.ajax({url: '/fbshop/favorites',type: 'GET'}); d.complete(function(msg) { $("#pageWidth").scrollTop(0); $("#productList").html(msg.responseText); //document.getElementById("productList").innerHTML=msg.responseText; $("#submenus").empty(); adjustProdList(); }); } /* Functions for the "quickMenuLens-list */ function hideQuickMenu() { $('#Pop_quickMenuLens').removeClass().addClass('notSel'); unhideAllVisibleSelectsInIE6(); } function checkProductDropdowns(e){ var target = (e && e.target) || (event && event.srcElement); var obj = document.getElementById('Pop_quickMenuLens'); var obj2 = document.getElementById('chooseLens'); if (checkParent(target,'Pop_quickMenuLens') && obj.className!='notSel'){ obj.className='notSel'; unhideAllVisibleSelectsInIE6(); } if (target==obj2 && obj.className!='sel'){ AutoCompleteDiv = document.getElementById("AutoComplete"); AutoCompleteDiv.style.display = "none"; hideAllVisibleSelectsInIE6() obj.className='sel'; } } function checkParent(t,pop){ while(t.parentNode){ if(t==document.getElementById(pop)){ return false } t=t.parentNode } return true } jQuery(function(){ jQuery.ajax({ url: '/include/searchbar', type: 'GET', success: function(data) { jQuery('#Pop_quickMenuLens').html(data); } }); }); jQuery('#chooseLens').live('click',function(e) { if(($('#Pop_quickMenuLens').children().length)==0) { jQuery.ajax({ url: '/include/searchbar', type: 'GET', success: function(data) { jQuery('#Pop_quickMenuLens').html(data); } }); } }); /* End functions for quickMenuLens * Script for printing flash */ function printFlashHere(flashURL, width, height, imgURL, flashArea) { if(!flashURL || flashURL == "" || isFBShop) { return; } if (!imgURL) { imgURL = flashURL.replace('\.swf','.jpg'); } var time = new Date().getTime(); jQuery("#"+flashArea).append(''); var flashvars = {}; var params = { menu: false, play: true, loop: true, quality: 'high', wmode: 'transparent', bgcolor: '#FFFFFF', allowscriptaccess: 'always'}; var attributes = {}; swfobject.embedSWF(flashURL, flashArea, width, height, "9.0.0", "expressInstall.swf", flashvars, params, attributes); } /* SWFObject v2.1 Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis This software is released under the MIT License */ var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("