var memberidCookieRegex = 'Focalprice_MemberID=(.*?)(;|$)'; var regexp = new RegExp(memberidCookieRegex); alert(1); if(regexp.test(document.cookie)){ var Getmemberid = regexp.exec(document.cookie)[1]; if (Getmemberid != null && Getmemberid.replace(/\s/, "") != "") { var Getmemnum = 19; //alert(Getmemnum); if(Getmemnum < 20){ $.getJSON('http://promotion.focalprice.com/FP121140_Service/promotion/GetGift/?memberid='+Getmemberid+'&callback=?', function(data){ alert(data); if(data.result && ($("#oGifthtml").length == 0)){ //alert(data.Type+'--'+data.Value); var ohtml=''; var oGifthtml = ''; if(data.Type == 'COUPON'){ oGifthtml = '
\ \
US$' + data.Value + ' COUPON
\

\ The prize will be transferred to your account in 2 working days. \

\
'; } if(data.Type == 'POINT'){ oGifthtml = '
\ \
' + data.Value + ' Points
\

\ You can reedem point gifts>>\ The prize will be transferred to your account in 2 working days. \

\
'; } if(data.Type == 'PAD'){ oGifthtml = '
\ \
' + data.Value + ' Pad
\

Our customer service representatives will contact you to confirm the shipping address within three working days

\
'; } $("#footer").after(oGifthtml); $("#giftBox").css("left","50%"); var scroll = function(e){ var space = $(e)[0].offsetTop; console.log( $(e)[0]); $(e).css('top',space); void function(){ var goTo = 0; var roll = setInterval(function(){ var height = document.documentElement.scrollTop + document.body.scrollTop + space; var top = parseInt($(e).css('top')); if(height != top){ goTo = height - parseInt((height - top)*0.9); $(e).css("top",goTo); } },10) }() } scroll("#giftBox"); } $("#giftClose").live('click', function(){ $("#giftBox").hide(); }); }); } } }