var bannersPos1 = new Array(); bannersPos1[0] = ["http://www.fortuneaffiliates.eu/tagservlet/tagservlet?btag=ad_248081","pp-pt-600x74-00.gif","",""]; bannersPos1[1] = ["http://pt.partycasino.com/index.htm?wm=3231999","partycasinogif-welcome-pt-eu.gif","",""]; bannersPos1[2] = ["http://banner.noblecasino.com/cgi-bin/redir.cgi?id=N&member=28000000&profile=392&lang=pt","nc600x74pt400.gif","",""]; bannersPos1[3] = ["http://banner.casinoking.com/cgi-bin/redir.cgi?id=N&member=23000000&profile=117052&lang=pt","ck600x74pt300.gif","",""]; bannersPos1[4] = ["http://serve.williamhillcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2combr&zone=1467879029&lp=1467879044","willhill600x70-pt.gif","",""]; var bannersPos2 = new Array(); bannersPos2[0] = ["http://online.titanpoker.com/promoRedirect?key=em9uZUlkPTE0Mjk5NzEwJmxhbmRpbmdQYWdlSWQ9MTQyOTk2NDMmcHJvZmlsZUlkPTI3MjExNw%3D%3D","titanpoker300pt3.gif","","titan"]; bannersPos2[1] = ["http://pt-br.crazyvegas.com/wow.asp?btag=w25412c314p001","300x250-cvc-pt-br-kp-09-06-10.gif","",""]; bannersPos2[2] = ["http://pt.partycasino.com/index.htm?wm=3231999","partycasino300x250-gif-welcome-pt-eu.gif","","Cassinos On-line"]; bannersPos2[3] = ["http://pt.partycasino.com/index.htm?wm=3231999","partycasino300x250-gif-welcome-pt-eu.gif","","Cassinos On-line"]; bannersPos2[4] = ["http://banner.noblecasino.com/cgi-bin/redir.cgi?id=N&member=28000000&profile=392&lang=pt","nc300x250pt400.gif","",""]; bannersPos2[5] = ["http://serve.williamhill.com/promoRedirect?key=em9uZUlkPTEwNTE5MDY5NDEmbGFuZGluZ1BhZ2VJZD0xMzUxMDE5MCZwcm9maWxlSWQ9MTEwNDQ%3D","WillHillSports300x250-pt.gif","","esportes"]; bannersPos2[6] = ["http://serve.williamhillcasino.com/promoRedirect?member=wtinfo&campaign=DEFAULT&channel=ocr2combr&zone=1467879029&lp=1467879044","WillHillCasino300x250-pt2.gif","",""]; var bannersPos3 = new Array(); bannersPos3[0] = ["http://www.fortuneaffiliates.eu/tagservlet/tagservlet?btag=ad_248081","pp-pt-300x250-00.gif","",""]; bannersPos3[1] = ["http://banner.casinoking.com/cgi-bin/redir.cgi?id=N&member=23000000&profile=117052&lang=pt","ck300x250pt300.gif","",""]; var bannersPos5 = new Array(); bannersPos5[0] = ["http://www.acf-webmaster.net/modules/link/895/104404/ocrpoc/","pt-riva-468x60-20-40k.gif","","Casino Riva"]; var bannersPos6 = new Array(); bannersPos6[0] = ["http://www.acf-webmaster.net/modules/link/895/104404/ocrpoc/","riva-160x600-35k-pt.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.com.br')); 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 += '