function findPos(a){var b=curtop=0;if(a&&a.offsetParent){do{b+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent)}return[b,curtop]}window.resizeIframes=function(){};$(function(){var o=$(".mainframe");if(!o.length){return}var l=o[0],n=$(".menu")[0],d=findPos(l)[1],c=findPos(n)[1],g=+n.offsetWidth,a=$("div.right-part")[0],b=$("#container-980")[0],m=$("#below-top"),e=$("#header-980"),f=/msie 6/ig.test(navigator.userAgent),k=/msie 7/ig.test(navigator.userAgent),h=/msie/ig.test(navigator.userAgent),j=$(".QuickSearchLeft"),i=$(".adminLinks");resizeIframes=function(){var s=document.body.clientHeight||window.innerHeight,r=s-d;r=(r<580?580:r)-12;menuHeight=r;l.style.height=r+"px";n.style.height=menuHeight-24+"px";var p=(+b.offsetWidth-g)-8,q=(p<=780?780:p);if(!f){l.style.width=q-8+"px";m[0].style.height=r+"px"}else{l.style.height=r-40+"px";n.style.height=menuHeight-40+"px"}if(i.length>0){l.style.height=menuHeight-32+"px"}};o.load(function(){resizeIframes()});window.onresize=function(){resizeIframes()};if(h){$(".QuickSearchLeft").next().css({padding:"0 0 4px 0"})}});function browserSupportsCookies(){var a="cookiesupport=1";if((document.cookie=a+"; path=/")&&document.cookie.indexOf(a)!==-1){document.cookie=a+"; expires=Sat, 01 Jan 2000 00:00:00 GMT; path=/";return true}return false}var Flasher=function(){function a(e,f,d){return Math.floor(e+(f-e)*d)}var c=navigator.userAgent.indexOf("MSIE")!==-1;function b(d,e){d.style.MozOpacity=e;d.style.opacity=e;if(c){d.style.filter="alpha(opacity = "+parseInt(e*100)+")"}}return{pulse:function(h,f,e,d){var g=h.style.backgroundColor;if(g==""){g="#ffffff"}Flasher.flashBackground(h,g,f,e/2,function(){Flasher.flashBackground(h,f,g,e/2)})},pulseOpacity:function(j,f,d){var i=+new Date,e=i+f;var h=1,g=0;(function(){var k=+new Date,l=1-(e-k)/(e-i);if(k<e){l=l<0.01?0:l>0.99?1:l;b(j,a(l,h,l));setTimeout(arguments.callee,0)}else{b(j,0);if(typeof(d)=="function"){d()}}})()},flashBackground:function(j,d,k,p,g){d=parseInt(d.indexOf("#")!=-1?d.substr(1):d,16);k=parseInt(k.indexOf("#")!=-1?k.substr(1):k,16);var o=+new Date,i=o+p,h=(d>>16)&255,l=(d>>8)&255,f=(d)&255,n=(k>>16)&255,e=(k>>8)&255,m=(k)&255;(function(){var t=+new Date,u=1-(i-t)/(i-o);if(t<i){u=u<0.01?0:u>0.99?1:u;var r=new Number(a(h,n,u)),q=new Number(a(l,e,u)),s=new Number(a(f,m,u));j.style.backgroundColor="rgb("+r+","+q+","+s+")";setTimeout(arguments.callee,0)}else{j.style.backgroundColor=k;if(typeof(g)=="function"){g()}}})()}}}();function blink(a){var b=0;(function(){a.style.visibility=(a.style.visibility=="visible"||typeof(a.style.visibility)=="undefined")?"hidden":"visible";if(++b<=5){setTimeout(arguments.callee,250)}else{a.style.visibility="visible"}})()}var CartController=function(e){if(top.location!=location){return null}var a=null,g=false,h="<img src='Content/Images/cart-arrow.png' />",d="<img src='Content/Images/cart.png' />",f="<a href='cartmanager.aspx' target='mainframe'>Click here to create a cart</a>",c=0;e(function(){a=e("#cartControl");if(!g&&a.length>0){g=true;b()}});function b(){e.ajax({url:"Handlers/CartHandler.ashx",data:{action:"getCart"},dataType:"json",type:"POST",success:function(i){if(i&&i.cart&&+i.cart.products==0&&i.cart.name==""){a.html(f)}else{if(i&&i.cart){var j=c;c=+i.cart.products;a.html("<h1><a href='showCart.aspx' target='mainframe'>"+d+i.cart.name+"</a></h1><div class='amount'><span>"+i.cart.products+"&nbsp;</span><a href='download.aspx' target='mainframe'>"+h+"</a></div>");if(j!=c){blink(a[0])}}}resizeIframes()},error:function(i,k,j){}})}return{update:b}}(jQuery);var ProofHandler=(function(d){var f=null;var a=null;var e=null,b=true;function c(){if(!f){f=d(".layProofMess");a=d(".layProofMess a");e=d(".proofCounterTemplate").val()}d.post("Handlers/ProofHandler.ashx",function(g){var h=a.html();if(g==0){f.hide()}else{f.show();a.show();a.html(e.replace("#nbrproof#",g))}if(h!=a.html()||b){blink(a[0]);b=false}})}return{Refresh:c}})(jQuery);
