var url = document.URL;


var dfpserver = "http://ad.doubleclick.net"
//random = Math.round(Math.random() * 10000000000);
random = Math.round(Math.random() * 8000000000 + 1000000000);
if (!pageNum) var pageNum = Math.round(Math.random() * 100000000);


/* 
 * in the spirit of keeping with this ultra ... simplified code, i'm going to add
 * a fourth index on to the array for the site param. I recognize this is not ideal. -- jbiehler  
 */ 


urlArray = new Array();        

/* contact */
urlArray[0] = new Array("utility_contact", "", "", "");

/* taking issue */
urlArray[1] = new Array("opinion_commentary", "", "4526956", "");

/* sports */
urlArray[2] = new Array("diversions_sports", "", "", "");

/* everywhere */
urlArray[3] = new Array("utility_everywhere", "", "", "");

/* send email */
urlArray[4] = new Array("utility_emailstory", "", "", "");

/* worldwide */
urlArray[5] = new Array("utility_everywhere_worldwide", "", "", "");

/* this i believe */
urlArray[6] = new Array("people___places", "", "4538138", "");

/* help */
urlArray[7] = new Array("utility_help", "", "", "");

/* about */
urlArray[8] = new Array("utility_about", "", "", "");

/* /differneces_opinion and /usopinion  */
urlArray[9] = new Array("opinion", "", "", "");

/* symphonycast */
urlArray[10] = new Array("music_classical_music", "SYMPHCAST", "", "");

/* driveway moments archives */
urlArray[11] = new Array("diversions", "", "driveway_moments", "");

/* music */
urlArray[12] = new Array("music", "", "", ".MUSIC");
urlArray[17] = new Array("music_blogs", "", "", ".MUSIC");

/* Holiday: Memorable Moments 2007 */
urlArray[13] = new Array("HOLIDAYS", "", "", "");

/* blogs */
urlArray[14] = new Array("BLOGS", "", "", "");

/* pictureshow */
urlArray[15] = new Array("PHOTOGALLERY_PICTURESHOW", "", "", "");

/* 404 pg in root directory */
urlArray[16] = new Array("utility_search", "", "", "");



/* PAGES IN /NEWS -- ARRAY RANGE FROM 20-39 */

/* hurricane, katrina, nola */
urlArray[20] = new Array("news_katrina___recovery", "", "", "");

/* election 2006 */
urlArray[21] = new Array("news_election_2006", "", "", "");

/* world cup 2006 */
urlArray[22] = new Array("diversions_world_cup_2006", "", "", "");

/* veto, alaska oil */
urlArray[23] = new Array("politics___society.politics", "", "", "");

/* barry bonds */
urlArray[24] = new Array("diversions_sports", "", "", "");

/* jonbenet, usdiverse, longevity */
urlArray[25] = new Array("news_nation", "", "", "");

/* climate */
urlArray[26] = new Array("Health___Science", "", "9657621", "");

/* election 2008 */
urlArray[27] = new Array("POLITICS___SOCIETY_ELECTION_2008", "", "ELECTIONS_2008_DEBATES", "");

/* inaug09 */
urlArray[28] = new Array("POLITICS___SOCIETY", "", "", "");



/* PAGES IN /PROGRAMS -- ARRAY RANGE FROM 50-69 */

/* protecting the kids contact form */
urlArray[50] = new Array("utility_contact", "ATC", "", "");

/* jazz profiles */
urlArray[51] = new Array("music_jazz", "PROFILES", "", ".MUSIC");

/* hidden kitchens */
urlArray[52] = new Array("DIVERSIONS_FOOD", "", "hidden_kitchens", "");

/* moments 2005 */
urlArray[53] = new Array("people___places", "", "memorable_moments_2005", "");

/* TOTN */
urlArray[54] = new Array("", "TOTN", "", "");

/* WWDTM */
urlArray[55] = new Array("diversion_fun___games", "WAITWAIT", "", "");

/* world of opera */
urlArray[56] = new Array("music_classical_music", "OPERA", "", "");

/* piano jazz */
urlArray[57] = new Array("music_jazz", "", "", ".MUSIC");

/* pt - for static page saying pt is going away */
urlArray[58] = new Array("music_classical_music", "PT", "", ".MUSIC");


/* DEFAULTS */

/* NEWS DEFUALT */
urlArray[40] = new Array("news", "", "", "");

/* PROGRAMS DEFUALT */
urlArray[70] = new Array("utility_programlist", "", "", "");

/* DEFAULT */
urlArray[99] = new Array("NO_TOPIC_STATIC_PAGE", "", "", "");




if (url.indexOf("contact") > -1)
{
	urlIndex = 0;
}
else if (url.indexOf("takingissue") > -1)
{
	urlIndex = 1;
}
else if (url.indexOf("sports") > -1)
{	
	urlIndex = 2;
}
else if (url.indexOf("everywhere") > -1)
{	
	urlIndex = 3;
}
else if (url.indexOf("sendEmail") > -1)
{	
	urlIndex = 4;
}
else if (url.indexOf("worldwide") > -1)
{	
	urlIndex = 5;
}
else if (url.indexOf("thisibelieve") > -1)
{	
	urlIndex = 6;
}
else if (url.indexOf("help") > -1)
{	
	urlIndex = 7;
}
else if (url.indexOf("about") > -1)
{	
	urlIndex = 8;
}
else if (url.indexOf("differences_opinion") > -1 || url.indexOf("usopinion") > -1)
{	
	urlIndex = 9;
}
else if (url.indexOf("symphonycast") > -1)
{	
	urlIndex = 10;
}
else if (url.indexOf("driveway") > -1)
{	
	urlIndex = 11;
}
else if (url.indexOf("music") > -1)
{	
	if (url.indexOf("blogs") > -1)
	{
	    urlIndex = 17;
	}
	else urlIndex = 12;
}
else if (url.indexOf("moments_2007") > -1)
{
	urlIndex = 13;
}
else if (url.indexOf("blogs") > -1)
{	
	urlIndex = 14;
}
else if (url.indexOf("pictureshow") > -1)
{	
	urlIndex = 15;
}
else if (url.indexOf("") > -1)
{	
	urlIndex = 16;
}


/* NEWS */
else if (url.indexOf("news") > -1)
{
	if (url.indexOf("hurricane") > -1 || url.indexOf("katrina") > -1 || url.indexOf("nola") > -1)
	{
		urlIndex = 20;
	}
	else if (url.indexOf("election2006") > -1)
	{
		urlIndex = 21;	
	}
	else if (url.indexOf("worldcup2006") > -1)
	{
		urlIndex = 22;	
	}
	else if (url.indexOf("veto") > -1 || url.indexOf("alaskaoil") > -1)
	{
		urlIndex = 23;	
	}
	else if (url.indexOf("bonds") > -1)
	{
		urlIndex = 24;	
	}
	else if (url.indexOf("jonbenet") > -1 || url.indexOf("usdiverse") > -1 || url.indexOf("longevity") > -1)
	{
		urlIndex = 25;	
	}
	else if (url.indexOf("climate") > -1)
	{
		urlIndex = 26;	
	}
	else if (url.indexOf("election2008") > -1)
	{
		urlIndex = 27;	
	}	
	else if (url.indexOf("inaug09") > -1)
	{
		urlIndex = 28;	
	}		

	/* NEWS DEFUALT */
	else
	{
		urlIndex = 40;	
	}			
}


/* PROGRAMS */
else if (url.indexOf("programs") > -1)
{
	if (url.indexOf("protectingthekids") > -1)
	{
		urlIndex = 50;
	}
	else if (url.indexOf("jazzprofiles") > -1)
	{
		urlIndex = 51;	
	}
	else if (url.indexOf("hiddenkitchens") > -1)
	{
		urlIndex = 52;	
	}
	else if (url.indexOf("moments_2005") > -1)
	{
		urlIndex = 53;	
	}
	else if (url.indexOf("totn") > -1)
	{
		urlIndex = 54;	
	}
	else if (url.indexOf("waitwait") > -1)
	{
		urlIndex = 55;	
	}
	else if (url.indexOf("worldofopera") > -1)
	{
		urlIndex = 56;	
	}
	else if (url.indexOf("pianojazz") > -1)
	{
		urlIndex = 57;	
	}
	else if (url.indexOf("pt") > -1)
	{
		urlIndex = 58;	
	}	
	

	/* PROGRAMS DEFUALT */
	else
	{
		urlIndex = 70;	
	}	

}


/* GENERIC DEFUALT */
else 
{
	urlIndex = 99;	
}


var target = "n6735.NPR" + urlArray[urlIndex][3] + "/" + urlArray[urlIndex][0] + ";program=" + urlArray[urlIndex][1] + ";agg=" + urlArray[urlIndex][2] + ";storyid=";
aloc = ";sz=300x250;tile=1;ord=" + pageNum;



//alert(urlArray[urlIndex][0]);
//alert(urlArray[urlIndex][1]);
//alert(urlArray[urlIndex][2]);
//alert(target);
//alert(random);


document.write('<div class="sponsor300">');
document.write('<');
document.write('script language=\"JavaScript\" src="' + dfpserver + '/adj/' + target + aloc + '">');
document.write('<');
document.write('/script>');
document.write('</div>');


