var bannersPos1 = new Array(); bannersPos1[0] = ["http://banner.scasino.com/cgi-bin/redir.cgi?id=N&member=27000000&profile=83736&lang=pl","swiss600x90.gif","",""]; bannersPos1[1] = ["http://banner.noblecasino.com/cgi-bin/redir.cgi?id=N&member=28000000&profile=731&lang=pl","noblecasino300x250.gif","",""]; bannersPos1[2] = ["http://banner.casinoking.com/cgi-bin/redir.cgi?id=N&member=23000000&profile=113926&lang=pl","king600x74.gif","",""]; bannersPos1[3] = ["http://banner.casinolasvegas.com/cgi-bin/redir.cgi?id=N&member=24000000&profile=79853&lang=pl","LasVegasCasino600x74-PL.gif","",""]; bannersPos1[4] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=327485753&lp=13523158","eurogrand600x70-pl.gif","",""]; bannersPos1[5] = ["http://serve.21nova.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=835509639&lp=835438776","21nova600x90-pl.gif","",""]; bannersPos1[6] = ["http://serve.williamhillcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=1370536675&lp=1366420384","willhill600x70-pl.gif","",""]; var bannersPos2 = new Array(); bannersPos2[0] = ["http://serve.21nova.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=835509611&lp=835438776","21nova300x250PL.gif","",""]; bannersPos2[1] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=14153249&lp=0","EuroGrandPL300x250.gif","",""]; bannersPos2[2] = ["http://serve.williamhillcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=1370536653&lp=1366420384","WillHillCasino300x250-pl.gif","",""]; bannersPos2[3] = ["http://serve.21nova.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=835509636&lp=835438776","21nova300x250-pl.gif","",""]; bannersPos2[4] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=584357657&lp=13523158","EuroGrand300x250-pl.gif","",""]; var bannersPos3 = new Array(); bannersPos3[0] = ["http://banner.casinoking.com/cgi-bin/redir.cgi?id=N&member=23000000&profile=113926&lang=pl","king300x250.gif","",""]; bannersPos3[1] = ["http://banner.noblecasino.com/cgi-bin/redir.cgi?id=N&member=28000000&profile=731&lang=pl","noblecasino300x250.gif","",""]; bannersPos3[2] = ["http://banner.scasino.com/cgi-bin/redir.cgi?id=N&member=27000000&profile=83736&lang=pl","swiss300x250.gif","",""]; var bannersPos4 = new Array(); bannersPos4[0] = ["http://record.affiliatelounge.com/_hx6r2MgcaRolOu7JtGVLpBrFFivPkxGP/12","bc300x250.gif","",""]; bannersPos4[1] = ["http://serve.21nova.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=835509611&lp=835438776","21nova300x250PLindex.gif","",""]; bannersPos4[2] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=14153249&lp=0","EuroGrandPL300x250.gif","",""]; bannersPos4[3] = ["http://banner.casinolasvegas.com/cgi-bin/redir.cgi?id=N&member=24000000&profile=79853&lang=pl","LasVegasCasino300x250-PL.gif","",""]; var bannersPos5 = new Array(); bannersPos5[0] = ["http://serve.prestigecasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2hu&zone=14153373&lp=0","prestige46860.gif","","prestige casino"]; bannersPos5[1] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=14153249&lp=0","eurogrand490pl.gif","","Euro Grand Casino"]; bannersPos5[2] = ["http://serve.joylandcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=908282828&lp=0","joyland490.gif","","Joyland Casino"]; bannersPos5[3] = ["http://www.acf-webmaster.net/modules/link/894/104414/ocrpoc/","pl-riva-468x60-20-40k.gif","","Casino Riva"]; var bannersPos6 = new Array(); bannersPos6[0] = ["http://serve.prestigecasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2hu&zone=14153373&lp=0","prestige120600.gif","","prestige casino"]; bannersPos6[1] = ["http://serve.eurogrand.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=14153249&lp=0","eurogrand160pl2.gif","","Euro Grand Casino"]; bannersPos6[2] = ["http://serve.joylandcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=polan&zone=908282828&lp=0","joylandtowerpl.gif","","Joyland Casino"]; bannersPos6[3] = ["http://www.acf-webmaster.net/modules/link/894/104414/ocrpoc/","riva-160x600-35k-pl.gif","","Casino Riva"]; $(document).ready(function() { var totalAdsTypeArr = new Array(1,2,3,4,5,6); var pageTitle = document.title; // Get Page Meta Title pageTitle = pageTitle.substring(0,pageTitle.indexOf('Onlinecasinoreports.pl')); 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 += '
'; // Check if banner has a flash banner - in case found use the flash code if (bannerSelected[2].length > 10) bannerHTML += bannerSelected[2]; else bannerHTML += ''; $("#adPosition"+adPosId).html(bannerHTML); $("#adPosition"+adPosId).show(); } } }); });