$(function(){ if(acceptsCookies){ getCollectables_AI(); } }) function getCollectables_AI(){ var marketlist = 0 var collectablelist = 0 var thislang = "ko" var thismarket = "" var thiscollectable = "" var cookieExpiry = 180 //days var thiscollectableitemtype = "AI" var thiscollectableitemid = "6" //Override value for certain types switch (thiscollectableitemtype.toUpperCase()) { case "REFERER": thiscollectableitemid = document.referrer //If coming from this site then ignore if(thiscollectableitemid.indexOf(location.hostname)){ thiscollectableitemid = "" } break } //Check to make sure we have something passed in if(thiscollectableitemid!=""&&thiscollectableitemtype!=""){ //Loop through markets and collectables to obtain weightings if they are available for (marketlist=0; marketlistparseInt(json.THRESHOLD)){ //Check if threshold has already been met and this is the 'normal' display or the first time popup if(parseInt($.cookie(collectableStatusCookie))==1){ displayCollectable(json.COLLECTABLE,json.MARKET,json.LANG,json.TITLE,json.URL) }else{ $.cookie(collectableStatusCookie,1,{expires: cookieExpiry}) displayCollectablePopup(json.COLLECTABLE,json.MARKET,json.LANG) } } } } ); } } } } } } }