function $(id){return document.getElementById(id);}

window.onload = getAdDivContent;

function getAdDivContent(){ 
  var params = '';
  try {
    params = document.body.className.split("-");
  }
  catch(e) {
    params = getAdParams();	
  }
  var p = params[1];
  var c = params[2] ? params[2] : null;
  var divs = ['adsTop', 'adsRight', 'adsBottom', 'adsLeft'];
  for(var i = 0; i < divs.length; i++){
    $(divs[i]).innerHTML = getAds(p, c, i);  
  }
}

function getAdParams(){
	var b=document.getElementsByTagName("body")[0];
	return b.getAttribute("class").split("-");
}

function getAds(p, c, div){

	var urls = [
		{"id":0, "name": "Alibris","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=99238.10000007&type=4&subid=0"><img alt="Alibris - Books You Thought You\'d Never Find" src="http://images.alibris.com/marketing/468_blue.gif"></a><img width="1" height="1" alt="" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=99238.10000007&type=4&subid=0" />'],"active":1},
		{"id":1, "name": "Baby Wise","url":['<a rel="external" href="http://www.dpbolvw.net/click-2269562-10395428"><img src="http://www.awltovhc.com/image-2269562-10395428" width="468" height="60" alt="baby-Wise.com" border="0" /></a>'],"active":1},
		{"id":2, "name": "Costume Super Store", "url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=117715.10000001&type=4&subid=0"><img alt="" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=117715.10000001&type=4&subid=0"></a>'], "active":1},
		{"id":3, "name": "Dell Home Systems", "url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=85078&subid=0"><img alt="Dell Home Systems" width="120" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=85078&gridnum=6&catid=-1&subid=0" /></a>'], "active":0},
		{"id":4, "name": "Survivor Posters", "url":['<a rel="external" href="http://www.survivorposters.com"><img src="http://www.survivorposters.com/i/SurvivorAd.jpg" width="125" height="198" alt="Survivor Posters" /></a>'], "active":0},
		{"id":5, "name": "Crayola","url":['<a rel="external" href="http://www.dpbolvw.net/click-2269562-10292417"><img src="http://www.tqlkg.com/image-2269562-10292417" width="125" height="125" alt="" /></a>'],"active":0},
		{"id":6, "name": "Baby Center Store","url":['<a rel="external" href="http://www.anrdoezrs.net/click-2269562-10450329"><img src="http://www.lduhtrp.net/image-2269562-10450329" width="125" height="125" alt="SALE NOW at the BabyCenter Store" border="0" /></a>'],"active":0},
		{"id":7, "name": "Oriental Trading Co.","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=10012.9&type=4&subid=0"><img alt="Oriental Trading Company, Inc." src="http://www.orientaltrading.com/images/banners/otc120x240.gif" width="120" height="240" /></a>'],"active":0},
		{"id":8, "name": "Mini Tots","url":['<a rel="external" href="http://www.kqzyfj.com/click-2269562-10364364"><img src="http://www.tqlkg.com/image-2269562-10364364" width="468" height="60" alt="Quality Baby Furniture for the Lowest Prices" border="0" /></a>'],"active":1},
		{"id":9, "name": "Baby Universe","url":['<a rel="external" href="http://www.dpbolvw.net/click-2269562-10438741"><img src="http://www.awltovhc.com/image-2269562-10438741" width="468" height="60" alt="" /></a>'],"active":0},
		{"id":10, "name": "Shutterfly","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=124259.10000006&type=4&subid=0"><img alt="Shutterfly" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=124259.10000006&type=4&subid=0" /></a>'],"active":0},
		{"id":11, "name": "Montgomery Ward","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=113018.10000007&type=4&subid=0"><img alt="FurnSale-468x60" src="http://zoom.dmserv.com/email/LS_WD/wards_furn_468x60.gif"></a><img width="1" height="1" alt="" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=113018.10000007&type=4&subid=0" />'],"active":1},
		{"id":12, "name": "Nursery Depot","url":['<a rel="external" href="http://www.anrdoezrs.net/click-2269562-9783307"><img src="http://www.awltovhc.com/image-2269562-9783307" width="468" height="60" alt="Nursery Depot - For all your Baby Nursery and Kids" border="0"/></a>'],"active":1},
		{"id":13, "name": "PoshTots","url":['<a rel="external" href="http://www.anrdoezrs.net/click-2269562-10376525"><img src="http://www.lduhtrp.net/image-2269562-10376525" width="468" height="60" alt="Win $1000 PoshTots Shopping Spree" /></a>'],"active":1},
		{"id":14, "name": "Corner Stork Baby Store","url":['<a rel="external" href="http://www.kqzyfj.com/click-2269562-10451257"><img src="http://www.lduhtrp.net/image-2269562-10451257" width="468" height="60" alt="Personalized Baby Gifts" /></a>'],"active":1},
		{"id":15, "name": "2Blockheads.com","url":['<a rel="external" href="http://www.tkqlhce.com/click-2269562-10356026"><img src="http://www.lduhtrp.net/image-2269562-10356026" width="468" height="60" alt="2Blockheads.com" border="0"/></a>'],"active":1},
		{"id":16, "name": "Menscience","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=95198.10000010&type=4&subid=0"><img alt="banner" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=95198.10000010&type=4&subid=0"></a>'],"active":1},
		{"id":17, "name": "Baby to Bee","url":['<a rel="external" href="http://www.anrdoezrs.net/click-2269562-10416505"><img src="http://www.ftjcfx.com/image-2269562-10416505" width="468" height="60" alt="Someone having a baby? Sign them up for FREE stuff" border="0" /></a>'],"active":1},
		{"id":18, "name": "Domestic Bin","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=86133.10000001&type=4&subid=0"><img alt="db-bedinabag" src="http://www.domesticbin.com/banners/dbbedbag_468x60.jpg"></a><img width="1" height="1" alt="" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=86133.10000001&type=4&subid=0" />'],"active":0},
		{"id":19, "name": "FrenchToast","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=35646.10000001&subid=0&type=4"><img alt="Frenchtoast.com" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=35646.10000001&subid=0&type=4&gridnum=1" /></a>'],"active":1},
		{"id":20, "name": "eToys","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=85913.10000016&type=4&subid=0"><img alt="Discover Toys_468x60" src="http://www.etoys.com/g/m/eToysWeeklyPromo_468x60.gif" /></a><img width="1" height="1" alt="" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=85913.10000016&type=4&subid=0" />'],"active":1},
		{"id":21, "name": "Click-n-Read Phonics","url":['<a rel="external" href="http://www.kqzyfj.com/click-2269562-10434231"><img src="http://www.ftjcfx.com/image-2269562-10434231" width="468" height="60" alt="468x60_b" /></a>'],"active":1},
		{"id":22, "name": "CheapTickets.com","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=113676.10000167&subid=0&type=4"><img alt="CheapTickets Long Weekend Exp Feb 18, 2007" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=113676.10000167&subid=0&type=4&gridnum=-1" /></a>'],"active":1},
		{"id":23, "name": "Mother's Work","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=83577.10000300&type=4&subid=0"><img alt="Mothers Work, Inc." src="http://www.motherswork.com/images/linkshare/spring07/pea468.jpg" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=83577.10000300&type=4&subid=0" />','<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=83577&subid=0"><img alt="Mothers Work, Inc." border="0"  width="468" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=83577&gridnum=1&catid=-1&subid=0" /></a>'],"active":1},
		{"id":24, "name": "Your Kids Direct","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=112930.10000022&type=4&subid=0"><img alt="YourKidsDirect.com" src="http://zoom.dmserv.com/email/LS-YKD/ykd_468x60teengift.gif" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=112930.10000022&type=4&subid=0" />'],"active":1},
		{"id":25, "name": "Dr. Soy","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=96728.10000006&subid=0&type=4"><img alt="DrSoy Tasty Snacks" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=96728.10000006&subid=0&type=4&gridnum=1" /></a>'],"active":1},
		{"id":26, "name": "Macy's","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=100713.10000090&subid=0&type=4"><img alt="macys.com" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=100713.10000090&subid=0&type=4&gridnum=1" /></a>'],"active":1},
		{"id":27, "name": "Last Minute Travel","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=88046&subid=0"><img alt="LastMinuteTravel.com" width="468" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=88046&gridnum=1&catid=-1&subid=0" /></a>'],"active":0},
		{"id":28, "name": "Home Annex","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=116103.10000011&type=4&subid=0"><img alt="HomeAnnex" border="0" src="http://www.homeannex.com/linkShare/HA_proban_468x60_v2.gif" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=116103.10000011&type=4&subid=0" />'],"active":0},
		{"id":29, "name": "Ty's Toy Box","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=92932.10000069&type=4&subid=0"><img alt="MaxRuby" src="http://www.tystoybox.com/ctlimg/tystoybox/store/img/AffiliateBanners/MR_468x60.jpg" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=92932.10000069&type=4&subid=0" />'],"active":0},
		{"id":30, "name": "Cingular Wireless","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&subid=0"><img alt="Cingular Wireless, LLC" border="0" width="468" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=91613.10000026+91613.10000052+91613.10000144&gridnum=1&subid=0" /></a>'],"active":1},
		{"id":31, "name": "Overstock.com","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=57189.10001972&type=4&subid=0"><img alt="Overstock.com, Inc." src="http://www.overstock.com/img/linkshare/012005_vdayfreeship_468x60.gif" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=57189.10001972&type=4&subid=0" />'],"active":1},
		{"id":32, "name": "ProFlowers.com","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=118949.10000004&type=4&subid=0"><img alt="Fresh Flowers from $19.99 w/ FREE vase!" src="http://images.proflowers.com/banners/468x060/468x60FrshFlwrsTul19.gif" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=118949.10000004&type=4&subid=0" />'],"active":1},
		{"id":33, "name": "Derma Doctor","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=30329.10000037&type=4&subid=0"><img alt="DERMAdoctor.com, Inc." src="http://www.dermadoctoraffiliates.com/ads/3skinisinanim.gif" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=30329.10000037&type=4&subid=0" />'],"active":1},
		{"id":34, "name": "Niche Retail","url":['<a rel="external" href="http://www.tkqlhce.com/click-2269562-10431940"><img src="http://www.ftjcfx.com/image-2269562-10431940" width="468" height="60" alt="" /></a>'],"active":1},
		{"id":35, "name": "Luggage Online","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=81276.10000057&type=4&subid=0"><img alt="Luggage OnLine" src="http://www.luggageonline.com/banners/luggageonly_island2.gif" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=81276.10000057&type=4&subid=0" />'],"active":1},
		{"id":36, "name": "Footlocker.com","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=101680.10000187&type=4&subid=0"><img alt="Footlocker.com" src="http://a712.g.akamai.net/7/712/225/1d/www.footlocker.com/images/linkshare/Footlocker/fl_468x60_megab.jpg" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=101680.10000187&type=4&subid=0" />'],"active":1},
		{"id":37, "name": "Gaiam.com","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&subid=0"><img alt="Gaiam.com, Inc" width="468" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=121237.10000008+121237.10000129+121237.10000134&gridnum=1&subid=0" /></a>'],"active":1},
		{"id":38, "name": "Sierra Club","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&subid=0"><img alt="Sierra Club" width="468" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=46111.10000033+46111.10000086+46111.10000088+46111.10000120+46111.10000126&gridnum=1&subid=0" /></a>'],"active":1},
		{"id":39, "name": "Prep Sportwear","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=116553.10000072&type=4&subid=0"><img alt="Prep Sportswear" src="http://www.prepsportswear.com/LS/football1/468x60.jpg" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=116553.10000072&type=4&subid=0" />'],"active":1},
		{"id":40, "name": "Hotwire.com","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&subid=0"><img alt="Hotwire" width="468" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=120349.10000178+120349.10000226+120349.10000227+120349.10000228+120349.10000322&gridnum=1&subid=0" /></a>'],"active":0},
		{"id":41, "name": "Apple.com","url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=77305.10001763&type=4&subid=0"><img alt="Apple Store" src="http://afimages.apple.com/smb/TaxPromo_468x60.jpg" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=77305.10001763&type=4&subid=0" />'],"active":1},
		{"id":42, "name": "Be Net Safe","url":['<a rel="external" href="http://www.tkqlhce.com/click-2269562-10442191"><img src="http://www.tqlkg.com/image-2269562-10442191" width="468" height="60" alt="BeNetSafe - Helping keep children safe online" border="0" /></a>','<a rel="external" href="http://www.anrdoezrs.net/click-2269562-10442189"><img src="http://www.lduhtrp.net/image-2269562-10442189" width="468" height="60" alt="BeNetSafe - Helping keep children safe online" /></a>'],"active":0},
		{"id":43, "name": "Simply Audio Books", "url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=99239.10000109&type=4&subid=0"><img alt="Simply Audiobooks, Inc." src="http://www.simplyaudiobooks.com/images/1sales468x60.jpg" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=99239.10000109&type=4&subid=0" />'], "active":0},
		{"id":44, "name": "Fairfield Hotels", "url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=92979&subid=0"><img alt="FairfieldGetaway Vacation" width="468" height="60" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=92979&gridnum=1&catid=1&subid=0" /></a>'], "active":1},
		{"id":45, "name": "Iseeme.com", "url":['<a rel="external" href="http://www.jdoqocy.com/click-2269562-5593566"><img src="http://www.tqlkg.com/image-2269562-5593566" width="468" height="60" alt="Personalized Children\'s Books.  Click here!" /></a>'], "active":1},
		{"id":46, "name": "NetFlix", "url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/click?id=HF3/PPu*220&offerid=78684.10000090&type=4&subid=0"><img alt="Netflix, Inc." src="http://cdn.netflix.com/us/affiliates/banners/0804/468060B_599.gif" /></a><img width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=78684.10000090&type=4&subid=0" />'], "active":1},
		{"id":47, "name": "Nest Entertainment", "url":['<a rel="external" href="http://www.anrdoezrs.net/click-2269562-10418673"><img src="http://www.lduhtrp.net/image-2269562-10418673" width="468" height="60" alt="39% Off NEST Learning 468x60 Banner" /></a>'], "active":0},
		{"id":48, "name": "Movie Link", "url":['<a rel="external" href="http://click.linksynergy.com/fs-bin/stat?id=HF3/PPu*220&offerid=50544.10000050&type=4&subid=0"><img alt="Movielink - Travel - 468x60" src="http://www.movielink.com/MEDIA/CustomProductCatalog/m1330969/travel_468x60.gif" /></a><img width="1" height="1" alt="banner" src="http://ad.linksynergy.com/fs-bin/show?id=HF3/PPu*220&bids=50544.10000050&type=4&subid=0" />'], "active":1},
		{"id":49, "name": "SurrogateMothers.com", "url":['<a rel="external" href="http://www.surrogatemothers.com"><img alt="Surrogate Mothers, Inc." src="/i/surrogacy_attorney_ad.jpg" width="468" height="60" /></a>'], "active":1},
		{"id":50, "name": "Dare Family Services", "url":['<a rel="external" href="http://www.darefamily.org/"><img alt="Dare Family Services" src="/i/Dare_Family_Ad.jpg" width="99" height="144" /></a>'], "active":1},
		{"id":51, "name": "Donor Referrals", "url":['<a rel="external" href="http://www.donorreferrals.com/"><img alt="Donor Referrals" src="/i/Donor_Referrals_ad.jpg" width="125" height="175" /></a>'], "active":1},
		{"id":52, "name": "Mary Stockton", "url":['<a rel="external" href="http://www.marylstockton.nylagents.com/"><img alt="Stockton Financial &amp; Insurance Services" src="/i/Mary_stockton_banner.jpg" width="468" height="60" /></a>'], "active":1},
		{"id":53, "name": "The Total Conception Kit", "url":['<a rel="external" href="http://www.thetotalconceptionkit.com/"><img alt="The Total Conception Kit" src="/adam/ads/thetotalconceptionkit.gif" width="468" height="60" /></a>'], "active":1},
	];

	/*{"id":, "name": "", "url":[''], "active":1},*/
	
	var ads = 
		[
		{"div":0, "pg":"3",   "ad":0,  "url":0},
		{"div":0, "pg":"8",   "ad":42, "url":1},
		{"div":0, "pg":"10",  "ad":22, "url":0},
		//{"div":0, "pg":"12",  "ad":1,  "url":0},
		{"div":0, "pg":"12",  "ad":53, "url":0},
		{"div":0, "pg":"13",  "ad":10, "url":0},
		{"div":0, "pg":"13",  "ad":49, "url":0},
		{"div":0, "pg":"14",  "ad":17, "url":0},
		{"div":0, "pg":"15",  "ad":11, "url":0},
		//{"div":0, "pg":"16",  "ad":12, "url":0},
		{"div":0, "pg":"16",  "ad":53, "url":0},
		{"div":0, "pg":"17",  "ad":42, "url":0},
		{"div":0, "pg":"40",  "ad":33, "url":0},
		{"div":0, "pg":"60",  "ad":36, "url":0},
		{"div":0, "pg":"61",  "ad":26, "url":0},
		{"div":0, "pg":"107", "ad":40, "url":0},
		{"div":0, "pg":"158", "ad":46, "url":0},
		{"div":0, "pg":"107", "ad":52, "url":0},
		{"div":1, "pg":"all", "ad":3,  "url":0},
		{"div":1, "pg":"15",  "ad":50, "url":0},
		//{"div":1, "pg":"12",  "ad":51, "url":0},
		{"div":2, "pg":"3",   "ad":43, "url":0},
		{"div":2, "pg":"3",   "ad":44, "url":0},
		{"div":2, "pg":"3",   "ad":45, "url":0},
		{"div":2, "pg":"8",   "ad":30, "url":0},
		{"div":2, "pg":"8",   "ad":31, "url":0},
		{"div":2, "pg":"8",   "ad":32, "url":0},
		{"div":2, "pg":"10",  "ad":23, "url":0},
		{"div":2, "pg":"10",  "ad":24, "url":0},
		{"div":2, "pg":"10",  "ad":25, "url":0},
		//{"div":2, "pg":"12",  "ad":8,  "url":0},
		//{"div":2, "pg":"12",  "ad":9,  "url":0},
		//{"div":2, "pg":"12",  "ad":10, "url":0},
		{"div":2, "pg":"13",  "ad":16, "url":0},
		{"div":2, "pg":"13",  "ad":17, "url":0},
		{"div":2, "pg":"14",  "ad":12, "url":0},
		{"div":2, "pg":"14",  "ad":13, "url":0},
		{"div":2, "pg":"14",  "ad":14, "url":0},
		{"div":2, "pg":"15",  "ad":0,  "url":0}, 
		{"div":2, "pg":"15",  "ad":2,  "url":0}, 
		{"div":2, "pg":"15",  "ad":15, "url":0}, 
		//{"div":2, "pg":"16",  "ad":8,  "url":0},
		//{"div":2, "pg":"16",  "ad":17, "url":0},
		//{"div":2, "pg":"16",  "ad":18, "url":0},
		{"div":2, "pg":"17",  "ad":19, "url":0},
		{"div":2, "pg":"17",  "ad":20, "url":0},
		{"div":2, "pg":"17",  "ad":21, "url":0},
		{"div":2, "pg":"40",  "ad":25, "url":0},
		{"div":2, "pg":"40",  "ad":34, "url":0},
		{"div":2, "pg":"40",  "ad":35, "url":0},
		{"div":2, "pg":"60",  "ad":37, "url":0},
		{"div":2, "pg":"60",  "ad":38, "url":0},
		{"div":2, "pg":"60",  "ad":39, "url":0},
		{"div":2, "pg":"61",  "ad":27, "url":0},
		{"div":2, "pg":"61",  "ad":28, "url":0},
		{"div":2, "pg":"61",  "ad":29, "url":0},
		{"div":2, "pg":"107", "ad":41, "url":0},
		{"div":2, "pg":"107", "ad":30, "url":0},
		{"div":2, "pg":"107", "ad":42, "url":0},
		{"div":2, "pg":"158", "ad":47, "url":0},
		{"div":2, "pg":"158", "ad":48, "url":0},
		{"div":3, "pg":"all", "ad":4,  "url":0},
		{"div":3, "pg":"all", "ad":5,  "url":0},
		{"div":3, "pg":"all", "ad":6,  "url":0},
		//
		//{"div":3, "pg":"all", "ad":7,  "url":0}
		];
		
  var divAds = divUniversalAds = new Array();
  
	for(var i=0;i<ads.length;i++){
		if(ads[i].div == div){
			var u = ads[i].ad;
			var a = ads[i].url
			if(ads[i].pg == "all"){
				urls[u].active==1 ? divUniversalAds.push(urls[u].url[a]) : '';
			}else{
				if(ads[i].pg == p){
					urls[u].active==1 ? divAds.push(urls[u].url[a]) : '';
				}
			}
		}
	}
	
	if ( divAds.length == 0 ) {
		divAds = divUniversalAds;
	}
  
  //fix previous programmer's braindead ad server scheme
	if ( divAds.length > 0 ) {
		var rnd=Math.floor(Math.random()*(divAds.length));
		return divAds[rnd];
	}
	return '';

  //return divAds.length>0?divAds.join('',divAds):'';  
}
