$(doc).ready(function(){if(doc.getElementById("navbar")){var a=new Image();a.src="/images_2010/common/nav_fly_out_bg.png"}if(doc.getElementById("topAlertContainer")){if(CookieUtil.get("alert_bar")===null){$(win).load(function(){$(function(){$("#topAlertBG").slideDown(750);$("#topAlertContainer").animate({top:0},750);cookieSet("alert_bar","0",1,"/",location.hostname)})})}else{doc.getElementById("topAlertBG").style.display="block";doc.getElementById("topAlertContainer").style.top="0px"}}var aA=doc.getElementsByTagName("link");for(var P=0,O=aA.length;P<O;P++){if(aA[P].getAttribute("href")==="/css_new/campaign_XHTML.css"||aA[P].getAttribute("href")==="/css_new/campaign.css"){$("body").css("padding-top","30px");$("#newHeader").css({height:"132px",width:"985px"});$("#logo").css({display:"block",height:"180px",width:"180px",position:"absolute",top:"-25px",left:"15px"});$("#navbar ul").css("margin","0px");$("#navbar li").css("padding","0px");$("#navbar li a").css({"font-weight":"normal","font-size":"11px"});$("#fsOuterFooter a").css("font-weight","normal");$("#fsOuterFooter").css("color","#000");break}}if(doc.getElementById("merchantContent")){var D=getElementsByClass(doc.getElementById("merchantContent"),"div","contentImages")}if(doc.getElementById("merchantContent")&&D.length>0){for(var P=0,O=D.length;P<O;P++){D[P].style.width=D[P].getElementsByTagName("img")[0].offsetWidth+"px";D[P].style.visibility="visible"}D[O-1].style.marginBottom="10px"}var l=doc.getElementById("sidebarCouponContainer");if(doc.getElementById("sidebarCouponContainer")){var ap=getElementsByClass(l,"div","sidebarCouponPopupsOuterContainer");var aw,w,n,F,d,aa,az;var av,at;for(var P=0,O=ap.length;P<O;P++){aw=getElementsByClass(ap[P],"div","sidebarCouponCodePopupContainer");w=getElementsByClass(ap[P],"div","sidebarCouponExpiryPopupContainer");aa=getElementsByClass(ap[P],"div","sidebarCouponCode");az=getElementsByClass(ap[P],"div","sidebarCouponExpiry");d=getElementsByClass(ap[P],"div","sidebarCouponButtons");if(d.length>0){av=d[0].offsetTop+d[0].offsetParent.offsetTop+15;at=d[0].offsetLeft+d[0].offsetParent.offsetLeft;if(aw.length>0){n=getElementsByClass(ap[P],"div","sidebarCouponCodePopup");n[0].parentNode.style.top=av+"px";n[0].parentNode.style.left=at+"px";var C=function(t){var j=EventUtil.getTarget(t);j.style.backgroundColor="#e0f283";var i=j.parentNode.parentNode.parentNode;while(i.className!=="sidebarCouponPopupsContainer sidebarCouponCodePopupContainer"){i=i.previousSibling}i.style.visibility="visible";EventUtil.addHandler(i,"mouseover",function(x){j.style.backgroundColor="#e0f283";i.style.visibility="visible"});EventUtil.addHandler(i,"mouseout",function(x){j.style.backgroundColor="#e6e6e3";i.style.visibility="hidden"})};EventUtil.addHandler(aa[0],"mouseover",C);var G=function(t){var j=EventUtil.getTarget(t);j.style.backgroundColor="#e6e6e3";var i=j.parentNode.parentNode.parentNode;while(i.className!=="sidebarCouponPopupsContainer sidebarCouponCodePopupContainer"){i=i.previousSibling}i.style.visibility="hidden"};EventUtil.addHandler(aa[0],"mouseout",G)}if(w.length>0){F=getElementsByClass(ap[P],"div","sidebarCouponExpiryPopup");F[0].parentNode.style.top=av+"px";F[0].parentNode.style.left=at+67+"px";var U=function(x){var t=EventUtil.getTarget(x);t.style.backgroundColor="#e0f283";var j=t.parentNode.parentNode.parentNode;while(j.className!=="sidebarCouponPopupsContainer sidebarCouponExpiryPopupContainer"){j=j.previousSibling}j.style.visibility="visible";EventUtil.addHandler(j,"mouseover",function(y){t.style.backgroundColor="#e0f283";j.style.visibility="visible"});EventUtil.addHandler(j,"mouseout",function i(y){t.style.backgroundColor="#e6e6e3";j.style.visibility="hidden"})};EventUtil.addHandler(az[0],"mouseover",U);var z=function(t){var j=EventUtil.getTarget(t);j.style.backgroundColor="#e6e6e3";var i=j.parentNode.parentNode.parentNode;while(i.className!=="sidebarCouponPopupsContainer sidebarCouponExpiryPopupContainer"){i=i.previousSibling}i.style.visibility="hidden"};EventUtil.addHandler(az[0],"mouseout",z)}}}var g=64;var ac=getElementsByClass(l,"div","couponDescription");for(var P=0,O=ac.length;P<O;P++){var Y=ac[P].getElementsByTagName("a")[0];var k=Y.innerHTML;var u=Y.offsetHeight;var ao=ac[P].parentNode.offsetHeight;if(u<=g){Y.style.marginTop=(ao-u)/2+"px";Y.style.visibility="visible"}else{var ag=0;while(u>g){ag+=2;Y.innerHTML=k.substring(0,k.length-ag)+"...";u=Y.offsetHeight}Y.style.marginTop=(ao-Y.offsetHeight)/2+"px";Y.style.visibility="visible"}}}if(doc.getElementById("contestContainer")){var B=$("#contestContainer");var ak=$("#overlay");ak.fadeTo(500,0.3,function(){B.fadeIn(500)});$("#closeButton").click(function(i){prevDefault(i);B.fadeOut(500,function(){ak.fadeOut(500)})})}if(doc.getElementById("searchField")){clearForm(doc.getElementById("searchField"))}if(doc.getElementById("weeklyNewsletterInputGTG")){clearForm(doc.getElementById("weeklyNewsletterInputGTG"))}formValidation();if(doc.getElementById("countDown")){countDown()}if(doc.getElementById("specialEventCM")||doc.getElementById("specialEventBF")){countDown()}if(doc.getElementById("postSpecialEvent")){var af=0.66;var o=6;var ae=200;var m=5000;var A,ah,L,r,ar="",ai=true;var aj=0,v=0,au=1,aq=0;function Z(){return aj}function Q(e){aj=e}function b(x){aj=Z(aj);if(au<aq){for(var j=0;j<o;j++){try{var t=doc.createElement("li");setAttr(t,"class","clear");t.innerHTML='<div class="merchantSE"><a href="'+x[aj].merchantPath+'"><img src="'+x[aj].merchantPath+"images/"+x[aj].logoFileName+'" width="'+Math.ceil(x[aj].logoWidth*af)+'" height="'+Math.ceil(x[aj].logoHeight*af)+'" alt="'+x[aj].merchantName+'" title="'+x[aj].merchantName+'" /></a></div><a href="javascript:cWin('+x[aj].merchantID+","+x[aj].offerID+')" class="offerSE" >'+x[aj].offer+"</a>";aj++;Q(aj);doc.getElementById("listedOffers").appendChild(t)}catch(y){break}}if(ai){L=setTimeout(function(){$("#listedOffers").animate({top:-(au*210)},ae);au++;doc.getElementById("offerControl").style.left="-19px";doc.getElementById("offer_control_map").getElementsByTagName("area")[0].setAttribute("coords","19,0,38,24");doc.getElementById("offer_control_map").getElementsByTagName("area")[1].setAttribute("coords","19,24,38,43");doc.getElementById("offer_control_map").getElementsByTagName("area")[2].setAttribute("coords","19,42,38,66");b(x)},m)}else{$("#listedOffers").animate({top:-(au*210)},200);au++;if(au===aq){doc.getElementById("offerControl").style.left="-38px";doc.getElementById("offer_control_map").getElementsByTagName("area")[0].setAttribute("coords","38,0,57,24");doc.getElementById("offer_control_map").getElementsByTagName("area")[1].setAttribute("coords","38,24,57,43");doc.getElementById("offer_control_map").getElementsByTagName("area")[2].setAttribute("coords","")}else{doc.getElementById("offerControl").style.left="-19px";doc.getElementById("offer_control_map").getElementsByTagName("area")[0].setAttribute("coords","19,0,38,24");doc.getElementById("offer_control_map").getElementsByTagName("area")[1].setAttribute("coords","19,24,38,43");doc.getElementById("offer_control_map").getElementsByTagName("area")[2].setAttribute("coords","19,42,38,66")}V()}}else{doc.getElementById("offerControl").style.left="-38px";doc.getElementById("offer_control_map").getElementsByTagName("area")[0].setAttribute("coords","38,0,57,24");doc.getElementById("offer_control_map").getElementsByTagName("area")[1].setAttribute("coords","38,24,57,43");doc.getElementById("offer_control_map").getElementsByTagName("area")[2].setAttribute("coords","");V()}}function V(){clearTimeout(L)}function s(){ai=false;b(r)}function M(){if(au>1){$("#listedOffers").animate({top:parseInt($("#listedOffers").position().top+210)},200);au--;ai=false;if(au===1){doc.getElementById("offerControl").style.left="0px";doc.getElementById("offer_control_map").getElementsByTagName("area")[0].setAttribute("coords","");doc.getElementById("offer_control_map").getElementsByTagName("area")[1].setAttribute("coords","0,24,19,43");doc.getElementById("offer_control_map").getElementsByTagName("area")[2].setAttribute("coords","0,43,19,68")}else{doc.getElementById("offerControl").style.left="-19px";doc.getElementById("offer_control_map").getElementsByTagName("area")[0].setAttribute("coords","19,0,38,24");doc.getElementById("offer_control_map").getElementsByTagName("area")[1].setAttribute("coords","19,24,38,43");doc.getElementById("offer_control_map").getElementsByTagName("area")[2].setAttribute("coords","19,42,38,66")}}else{doc.getElementById("offerControl").style.left="0px"}V()}EventUtil.addHandler(doc.getElementById("pause"),"click",V);EventUtil.addHandler(doc.getElementById("down"),"click",s);EventUtil.addHandler(doc.getElementById("up"),"click",M);EventUtil.addHandler(win,"unload",function(){EventUtil.removeHandler(doc.getElementById("pause"),"click",V);EventUtil.removeHandler(doc.getElementById("down"),"click",s);EventUtil.removeHandler(doc.getElementById("up"),"click",M);EventUtil.removeHandler(win,"unload",arguments.callee)});jQuery.ajax({url:"/cybermonday/get_cm_offers.php",dataType:"json",success:function(e){r=e;v=r.length;aq=Math.ceil(v/3);alert(aq);b(r)},error:function(){doc.getElementById("listedOffers").innerHTML='<li style="width: 330px; text-align: center; font-size: 14px; color: #000"><a href="/blackfriday/">View all of our Cyber Monday Offers</a>&#187;</li>';doc.getElementById("offerControl").style.display="none"}})}if(doc.getElementById("twitterFollowUs")){$(function(){jQuery.ajax({url:"/social/twitter_follower_count.php",dataType:"text",success:function(e){doc.getElementById("twitterFollowUsCount").innerHTML=e},error:function(){doc.getElementById("twitterFollowUsCount").innerHTML=""}})})}if(doc.getElementById("googlePlusOne")){var aB=doc.createElement("g:plusone");aB.setAttribute("size","medium");doc.getElementById("googlePlusOne").appendChild(aB)}if(doc.getElementById("contestGooglePlusOne")){var ab=doc.createElement("g:plusone");doc.getElementById("contestGooglePlusOne").appendChild(ab)}if(doc.getElementById("sideBarGooglePlusOne")){var ab=doc.createElement("g:plusone");doc.getElementById("sideBarGooglePlusOne").appendChild(ab)}if(doc.getElementById("likeBox")){var R=doc.createElement("fb:like-box");R.setAttribute("id","facebookLike");R.setAttribute("href","http://www.facebook.com/fabuloussavings");R.setAttribute("width","348");R.setAttribute("show_faces","true");R.setAttribute("stream","false");R.setAttribute("header","false");doc.getElementById("likeBox").appendChild(R)}if(doc.getElementById("fb-root")){var q;var p=getElementsByClass(doc.getElementsByTagName("body")[0],"div","likeButton");for(var P=0,O=p.length;P<O;P++){q=doc.createElement("fb:like");q.setAttribute("href","");q.setAttribute("send","false");q.setAttribute("layout","button_count");q.setAttribute("width","90");q.setAttribute("show_faces","false");q.setAttribute("font","");p[P].appendChild(q)}}if(doc.getElementById("tweetThis")){var W=getElementsByClass(doc.getElementById("tweetThis"),"a","twitter-share-button")[0];var ay=doc.getElementsByTagName("h1")[0].innerHTML;var h=new RegExp(".+(?=Coupons|Vouchers)","i");var ax=h.exec(ay)+"";var ad="";var f=0;var X=0;var an=139;if(couponText!==""){ad=couponText}else{ad="These "+ax.trim()+" coupons from @FabulousSavings are #fabulous"}f=ad.length;X=f+tcoLinkLength;if(X>=an){ad=ad.substring(0,f-(X-an+3));ad=ad+"..."}W.setAttribute("data-text",ad)}if(doc.getElementById("getTheGoodsContainer")){var N=function(i){viewPopUp(i,doc.getElementById("sampleEmailContainer"))};var am=function(i){closePopUp(i,doc.getElementById("sampleEmailContainer"))};EventUtil.addHandler(doc.getElementById("viewSampleGTG"),"click",N);EventUtil.addHandler(doc.getElementById("popupCloseButton"),"click",am);EventUtil.addHandler(win,"unload",function(){EventUtil.removeHandler(doc.getElementById("viewSampleGTG"),"click",N);EventUtil.removeHandler(doc.getElementById("popupCloseButton"),"click",am);EventUtil.removeHandler(win,"unload",arguments.callee)})}if(doc.getElementById("youMayAlsoLike")){var c=getElementsByClass(doc.getElementById("alsoLikeCapturesBox"),"a","alsoLikeCaptures");var E=doc.getElementById("alsoLikeCapturesBox").getElementsByTagName("li");var S=0,T=113;for(var P=0,O=c.length;P<O;P++){S=E[P].offsetHeight;if(S>=T){var H=c[P].childNodes;for(var J=0,I=H.length;J<I;J++){if(H[J].nodeType===3&&H[J].nodeValue.trim()!==""){var al=H[J].nodeValue.trim().length;var K=H[J].nodeValue;while(S>T){al-=3;H[J].nodeValue=H[J].nodeValue.trim().substring(0,al)+"...";S=E[P].offsetHeight;if(al<=0){H[J].nodeValue=K;break}}}}}}}});
