// fix for macromedia flash ads document.write(""); function Ad(id, linkGif, linkUrl, text, xDim, yDim, priority, html) { this.id = id; this.linkUrl = linkUrl; this.linkGif = linkGif; this.text = text; this.xDim = xDim; this.yDim = yDim; this.priority = priority; this.html = html; } function CreateRandomNumber(Min, Max) { var range = Max-Min+1; return (Math.floor(Math.random() * Math.pow(10,("" + range).length)) % range) + parseInt(Min); } var ads = new Array(); ads[4206091] = new Ad(4206091, "/uploaded-images/4206091/ad-1.gif", "%2Fstickerworld%2Fphoto%2Fintro.php", "Make-Your-Own Photo Sticker", "120", "90", "Medium", ""); ads[4206092] = new Ad(4206092, "/uploaded-images/4206092/ad-1.gif", "%2Fstickerworld", "Sticker World", "468", "60", "Medium", ""); ads[4206093] = new Ad(4206093, "/uploaded-images/4206093/ad-1.gif", "%2Fstickerworld", "Sticker World", "120", "60", "Medium", ""); ads[4206110] = new Ad(4206110, "/uploaded-images/4206110/ad-1.gif", "", "", "80", "50", "Medium", ""); ads[4206111] = new Ad(4206111, "/uploaded-images/4206111/ad-1.gif", "", "", "120", "90", "Medium", ""); ads[10742319] = new Ad(10742319, "/uploaded-images/10742319/ad-1.gif", "%2Fsesamestreet%2Fstories%2Fflash.php%3FcontentId%3D10725410%26solution%3Dsaving", "Play the Lemonade Stand!", "468", "60", "Medium", ""); ads[10742338] = new Ad(10742338, "/uploaded-images/10742338/ad-1.gif", "%2Fsesamestreet%2Fstories%2Fflash.php%3FcontentId%3D10725410%26solution%3Dsaving", "Play the Lemonade Stand!", "120", "60", "Medium", ""); ads[11092346] = new Ad(11092346, "/uploaded-images/11092346/ad-1.gif", "%2Feducationalresources", "Talk, Read, Write!", "120", "60", "Medium", ""); ads[12054273] = new Ad(12054273, "/uploaded-images/12054273/ad-1.gif", "http%3A%2F%2Fsupportus.sesameworkshop.org%2Fsite%2Fpp.aspx%3Fc%3DnlI3IkNXJsE%26b%3D2621077+", "Make a donation online.", "468", "60", "Medium", ""); ads[12054285] = new Ad(12054285, "/uploaded-images/12054285/ad-1.gif", "http%3A%2F%2Fsupportus.sesameworkshop.org%2Fsite%2Fpp.aspx%3Fc%3DnlI3IkNXJsE%26b%3D2621077+", "Donate online", "468", "60", "Low", ""); ads[12054294] = new Ad(12054294, "/uploaded-images/12054294/ad-1.gif", "http%3A%2F%2Fsupportus.sesameworkshop.org%2Fsite%2Fpp.aspx%3Fc%3DnlI3IkNXJsE%26b%3D2621077+", "Donate online", "120", "60", "High", ""); ads[12526653] = new Ad(12526653, "/uploaded-images/12526653/ad-1.gif", "%2Fsesamestreet%2Fgames%2Fflash.php%3FcontentId%3D12529198%26solution%3Dschool", "Happy, Healthy, Ready for School", "468", "60", "Medium", ""); ads[12526658] = new Ad(12526658, "/uploaded-images/12526658/ad-1.gif", "%2Fsesamestreet%2Fstories%2Fflash.php%3FcontentId%3D12526254%26solution%3Dschool", "Happy, Healthy, Ready for School", "120", "60", "Medium", ""); ads[13346664] = new Ad(13346664, "/uploaded-images/13346664/ad-1.gif", "%2Faboutus%2Fintro.php", "Sesame Workshop", "468", "60", "Low", ""); ads[15368876] = new Ad(15368876, "/uploaded-images/15368876/ad-1.gif", "http%3A%2F%2Fmobilestore.sesameworkshop.org", "Get Sesame Street ringtones and wallpapers!", "120", "60", "High", ""); ads[15368883] = new Ad(15368883, "/uploaded-images/15368883/ad-1.gif", "http%3A%2F%2Fmobilestore.sesameworkshop.org", "Get Sesame Street ringtones and wallpapers!", "468", "60", "High", ""); ads[15368888] = new Ad(15368888, "/uploaded-images/15368888/ad-1.gif", "http%3A%2F%2Fmobilestore.sesameworkshop.org", "Get Sesame Street ringtones and wallpapers!", "120", "60", "High", ""); ads[15368906] = new Ad(15368906, "/uploaded-images/15368906/ad-1.gif", "http%3A%2F%2Fmobilestore.sesameworkshop.org", "Get Sesame Street ringtones and wallpapers!", "468", "60", "High", ""); ads[15741128] = new Ad(15741128, "/uploaded-images/15741128/ad-1.gif", "%2Fbridge.php%3Furl%3Dhttp%253A%252F%252Fwww.earthsbest.com", "Earth's Best", "468", "60", "High", ""); ads[16123351] = new Ad(16123351, "/uploaded-images/16123351/ad-1.swf", "http%3A%2F%2Fwww.sesameworkshop.org%2Fgwr%3Ft%3D16080661", "Think Pinky! Pinky Dinky Doo", "468", "60", "Medium", ""); ads[16747721] = new Ad(16747721, "/uploaded-images/16747721/ad-1.gif", "%2Fbridge.php%3Furl%3Dhttp%253A%252F%252Fclk.atdmt.com%252FNYC%252Fgo%252Fssmstplm0500000159nyc%252Fdirect%253Bwi.468%253Bhi.60%252F01%252F", "everydaykidz.com", "468", "60", "High", ""); ads[17728415] = new Ad(17728415, "/uploaded-images/17728415/ad-1.gif", "%2Fbridge.php%3Furl%3Dhttp%253A%252F%252Fwww.beaches.com%252F", "beaches.com", "468", "60", "High", ""); ads[17728418] = new Ad(17728418, "/uploaded-images/17728418/ad-1.gif", "%2Fbridge.php%3Furl%3Dhttp%253A%252F%252Fwww.beaches.com%252F", "beaches.com", "468", "60", "High", ""); ads[18060681] = new Ad(18060681, "/uploaded-images/18060681/ad-1.gif", "%2Fbridge.php%3Furl%3Dhttp%253A%252F%252Fwww.newbalance.com%252Fkids%253Fcm_mmc%253Dsesamestreetworkshop.org-_-Online%2BMedia-_-Kids-_-Sesame.org_468x60", "http://www.newbalance.com/kids/", "468", "60", "High", ""); ads[18828839] = new Ad(18828839, "/uploaded-images/18828839/ad-1.gif", "http%3A%2F%2Fvideo.sesameworkshop.org%2F", "Sesame Street video player", "468", "60", "High", ""); ads[19015062] = new Ad(19015062, "/uploaded-images/19015062/ad-1.swf", "http%3A%2F%2Fwww.panwapa.com%2F", "Visit www.panwapa.com", "468", "60", "High", ""); ads[19076439] = new Ad(19076439, "/uploaded-images/19076439/ad-1.swf", "http%3A%2F%2Fwww.panwapa.com%2F", "visit panwapa.com", "468", "60", "High", ""); ads[19076458] = new Ad(19076458, "/uploaded-images/19076458/ad-1.swf", "http%3A%2F%2Fwww.panwapa.com%2F", "visit panwapa.com", "468", "60", "High", ""); ads[19076469] = new Ad(19076469, "/uploaded-images/19076469/ad-1.swf", "http%3A%2F%2Fwww.panwapa.com%2F", "visit panwapa.com", "468", "60", "High", ""); ads[19076482] = new Ad(19076482, "/uploaded-images/19076482/ad-1.swf", "http%3A%2F%2Fwww.panwapa.com%2F", "visit panwapa.com", "468", "60", "High", ""); var adPatterns = new Array(); adPatterns["/parents/solutions/celebrations"] = new Array(15368888,15368906); adPatterns["/parents/solutions/safety"] = new Array(15368888,15368888); adPatterns["/parents/solutions/school"] = new Array(12526653,12526658,15368906); adPatterns["/parents/solutions/health"] = new Array(15368876,15368876); adPatterns["/parents/solutions/immunization"] = new Array(15368876,15368883); adPatterns["/parents/solutions/saving"] = new Array(10742338,15368876,15368883,15368888,15368906); adPatterns["/parents/activities"] = new Array(15368876,15368883,15368888); adPatterns["/parents"] = new Array(10742319,12054273,12054285,12054294,13346664,15368876,15368883,15368888,15368906,16123351); adPatterns["scrollerId=games"] = new Array(12054273,12054285,12054294,12526653,12526658,18828839,19015062,19076439,19076458,19076469,19076482); adPatterns["scrollerId=stories"] = new Array(10742319,10742338,12526653,12526658,16123351,19015062,19076439,19076458,19076469,19076482); adPatterns["scrollerId=art"] = new Array(19076439,19076458,19076469,19076482); adPatterns["/sesamestreet"] = new Array(12054273,13346664,18828839,19015062); adPatterns["/stickerworld"] = new Array(4206091,4206092,4206093,19015062,19076439,19076458,19076469,19076482); adPatterns["homepage"] = new Array(11092346,15741128,16747721,17728415,17728418,18060681); var noMatch = new Array(4206110,4206111,11092346,12054294,13346664,16123351); function getAdsFromMatchList(matchList,x,y) { var matches = new Array(); for (var i=0; i < matchList.length; i++) { if (ads[matchList[i]].xDim==x && ads[matchList[i]].yDim==y) { matches[matches.length]=ads[matchList[i]]; } } if (matches.length > 0) { return matches; } else { return new Array(); } } function getMatches(x,y,page) { for (pattern in adPatterns) { if ( page.indexOf(pattern) != -1 ) { sizeMatches = getAdsFromMatchList(adPatterns[pattern],x,y); if (sizeMatches.length>0) { return sizeMatches; } } } return getAdsFromMatchList(noMatch,x,y); } function getMatchesByPriority( priority, matches ) { var priorityMatches = new Array(); for( var i=0; i 0 ) { return priorityMatches; } } return new Array(); } function getPopUpAdLink(x, y, page) { var matches = getMatches(x, y, page); matches = getPriorityMatches(matches); var r = CreateRandomNumber(0, matches.length - 1); if (matches.length > 0) { link = "/popup/popup.php?contentId="; link += matches[r].id; link += "&url="+matches[r].linkUrl; return link + "&width="+matches[r].xDim+"&height="+matches[r].yDim; } } function getAdLink(x, y, page) { var matches = getMatches(x,y,page); matches = getPriorityMatches(matches); var r = CreateRandomNumber(0, matches.length - 1); tmp = ""; if (matches[r].html != "") { tmp = matches[r].html; var url = "\/adservice\/adredirector.php?contentId="; url += matches[r].id; url += "&url="+matches[r].linkUrl; tmp = tmp.replace(/URLREPLACE/g,""+escape(url)); } else { tmp = ""; var linkLength = (matches[r].linkGif).length; fix = ""; if ((matches[r].linkGif).substr(linkLength-3,3) == "swf") { tmp += "