var bannersPos1 = new Array(); bannersPos1[0] = ["http://banner.casinoking.com/cgi-bin/redir.cgi?id=N&member=23000000&profile=113866&lang=es","king600es1.gif","",""]; bannersPos1[1] = ["http://cityclub.gamingpromo.com/cgi-bin/redir.cgi?id=N&member=ocrgamin&profile=ocr2es&lang=es","CityClubCasino600x74-es.gif","",""]; bannersPos1[2] = ["http://www.jackpotcity.co.uk/casino/spa/index.aspx?s=aff82784&a=affad248","jpc600x74es.gif","",""]; var bannersPos2 = new Array(); bannersPos2[0] = ["http://serve.williamhillcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2es&zone=929919442&lp=14156242","es300x250.gif","",""]; bannersPos2[1] = ["http://www.royalvegas.eu/es/btag-ad284257/","rvc24-es-300-250-1-1200free.gif","",""]; bannersPos2[2] = ["http://serve.williamhillcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2es&zone=929919442&lp=14156242","whpc-300x250-es.gif","","póker, poker"]; bannersPos2[3] = ["http://www.jackpotcity.co.uk/casino/spa/index.aspx?s=aff82784&a=affad248","jpc300x250es.gif","",""]; var bannersPos3 = new Array(); bannersPos3[0] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2es&zone=14153219&lp=0","euro-300-1.gif","","euro grand, casino"]; bannersPos3[1] = ["http://serve.prestigecasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2es&zone=14153377&lp=0","prestige-300-250-es2.gif","","prestige, casino"]; bannersPos3[2] = ["http://ads.affiliateclub.com/redirect.aspx?pid=61488&bid=2560","slotsclub300x250es.gif","",""]; bannersPos3[3] = ["http://cityclub.gamingpromo.com/cgi-bin/redir.cgi?id=N&member=ocrgamin&profile=ocr2es&lang=es","CityClubCasino 300x250-es.gif","",""]; var bannersPos5 = new Array(); bannersPos5[0] = ["http://www.jackpotcitybingo.com/es/index.asp?s=aff82784&a=affad248","jackpotcitybingo46860.gif","","jackpot city bingo"]; bannersPos5[1] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2es&zone=14153219&lp=0","euro468es.gif","","euro grand"]; bannersPos5[2] = ["http://www.jackpotcity.co.uk/casino/spa/index.aspx?s=aff82784&a=affad248","jpc468x60es.gif","","jackpot city casino"]; bannersPos5[3] = ["http://www.gamingclub.co.uk/?s=aff82784&a=affad248&ul=es","GamingClub468x60.gif","","Gaming Club"]; bannersPos5[4] = ["http://www.acf-webmaster.net/modules/link/775/104404/ocrpoc/","es-riva-468x60-20-40k.gif","","riva"]; var bannersPos6 = new Array(); bannersPos6[0] = ["http://www.jackpotcitybingo.com/es/index.asp?s=aff82784&a=affad248","jackpotcitybingo120600.gif","","jackpot city bingo"]; bannersPos6[1] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2es&zone=14153219&lp=0","euro120600es.gif","","euro grand"]; bannersPos6[2] = ["http://www.gamingclub.co.uk/?s=aff82784&a=affad248&ul=es","GamingClub120x600.gif","","Gaming Club"]; bannersPos6[3] = ["http://www.acf-webmaster.net/modules/link/775/104404/ocrpoc/","riva-160x600-35k-es.gif","","riva"]; bannersPos6[4] = ["http://www.jackpotcity.co.uk/casino/spa/index.aspx?s=aff82784&a=affad248","jpc120x600es.gif","","jackpot city casino"]; $(document).ready(function() { var totalAdsTypeArr = new Array(1,2,3,4,5,6); var pageTitle = document.title; // Get Page Meta Title jQuery.each(totalAdsTypeArr, function(index, adPosId){ var bannersForPosition = window["bannersPos"+adPosId]; // Bulding the array var bannersPos1/2/etc. if ($("#adPosition"+adPosId).length > 0 && (typeof bannersForPosition != "undefined")){ // Check if the page has the Ad Div Id and Banner Exist for that type var bannerSelected = 0; var bannerHTML = ''; // Check if we should look for keywords banner or not depending on the banner position if (adPosId != 1 && adPosId != 4) // Excluding index types { // Going throw each banner and then on each one of his keywords to look for matching banners for the page title var matchedBannersArr = new Array(); jQuery.each(bannersForPosition, function(index, bannerData){ if (bannerData[3].length > 0) { // If has keywords var bannerKeywordsArr = bannerData[3].split(","); jQuery.each(bannerKeywordsArr, function(index2, bannerKeyword){ bannerKeyword = bannerKeyword.replace(/^\s+|\s+$/g, ""); // Removing white space var regEx = new RegExp(bannerKeyword,"i"); if (pageTitle.search(regEx) >= 0) { matchedBannersArr.push(bannerData); return false; // Stop after one match so it can't add the same banner more then ones } }); } }); // If there are matched banners for this page - choose one randomly if (matchedBannersArr.length > 0) { var randomBannerNum = Math.floor((matchedBannersArr.length)*Math.random()); bannerSelected = matchedBannersArr[randomBannerNum]; } } // In case no banner was selected yet and banner position is not on product page - choose random one from all the banners if (bannerSelected == 0 && adPosId != 5 && adPosId != 6) { var randomBannerNum = Math.floor((bannersForPosition.length)*Math.random()); bannerSelected = bannersForPosition[randomBannerNum]; } // If finally banner was selected - print it! if (bannerSelected != 0) { // If banner type 5 (top banner on product page) adds border if (adPosId == 5) bannerHTML += '