function getGoggleTrackingDownload(n){setTimeout('pageTracker._trackPageview("'+n+'")',1e3)}function getGoggleEventDownload(n,t,i){setTimeout('pageTracker._trackEvent("'+n+'","'+t+'","'+i+'")',1e3)}function getFileNameFromUrl(n){return n.match(/(.*)[\/\\]([^\/\\]+)\.\w+$/)[2]}function formatPrice(n,t){var i=n;return typeof n.toFixed=="function"&&(i=n.toFixed(2),t==="¥"&&(i=parseInt(i,10))),i+" "+t}function isHtmlBodyValid(n){return n.match(/(<[ ]*[sS][cC][rR][iI][pP][tT])|(<[a-zA-Z ][^>]*\s[oO][nN][\w ]+=([\w+ ]|'[^']*'|"[^"]*")[^>]*>)|([hH][rR][eE][fF][ ]*=['" ]*[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT][ ]*:)/)==null}function redirectTo(n){window.location=n}function resizeImg(n,t){var i,r,u=$(n).parent().parent().width(),f=$(n).parent().parent().height(),e,o;(f<$(n).height()||u<$(n).width())&&(e=$(n).attr("width"),o=$(n).attr("height"),xRatio=u/e,yRatio=f/o,t!="parentSize"?xRatio<yRatio?(i=Math.ceil(e*yRatio),r=f,imgMarginLeft=(u-i)/2,$(n).css("margin-left",imgMarginLeft)):(i=u,r=Math.ceil(o*xRatio),imgMarginTop=(f-r)/2+"px",$(n).css("margin-top",imgMarginTop)):xRatio>yRatio?(i=Math.ceil(e*yRatio),r=f):(i=u,r=Math.ceil(o*xRatio)));$(n).width(i);$(n).height(r)}var imat;$(function(){$.ajaxSetup({cache:!1})});EmptyGUID="00000000-0000-0000-0000-000000000000";$(function(){$("#postUploadform").click(function(){document.frmCreateYourOwnLamp.submit()})});$(function(){function t(){this.showDropDown=function(n){n.is(":hidden")&&n.show()};this.closeDropDown=function(n){n.hide()}}var n=new t;$(".main_menu li").mouseover(function(){var t=$(this).contents().filter("div");n.showDropDown(t)}).mouseout(function(){var t=$(this).contents().filter("div");n.closeDropDown(t)})});$(function(){$(document).ajaxError(function(n,t){t.status==403&&t.statusText=="SESSIONTIMEOUT"&&(window.location="/Home/SessionTimeout")});$("div.scrollable").scrollable()}),function(n){function t(n){return isNaN(n)?0:n}jQuery.MouseLastPosition={x:0,y:0};n(document).mousemove(function(n){jQuery.MouseLastPosition={x:n.pageX,y:n.pageY}});n.fn.ismouseover=function(){var i;return this.eq(0).each(function(){var r=n(this).offset(),u=Number(n(this).width())+t(Number(n(this).css("padding-left").replace("px","")))+t(Number(n(this).css("padding-right").replace("px","")))+t(Number(n(this).css("border-right-width").replace("px","")))+t(Number(n(this).css("border-left-width").replace("px",""))),f=Number(n(this).height())+t(Number(n(this).css("padding-top").replace("px","")))+t(Number(n(this).css("padding-bottom").replace("px","")))+t(Number(n(this).css("border-top-width").replace("px","")))+t(Number(n(this).css("border-bottom-width").replace("px","")));i=r.left<jQuery.MouseLastPosition.x&&r.left+u>jQuery.MouseLastPosition.x&&r.top<jQuery.MouseLastPosition.y&&r.top+f>jQuery.MouseLastPosition.y?!0:!1}),i}}(jQuery);imat=imat||{};imat.namespace=function(n){function u(){return function(){return this}.call(null)}function f(n,t){return typeof n[t]=="undefined"&&(n[t]={}),n[t]}var t=u(),r=n.split(".");for(i=0;i<r.length;i++)t=f(t,r[i]);return t};imat.Localizator=function(){function t(t){i(n,t)}function i(n,t){for(var i in t)n[i]=t[i]}function r(t){return n[t]!=undefined?n[t]:t}function u(t,i){var u,r;if(n[t]!=undefined){for(u=n[t],r=0;r<i.length;r++)u=u.replace("{"+r+"}",i[r]);return u}return t}var n={};return{getValue:r,getFormatedValue:u,registerResources:t}}();imat.namespace("imat.utils").Cookie=function(){function n(n){var f=[],t=$.cookie(n),r,i,e,u;if(t==null)return null;if(t.indexOf("=")==-1)return t;for(r=t.split("&"),i=0,e=r.length;i<e;i++)u=r[i].split("="),f.push({key:u[0],value:u[1]});return f}function t(n,t,i){for(var r="",u=0,f=t.length;u<f;u++)r+=t[u].key+"="+t[u].value+"&";r=r.substr(0,r.length-1);$.cookie(n,r,{expires:i,path:"/"})}return{get:n,set:t}}();imat.namespace("imat.utils").NumberFilter=function(){function n(n,t){var i,r;return(i=n.keyCode?n.keyCode:n.which,r=String.fromCharCode(i),i==35||i==36||i==37||i==39)?!0:t.test(r)?r=="."&&$(this).val().indexOf(".")>=0?!1:!0:r=="\n"||r=="\r"?($(this).change(),!1):!1}return{DoubleNumberFilter:function(t){return n(t,/[\d\.\x08]/)},IntegerNumberFilter:function(t){return n(t,/[\d\x08]/)}}};imat.namespace("imat.utils").Cache=function(){var n={},t=function(t){return n[t]},i=function(t){var i=!1;return n.hasOwnProperty(t)&&n[t]!==undefined&&(i=!0),i},r=function(){n={}},u=function(t,i){n[t]=i};return{getData:t,containsData:i,clear:r,addData:u}};Boolean.parse=function(n){return n==null?!1:n.toString().toLowerCase()==="true"};String.prototype.trim=function(){return this.replace(/(^\s+)|(\s+$)/g,"")};String.isNotValidHtml=function(n){return!n.match(/[\<\>]+/)};$.extend({getUrlVars:function(){for(var t=[],n,r=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<r.length;i++)n=r[i].split("="),t.push(n[0]),t[n[0]]=n[1];return t},getUrlVar:function(n){return $.getUrlVars()[n]}});imat=imat||{};imat.master={init:function(){imat.master.initSubscriptions();imat.master.initKeepSessionAlive();imat.master.topMenu.init();imat.master.Cookies.init()},initKeepSessionAlive:function(){setInterval(imat.master.keepSessionAlive,3e5)},keepSessionAlive:function(){$.ajax({type:"GET",url:"/keepsessionalive",cache:!1})},initSubscriptions:function(){$("#frmSubscription a").click(function(){return $("#frmSubscription #joinNewsletter").valid()?($("#frmSubscription").submit(),!1):!1});$("#frmSubscription").validate({rules:{SubscriberEmail:{email:!0,required:!0}},messages:{SubscriberEmail:""},highlight:function(){imat.master.view.enableSubscriptionButton(!1)},unhighlight:function(){imat.master.view.enableSubscriptionButton(!0)},onkeyup:function(n){this.element(n)},onfocusout:function(n){this.element(n)}});imat.master.view.initSubscriptionField()}};imat.master.topMenu={isMouseOver:!1,init:function(){$(".profile-menu").hover(function(){imat.master.topMenu.isMouseOver=!0},function(){imat.master.topMenu.hideProfileMenu()});$(".user-name_login, .b-profile-menu .dropdown-btn").hover(function(){imat.master.topMenu.isMouseOver=!0;$(".profile-menu").show()},function(){imat.master.topMenu.hideProfileMenu()})},hideProfileMenu:function(){imat.master.topMenu.isMouseOver=!1;setTimeout(function(){imat.master.topMenu.isMouseOver||$(".profile-menu").toggle()})}};imat.master.view={initSubscriptionField:function(){var n=$("#frmSubscription input#joinNewsletter").attr("title");$("#frmSubscription input#joinNewsletter").val()||($("#frmSubscription input#joinNewsletter").val(n),imat.master.view.enableSubscriptionButton(!1));$("#frmSubscription input#joinNewsletter").focus(function(){$(this).val()==n&&$(this).val("");$(this).addClass("active")});$("#frmSubscription input#joinNewsletter").blur(function(){$(this).val()||($(this).val(n),$(this).removeClass("active"))})},enableSubscriptionButton:function(n){n?$("#frmSubscription a").removeClass("btn-disable"):$("#frmSubscription a").addClass("btn-disable")}};imat.master.Cookies=function(){function n(){$.get("/Home/CheckCookies",function(n){n.isCookieCheckSuccessful||t()})}function t(){$(".b-cookies").slideDown(150)}return{init:n}}();$(document).ready(function(){imat.master.init()});jQuery.fn.placeScaledImage=function(n,t,i,r,u){var f=this,e;(typeof t=="undefined"||Number(t)<=0)&&(t=950);(typeof i=="undefined"||Number(i)<=0)&&(i=550);e=$("<img>");e.bind("load",function(){var _width=this.width,_height=this.height,ratio=_height/i,new_width,new_height,str_params;_width/t>ratio&&(ratio=_width/t);ratio<1&&(ratio=1);new_width=parseInt(_width/ratio);new_height=parseInt(_height/ratio);$(f).attr("src",n);$(f).width(new_width);$(f).height(new_height);str_params="";typeof u!="undefined"&&(str_params=u.join(","));typeof r!="undefined"&&eval(r+"("+str_params+");")});e.attr("src",n)};jQuery.fn.placeScaledProductPicture=function(n,t,i,r,u){var l=this,h="",f=570,e=412,a=!1,c;typeof t!="undefined"&&Number(t)>0&&(f=t);typeof i!="undefined"&&Number(i)>0&&(e=i);typeof r!="undefined"&&(h=r);typeof u!="undefined"&&(a=u);var o=0,s=0,v=f,y=e;h!=""&&$(l).removeAttr("style").addClass("loader").attr("src",h).removeClass("hidden-picture");c=$("<img>");c.bind("load",function(){var i=this.width,r=this.height,t,u,h;i<f&&r<e?(u=i,h=r):(t=r/e,a?i/f<t&&(t=i/f):(i/f<t&&(t=i/f),t<1&&(t=1)),u=parseInt(i/t),h=parseInt(r/t),o=(f-u)/2,s=(e-h)/2,o>0&&(o=0),s>0&&(s=0));$(l).css({width:u+"px",height:h+"px",marginLeft:o+"px",marginTop:s+"px"}).removeClass("loader").attr("src",n)});c.attr("src",n)};imat.namespace("imat.inlineEditor");imat.inlineEditor.show=function(){function i(n){t(n,!1);var i=n.clone(),r=i.find(".replaced-block");return r.replaceWith("{{"+r.data("key")+"}}"),i.find(".actions").remove(),i.find(".not-translated-warning").remove(),i.find(".changed-warning").remove(),i}function n(n){var t=n.parents(".block-content:first"),i=t.data("pagename"),r=t.data("blockname");return{pageName:i,blockName:r,contentElement:t}}function t(n,t){n.attr("contenteditable",t);n.toggleClass("active",t)}function r(n){n.find(".not-translated-warning").remove();n.removeClass("not-translated")}function u(n){n.find(".changed-warning").remove();n.removeClass("changed")}function s(n){n.parents(".block-content:first");n.find(".action.read-mode").hide();n.find(".action.edit-mode").show();n.attr("contenteditable",!0)}function f(n){n.parents(".block-content:first");n.find(".action.read-mode").show();n.find(".action.edit-mode").hide();n.attr("contenteditable",!1)}function h(n,t,i){$.ajax({async:!1,data:{PageName:n,BlockName:t},type:"get",dataType:"json",url:"/Cms/BlockContent/DefaultContent",success:function(n){i(n.Content)}})}function e(n,t,i){$.ajax({async:!1,data:{PageName:n,BlockName:t},type:"get",dataType:"json",url:"/Cms/BlockContent/SavedContent",success:function(n){i(n.Content)}})}function o(n,t,i,r){$.ajax({async:!1,data:{PageName:n,BlockName:t,Content:i},type:"post",dataType:"json",url:"/Cms/BlockContent/SaveContent",success:function(){r()}})}$(".localization-menu").show();$(".block-content").prepend("<div class='actions' unselectable='on' contenteditable='false'><span class='action edit read-mode' unselectable='on'>Edit<\/span><span class='action revert-english edit-mode' unselectable='on'>Revert to English<\/span><span class='action revert edit-mode' unselectable='on'>Revert changes<\/span><span class='action cancel edit-mode' unselectable='on'>Cancel<\/span><span class='action apply edit-mode' unselectable='on'>Apply<\/span><span class='action save edit-mode' unselectable='on'>Save<\/span><\/div>");$(".block-content.not-translated").prepend("<div class='not-translated-warning' contenteditable='false'>This block is not localized<\/div>");$(".block-content.changed").prepend("<div class='changed-warning' contenteditable='false'>This block has been changed on the main site<\/div>");$(document).on("click",".action.edit",function(){var i=n($(this));t(i.contentElement,!0);i.contentElement.find(".not-editable *").attr("contenteditable",!1);s(i.contentElement)});$(document).on("click",".action.cancel",function(){var i=n($(this));e(i.pageName,i.blockName,function(n){var r=i.contentElement.find(".actions").clone();i.contentElement.html(n);i.contentElement.prepend(r);f(i.contentElement);t(i.contentElement,!1)})});$(document).on("click",".action.revert-english",function(){var t=n($(this));h(t.pageName,t.blockName,function(n){var i=t.contentElement.find(".actions").clone();t.contentElement.html(n);t.contentElement.prepend(i)})});$(document).on("click",".action.revert",function(){var t=n($(this));e(t.pageName,t.blockName,function(n){var i=t.contentElement.find(".actions").clone();t.contentElement.html(n);t.contentElement.prepend(i)})});$(document).on("click",".action.apply",function(){var f=n($(this)),e=i(f.contentElement);o(f.pageName,f.blockName,e.html(),function(){t(f.contentElement,!0);r(f.contentElement);u(f.contentElement);alert("saved")})});$(document).on("click",".action.save",function(){var t=n($(this)),e=i(t.contentElement);o(t.pageName,t.blockName,e.html(),function(){r(t.contentElement);u(t.contentElement);f(t.contentElement);alert("saved")})})}