try{var jq=jQuery.noConflict();$P=new PHP_JS();}catch(bg){};var gAppPermissions='email,offline_access,user_birthday,friends_birthday';var bj=6==parseInt(jq.browser.version.substr(0,1))&&jq.browser.msie;var lm= !bj&&jq.browser.msie;var l='undefined';var cc='/ajax/';var aV=/^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$/;var dI='/xd_receiver.htm';var jb=''+'<h3>Please provide email address:</h3>'+'<form onsubmit="ki(this);return false;">'+'<p class="email">'+'<input type="text" name="email" size="40" />'+'</p>'+'<p class="submit">'+'<input type="submit" value="Edit my wish list" />'+'</p>'+'</form>';var fS=''+'<div class="panel p1">'+'<h3>Facebook Account Users</h3>'+'<p>Create your wish list with our facebook application and get access to additional features:</p>'+'<ul>'+'<li>Birthday reminders</li>'+'<li>The chance to win free gift cards</li>'+'<li>Buy &amp; Sell gift cards at discounted prices</li>'+'</ul>'+'<div>'+'<input type="button" value="Continue with Facebook" onclick="top.location.href=\''+
gUrl['facebookApp']+'wishlist/\';" /> <span>(recommended)</span>'+'</div>'+'</div>'+'<div class="panel p2">'+'<h3>Non Facebook Users</h3>'+'<p>Don\'t have a facebook account?<br />No problem.</p>'+'<p>Create your wish list at CardHub.com.<br />No registration required.</p>'+'<div>'+'<input type="button" value="Continue" onclick="top.location.href=\'/create/\';" />'+'</div>'+'</div>';var kw=''+'<h3>Email Not Found</h3>'+'<p>The email you entered does not exist on our database.</p>'+'<p><a href="#" onclick="jq(\'#overlay-content-frame\').attr(\'class\',\'overlay-editexisting\');jq(\'#overlay-content\').html(jb);'+'window.setTimeout(function(){jq(\'#overlay-content [name=email]\').focus();}, 50);">Click here</a> to go back and enter another email address.</p>';var lo=''+'<h3>Maximum Limit Reached</h3>'+'<p>You have reached the maximum number of attempts for this week.</p>';var kv=''+'<h3>Delete Wish List</h3>'+'<p>Are you sure you want to delete your wish list?</p>'+'<p class="buttons">'+
'<a href="#" class="yesno" onclick="kk(${id}, \'${token}\');return false;"><span>Yes</span></a>&nbsp;'+'<a href="#" class="yesno" onclick="ce();return false;"><span>No</span></a>'+'</p>';var kE=''+'<h3>Delete Wish List</h3>'+'<p>You have opted to delete your wish list.</p>'+'<p>An email has been sent to confirm this action.</p>';var kt=''+'<h3>Email your friends &amp; family</h3>'+'<form action="" id="invite-form" method="post" onsubmit="return gfValidateInviteForm(this);">'+'<p class="label-fromto">'+'<label for="invite-form-from" class="label1">Your email address:</label>\n'+'<label for="invite-form-to" class="label2">To:</label>'+'</p>'+'<p class="input-fromto">'+'<input type="text" name="from" id="invite-form-from" size="30" value="${email}" />\n'+'<input type="text" name="to" id="invite-form-to" size="30" maxlength="200" />\n'+'<em>use commas for multiple addresses</em>'+'</p>'+'<p class="label-message">'+'<label for="invite-form-message">Your message:</label>'+'</p>'+'<p class="input-message">'+
'<textarea name="message" rows="5" cols="40" onkeyup="jp();">Hey,\n\n'+'Check out this Gift Card Wish List:\n'+gUrl['gifts']+(l!=typeof gUniqueId?gUniqueId:'')+'</textarea>\n'+'<em><strong>250</strong> characters remaining</em>'+'</p>'+'<p class="recaptcha-label"><label for="recaptcha_response_field">Enter the text you see in the image:</label></p>'+'<div id="recaptcha-widget">'+'  <div class="recaptcha-input">'+'    <input type="text" name="recaptcha_response_field" id="recaptcha_response_field" />'+'  </div>'+'  <div id="recaptcha_image"></div>'+'  <div class="recaptcha-options">Can\'t read the text? <a href="javascript:Recaptcha.switch_type(\'image\')">Change</a> the Image or <a href="javascript:Recaptcha.switch_type(\'audio\')">Listen</a> to it</div>'+'</div>'+'<p class="submit">'+'<input type="submit" value="Send Now" onmouseover="if(bj){this.className=\'focus\'}" onmouseout="if(bj){this.className=\'\'}" />'+'</p>'+'</form>';var ku=''+
'<h3><img src="/images/invite/emailsent-check.png" width="48" height="49" alt="" />Your email has been sent.</h3>'+'<div>'+'<a href="/create/">Start Now</a>\n'+'<span>Want to create a wish list of your own?</span>'+'</div>';function lu(aa,cU){if(window.sidebar){window.sidebar.addPanel(cU,aa,'');}else if(document.all){window.external.AddFavorite(aa,cU);}};function gF(){return navigator.userAgent.toLowerCase().indexOf('safari')!= -1?document.body.clientWidth:jq(window).width();};function iY(){var cQ=0;if(window.innerHeight&&window.scrollMaxY){cQ=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){cQ=document.body.scrollHeight;}else{cQ=document.body.offsetHeight;}return cQ;};function kC(){var h=0;if(window.innerHeight&&document.body.clientHeight){h=window.innerHeight>document.body.clientHeight?window.innerHeight:document.body.clientHeight;}else if(document.documentElement){h=document.documentElement.clientHeight>document.body.clientHeight?
document.documentElement.clientHeight:document.body.clientHeight;}return h;};function ff(aS){var U=new Object;U.left=0;U.top=0;if(aS!==null){U.left=aS.offsetLeft;U.top=aS.offsetTop;var T=aS.offsetParent;var au=aS.parentNode;while(T!==null){U.left+=T.offsetLeft;U.top+=T.offsetTop;if(T!=document.body&&T!=document.documentElement){U.left-=T.scrollLeft;U.top-=T.scrollTop;}if(navigator.userAgent.match(/gecko/i)){while(T!=au&&au!==null){U.left-=au.scrollLeft;U.top-=au.scrollTop;au=au.parentNode;}}au=T.parentNode;T=T.offsetParent;}}return U;};function kB(kx){var A=kx.match(/&#([0-9]+);/g);if(null==A){return;}var jh='',gK=null,c=0;for(c=0;c<A.length;c++){gK=A[c].match(/&#([0-9]+);/);if(l==typeof gK[1]){continue;}jh+=String.fromCharCode(gK[1]);}return jh;};function gfOpenPopup(aa,Q,P,fx,fy){var C=['status=1','toolbar=1','location=1','menubar=1','resizable=1','scrollbars=1','directories=1'];if(l!=typeof fx){C.push('left='+((screen.availWidth-Q)/2));}if(l!=typeof fy){C.push('top='+((screen.availHeight-P)/2));}if(l==
typeof Q){Q='100%';}if(l==typeof P){P='100%';}if('string'==typeof Q){Q=$P.trim(Q);if('%'==Q.substr(Q.length-1)){Q=screen.availWidth*(parseInt(Q.substr(0,Q.length-1),10)/100);}}if('string'==typeof P){P=$P.trim(P);if('%'==P.substr(P.length-1)){P=screen.availHeight*(parseInt(P.substr(0,P.length-1),10)/100);}}C.push('width='+Q);C.push('height='+P);window.open(aa,'',C.join(','));};function gfOpenRedirect(cY){gfOpenPopup(cY.href,'80%','100%',1);};var ml=''+'<div id="facebox">'+'<div class="popup">'+'<table>'+'<tbody>'+'<tr><td class="tl"></td><td class="b"></td><td class="tr"></td></tr>'+'<tr><td class="b"></td><td class="body"><div class="content"></div></td><td class="b"></td></tr>'+'<tr><td class="bl"></td><td class="b"></td><td class="br"></td></tr>'+'</tbody>'+'</table>'+'</div>'+'</div>';var mk=''+'<span class="title">Loading</span>'+'<div class="content-real">'+'&nbsp;'+'</div>';function gfOverlayShow(G,C){if(G.substr(0,1)=='#'){if(jq(G).length==0){return false;}else{G=jq(G).html();}}jq('#overlay').add(
'#overlay-content-frame').remove();jq('#content-frame').after('<div id="overlay" />');if(l!=typeof C['facebox']){jq('#overlay').addClass('facebox');}if(jq(window).scrollTop()>0){jq('html,body').stop().animate({'scrollTop':0},'swing',function(){if('html'!=this.tagName.toLowerCase()){return false;}iX(G,C);})}else{iX(G,C);}};function ce(){jq('#overlay-content-frame').remove();jq('#overlay').stop().remove();jq('#facebox').remove();};function iX(G,C){jq('#overlay').stop().css({'display':'block','width':gF(),'height':iY()});jq('#overlay').click(ce);jq(window).unbind('resize').resize(fp);if(l!=typeof C['facebox']){jq('#facebox').remove();jq('#content-frame').after(ml);jq('#facebox .content').html(G);if(l!=typeof C['className']){jq('#facebox').addClass(C['className']);if('waiting'==C['className']){jq('#overlay').unbind('click');}}jq('#facebox').css({'left':(jq(window).width()-jq('#facebox').width())/2,'top':'175px'});}else{jq('#content-frame').after('<div id="overlay-content-frame" />');jq('#overlay-content-frame')
.append('<div id="overlay-closebtn" onclick="ce();" />');jq('#overlay-content-frame').append('<div id="overlay-content">'+G+'</div>');if(l!=typeof C){if(l!=typeof C['className']){jq('#overlay-content-frame').addClass(C['className']);}if('function'==typeof C['beforeShow']){C['beforeShow'].call();}}jq('#overlay-content-frame').stop().show().css({'left':(jq(window).width()-jq('#overlay-content-frame').width())/2});}if(l!=typeof C){if('function'==typeof C['afterShow']){C['afterShow'].call();}}};function fp(){jq('#overlay').css({'width':gF(),'height':iY()});jq('#overlay-content-frame').css({left:(jq(window).width()-jq('#overlay-content-frame').width())/2});};function ga(kz){if(l!=typeof kz){jq('#overlay').unbind('click');}jq('#overlay-closebtn').css('visibility','hidden');jq('#overlay-content-frame').addClass('waiting');jq('#overlay-content').html('<span />');fp();};function fu(C){if(l==typeof C||l==typeof C['className']||l==typeof C['html']){return;}jq('#overlay').unbind('click').click(ce);jq('#overlay-closebtn')
.css('visibility','visible').attr('onclick','void(0);').click(ce);jq('#overlay-content-frame').attr('class',C['className']);jq('.'+C.className+'#overlay-content-frame #overlay-content').html(C['html']);if('function'==typeof C['afterSwitch']){C['afterSwitch'].call();}fp();};if(jq('.content-home').length>0){jq(document).ready(function(){jq('.content-home #email-address').focus();jq('.content-home a.createnow').attr('onclick','void(0);').click(function(){gfOverlayShow(fS,{'className':'overlay-createnow'});return false;});jq('.content-home a.editlink').attr('onclick','void(0);').click(function(){gfOverlayShow(jb,{'className':'overlay-editexisting','afterShow':function(){jq('.overlay-editexisting#overlay-content-frame [name=email]').focus();}});return false;});jq('#tellafriend a').mouseover(function(){try{return addthis_open(this,'');}catch(e){};}).mouseout(function(){try{return addthis_close();}catch(e){};}).click(function(){try{return addthis_open(this,'');}catch(e){};});});}function gfValidateForm(az){var d=
az.elements;if(''==d['email'].value){window.alert('Please enter an email address.');d['email'].focus();return false;}else if(!aV.test(d['email'].value)){window.alert('Please enter a correct email address.');d['email'].select();d['email'].focus();return false;}return true;};function ki(az){var d=az.elements;if(''==d['email'].value){window.alert('Please enter an email address.');d['email'].focus();return false;}else if(!aV.test(d['email'].value)){window.alert('Please enter a correct email address.');d['email'].select();d['email'].focus();return false;}ga();jq.post(cc,{'action':'find-email','mode':'editfromhome','email':d['email'].value},function(f,cK){if(!f['error']){top.location.href='/edit/'+f['uniqueid'];}else{switch(f['message']){case 'max-limit-exceeded':var aM=window.location.href;if(aM.indexOf('search=1')== -1){if('#'==aM.substr(aM.length-1)){aM=aM.substr(0,aM.length-1);}aM+=(aM.indexOf('?')== -1?'?':'&')+'search=1';}window.location.href=aM;break;default:fu({'className':'overlay-editnotfound','html':kw})
;}}},'json');return false;};if(jq('.content-wishlist.viewmode').length>0){jq(document).ready(function(){jq('.content-wishlist.viewmode .storeimg img').mouseover(function(){jq(this).parent().parent().addClass('nobackground');jq(this).stop().animate({opacity:0.5},'fast');jq(this).parent().parent().parent().find('strong').css('color','blue');}).mouseout(function(){jq(this).parent().parent().parent().find('strong').css('color','black');jq(this).stop().animate({opacity:1},'fast',function(){jq(this).parent().parent().removeClass('nobackground');});});jq('.content-wishlist.viewmode .makebox-content input').click(function(){gfOverlayShow(fS,{'className':'overlay-createnow'});return false;});});}function gfEmailOverlayOpen(ei){gfOverlayShow(kt.process({'email':kB(gEmailParsed)}),{'className':'overlay-invite','beforeShow':function(){jp();},'afterShow':function(){jq('.overlay-invite#overlay-content-frame #invite-form-to').focus();if('function'==typeof ei){ei.call(this);}try{jq('#overlay-content-frame').css('left',ff(jq(
'.content-wishlist')[0])['left']+((jq('.content-wishlist').width()-jq('#overlay-content-frame').width())/2));Recaptcha.create(gRecaptchaPublicKey,'recaptcha',{'theme':'custom','custom_theme_widget':'recaptcha-widget'});}catch(bg){};}});};function jp(){var aO='.overlay-invite#overlay-content-frame ';var bh=250-jq(aO+'textarea').val().length;if(bh<=0){jq(aO+'textarea').val(jq(aO+'textarea').val().substr(0,250)).scrollTop(jq(aO+'textarea').height());bh='0';}jq(aO+'p.input-message em strong').html(bh);};function lv(az){var d=az.elements;if(''==d['from'].value){window.alert('');}};function gfFacebookOpen(aa){var jg=625;var cQ=435;var kD=(screen.availWidth-jg)/2;var eS=(screen.availHeight-cQ)/2;window.open(aa,'','width='+jg+',height='+cQ+',top='+eS+',left='+kD+'status=0,toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,directories=0');};function gfTwitterOpen(){window.open('http://www.twitter.com/home?status='+escape('Gift Cards Wish List: '+gUrl['gifts']));};function gfMySpaceOpen(bx){var cU=
'Gift card wish list for '+bx;var _content='Make your own wish list now by clicking <a href="'+gUrl['gifts']+'create/">here</a>.';window.open('http://www.myspace.com/Modules/PostTo/Pages/?t='+escape(cU)+'&c='+escape(_content)+'&l=2');};function gfWishlistDeleteConfirm(K,gJ){gfOverlayShow(kv.process({'id':K,'token':gJ}),{'className':'overlay-deletewishlist'});};function kk(K,gJ){ga(true);jq.post(cc,{'action':'delete-wishlist','id':K,'token':gJ},function(f,ag){if(f.error){window.alert('Unexpected error occured.');top.location.reload();return;}else{fu({'className':'overlay-deletewishlistdone','html':kE.process({'email':f['email']})});}},'json');};function gfValidateInviteForm(az){var d=az.elements;if(''==d['from'].value){window.alert('Please enter an email address.');d['from'].focus();return false;}else if(!aV.test(d['from'].value)){window.alert('Please enter a correct email address.');d['from'].select();d['from'].focus();return false;}if(''==d['to'].value){window.alert(
'Please enter the recipient\'s email address.');d['to'].focus();return false;}else{var aw=d['to'].value;aw=aw.indexOf(',')!= -1?aw.split(/\,[\s]*/):[aw];for(var c=0;c<aw.length;c++){if(!aV.test(aw[c])){window.alert(aw[c]+' is not a valid email address.');d['to'].focus();return false;}}}if(''==d['message'].value){window.alert('Please enter your message.');d['message'].focus();return false;}if(''==d['recaptcha_response_field'].value){window.alert('Please enter the text you see in the image.');d['recaptcha_response_field'].focus();return false;}var mt=d['from'].value;var nn=d['to'].value;var nc=d['message'].value;if('invite-form'==az.id){ga();jq.post(cc,{'action':'send-invite','from':d['from'].value,'to':d['to'].value,'message':d['message'].value,'token':gInviteTokenAjax,'recaptcha_response':d['recaptcha_response_field'].value,'recaptcha_challenge':d['recaptcha_challenge_field'].value},function(f,cK){if(f.error){if('incorrect-captcha'==f['message']){ce();gfEmailOverlayOpen(function(){jq('#invite-form-from').val(
mt);jq('#invite-form-to').val(nn);jq('#invite-form [name=message]').val(nc);jq('#invite-form [name=recaptcha_response_field]').focus();});window.alert('Please enter the text you see in the image.');gInviteTokenAjax=f['new_token'];return false;}window.alert('Unexpected error occured');top.location.href='/'+cr()+'/wish-list';}else{fu({'className':'overlay-invitesent','html':ku});}},'json');return false;}return true;};function gfGiftCardLike(bq,cV){bq=$P.json_decode(unescape(bq));var bz=bq['cardCurrencySymbol'];var lX=bq['price'];var lW=bq['balance'];if('$'!=lX.substr(0,1)){lX=bz+bq['price'];}if('$'!=lW.substr(0,1)){lW=bz+bq['balance'];}if(null==bq['fbUid']){bq['fbUid']=0;}if(l==typeof lY){var lY=gUrl['gifts'];var lZ=gUrl['facebookApp'];}var D=FB.Data.query('SELECT uid,name FROM user WHERE uid = {0}',bq['fbUid']);D.wait(function(kd){var de=parseInt(bq['balance'])-parseInt(bq['price']);var me=Math.round((de/parseInt(bq['balance']))*100);var mo={'text':'Unknown','href':'http://www.facebook.com/'};if('Y'==
bq['trusted']){mo={'text':'','href':''};switch(bq['fbUid']){case 31600024136:mo['text']='GiftCards.com';mo['href']='http://www.giftcards.com/';break;case 185499393135:mo['text']='eBay.com';mo['href']='http://www.ebay.com/';break;default:mo['text']='CardHub.com';mo['href']=lY+'us/gift-card-exchange/';}}else{var mo={'text':kd[0]['name'],'href':'http://www.facebook.com/profile.php?id='+kd[0]['uid']};}var be={'method':'stream.publish','message':'','attachment':{'name':lW+' '+bq['storeName']+' Gift Card on Sale!','description':'Using the Gift Card Exchange from CardHub.com, I found a '+lW+' '+bq['storeName']+' Gift Card on Sale for '+lX+' ('+me+'% off).','href':lZ+'r.php?url=/gift-card-exchange/','properties':{'Seller':mo},'media':[{'type':'image','src':cV,'href':lZ+'r.php?url=/gift-card-exchange/'}]},'action_links':[{'text':'Buy & Sell Gift Cards','href':lZ+'r.php?url=/gift-card-exchange/'}],'user_prompt_message':'Share your thoughts about Connect'};FB.ui(be,function(ep){});});};function cr(){return l==
typeof gCountry['iso2']?'us':gCountry['iso2'].toLowerCase();};function nx(){return l==typeof gCountry['iso3']?'USA':gCountry['iso3'].toUpperCase();};function jt(){jq('.content-invite #charsremaining strong').html(250-jq('.content-invite #message').val().length);};if(jq('.content-invite').length>0){jq('.content-invite #message').keyup(function(){if(250-this.value.length<=0){this.value=this.value.substr(0,250);jq('.content-invite #charsremaining strong').html('0');jq('.content-invite #message').scrollTop(jq('.content-invite #message').height());}else{jt();}});jt();}function gfShowGiftCardDetails(eT){for(var c=0;c<_data.length;c++){if(eT==_data[c]['_10']){var aQ=_data[c];break;}}if(l==typeof(aQ)){return false;}var G='<span></span><iframe src="'+gUrl['gifts']+gCountry['iso2'].toLowerCase()+'/d/'+aQ['_7']+'/?overlay=true"" width="689" height="500" frameBorder="0" scrolling="no" class="unsettled"></iframe>';gfOverlayShow(G,{'className':'waiting','afterShow':function(){}});};function mE(){jq(
'#overlay-content-frame #overlay-content span').remove();jq('#overlay-content-frame').removeClass('waiting').addClass('details');};function mF(P){if(0==parseInt(P)){return;}jq('#overlay-content').css('height',P);jq('#overlay-content iframe').attr('height',P);fp();};function ks(){var o=jq('#creator-name span').html();var A=o.match(/<fb:name([^><]+)>([^<]*)<\/fb:name>/);return A[A.length-1];};function jc(){var o=ks();if(''==o||'Facebook User'==o){var fN='<span class="owneremail">';if(jq.browser.msie&&'6'==jq.browser.version.substr(0,1)){fN+='<span style="display:block;width:'+gEmailImageWidth+'px;height:'+gEmailImageHeight+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+gEmailSrc+',sizingMethod=crop)"></span>';}else{fN+='<span style="display:block;margin:auto;width:'+gEmailImageWidth+'px;height:'+gEmailImageHeight+'px;background:url('+gEmailSrc+') no-repeat">&nbsp;</span>';}fN+='</span>';jq('#creator-name').replaceWith(fN);}else{jq('#creator-name').removeClass('invisible');}};if(l!=
typeof gIsViewNe&&l!=typeof gEmailImageWidth&&l!=typeof gEmailImageHeight&&l!=typeof gEmailSrc){FB_RequireFeatures(['XFBML'],function(){FB.Facebook.init(gApiKey,dI);var d=document.getElementById('creator-name');if(null!=d){FB.XFBML.Host.parseDomElement(d);}if('8'==jq.browser.version.substr(0,1)&&jq.browser.msie){var ky=new Date().getTime()/1000;var jf='';var V=0;var kA=window.setInterval(function(){var o=jq('#creator-name span').html();if(new Date().getTime()/1000-ky>3||(0<V&&o!=jf)){jc();clearInterval(kA);}jf=o;V++;},20);}else{FB.XFBML.Host.get_areElementsReady().waitUntilReady(function(){jc();});}});}var gCountrySelectTimeout=0;jq(document).ready(function(){jq('#header div a.iso2').click(function(){var fO=jq('#content-frame').position().left+jq(this).position().left;if(jq.browser.safari){fO=((jq(window).width()-jq('#content-frame').width())/2)+jq(this).position().left;}if(fO+jq('#country-select-dropdown').width()>jq(window).width()){fO=jq('#content-frame').position().left+jq('#content-frame').width()-jq(
'#country-select-dropdown').width()-5;}jq('#country-select-dropdown').show().css({'left':fO});return false;});jq('#country-select-dropdown').add('#header div a.iso2').mouseover(function(){clearTimeout(gCountrySelectTimeout);}).mouseout(function(){gCountrySelectTimeout=window.setTimeout(function(){jq('#country-select-dropdown').hide();},2500);});});jq(document).ready(function(){if(jq("#searchform").length==0)return;bk("query");});function bk(mz){R("/store-names-rpc.php",mz,100,function(){jq("#searchform").submit();});};function R(urlOrData,mz,cw,func){mA=1;mB=false;if((typeof urlOrData)!='string'){mA=10;mB=true;}try{jq("input#"+mz).autocomplete(urlOrData,{width:300,max:10,delay:100,cacheLength:mA,matchSubset:mB,scroll:false,selectFirst:false,highlightedInInput:true}).result(function(event,item){func(item);});}catch(e){};jq("input#"+mz).keyup(function(e){if(e.keyCode==13){func(jq('input#'+mz).val());}});};jq(document).ready(function(){jq(document).click(function(){jq('#country-select-dropdown').hide();});jq(
'#country-select-dropdown').click(function(bg){bg.stopPropagation();});});
