var pageSettings = [	{	pageId	:	"bluenotes",
							atlas	:	"AE.MUSIC",
							prop2	:	"BlueNotes",
							prop3	:	"Blog",							
							hier	:	"Arts & Entertainment, Music, BlueNotes"	},							
						{	pageId	:	"cybertainment",
							atlas	:	"AE.OTHER",
							prop2	:	"Cybertainment blog",
							prop3	:	"Blog",							
							hier	:	"Arts & Entertainment, Cybertainment blog"	},							
						{	pageId	:	"classical",
							atlas	:	"AE.MUSIC",
							prop2	:	"Classical Musings",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Music, Classical Musings"	},
						{	pageId	:	"tunedin",
							atlas	:	"AE.TVRADIO",
							prop2	:	"Tuned In Journal",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, TV, Tuned In"	},
						{	pageId	:	"fantasy",
							atlas	:	"SPORTS.GAMES.FANTASYFACTOR",
							prop2	:	"The Fantasy Factor",
							prop3	:	"Blog",
							hier	:	"Sports, Fantasy Sports, Fantasy Factor Blog"	},
						{	pageId	:	"emptynetters",
							atlas	:	"SPORTS.PRO.PENGUINS",
							prop2	:	"Empty Netters",
							prop3	:	"Blog",
							hier	:	"Sports, Penguins, Empty Netters"	},
						{	pageId	:	"blogngold",
							atlas	:	"SPORTS.PRO.STEELERS",
							prop2	:	"Blog 'n' Gold",
							prop3	:	"Blog",
							hier	:	"Sports, Steelers, Blog 'n' Gold"	},
						{	pageId	:	"pbc",
							atlas	:	"SPORTS.PRO.PIRATES",
							prop2	:	"PBC Blog",
							prop3	:	"Blog",
							hier	:	"Sports, Pirates, PBC Blog"	},
						{	pageId	:	"casinojournal",
							atlas	:	"NEWS.CASINOS",
							prop2	:	"Casino Journal",
							prop3	:	"Blog",
							hier	:	"Local News, Casino News, Casino Journal"	},							
						{	pageId	:	"citywalkabout",
							atlas	:	"CS.OTHER",
							prop2	:	"City Walkabout",
							prop3	:	"Blog",
							hier	:	"Local News, Neighborhoods, City, City WalkAbout"	},
						{	pageId	:	"bigstory",
							atlas	:	"CS.OTHER",
							prop2	:	"The Big Story",
							prop3	:	"Blog",
							hier	:	"Local News, The Big Story blog"	},
						{	pageId	:	"comiccon08",
							atlas	:	"AE.MOVIES",
							prop2	:	"Comic Con '08",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Movies/Videos, Comic Con '08"	},
						{	pageId	:	"myhomewood",
							atlas	:	"NEWS.OTHER",
							prop2	:	"My Homewood",
							prop3	:	"Blog",
							hier	:	"Local News, Neighborhoods, My Homewood"	},
						{	pageId	:	"onstage",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"On Stage",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Theater, OnStage"	},
						{	pageId	:	"openletters",
							atlas	:	"CS.OTHER",
							prop2	:	"Open Letters",
							prop3	:	"Blog",
							hier	:	"Opinion, Open Letters"	},
						{	pageId	:	"parentexchange",
							atlas	:	"LIVING.PARENTEXCHANGE",
							prop2	:	"Parent Exchange",
							prop3	:	"Blog",
							hier	:	"Lifestyle, Parent Exchange, blog"	},	
						{	pageId	:	"firstbites",
							atlas	:	"LIVING.FOOD.FIRSTBITES",
							prop2	:	"First Bites",
							prop3	:	"Blog",
							hier	:	"Lifestyle, Food, blog"	},					
						{	pageId	:	"radicalmiddle",
							atlas	:	"OPINION.OTHER",
							prop2	:	"Radical Middle",
							prop3	:	"Blog",
							hier	:	"Opinion, Radical Middle blog"	},
						{	pageId	:	"regonwry",
							atlas	:	"OPINION.OTHER",
							prop2	:	"Reg on Wry",
							prop3	:	"Blog",
							hier	:	"Opinion, Reg on Wry blog"	},
						{	pageId	:	"finepoint",
							atlas	:	"OPINION.STORIES",
							prop2	:	"A Fine Point",
							prop3	:	"Blog",
							hier	:	"Opinion, A Fine Point blog" },
						{	pageId	:	"varsityblog",
							atlas	:	"SPORTS.HIGHSCHOOL",
							prop2	:	"Varsity Blog",
							prop3	:	"Blog",
							hier	:	"Sports, High School Sports, Varsity Blogs"	},
						{	pageId	:	"bobsmizik",
							atlas	:	"CS.OTHER",
							prop2	:	"Bob Smizik's Blog",
							prop3	:	"Blog",
							hier	:	"Sports, Columnists, Bob Smizik"	},
						{	pageId	:	"techman",
							atlas	:	"BUSINESS.TECHMAN",
							prop2	:	"TechMan",
							prop3	:	"Blog",
							hier	:	"Business, Techman blog"	},
						{	pageId	:	"olympics",
							atlas	:	"SPORTS.OLYMPICS",
							prop2	:	"Summer Olympics",
							prop3	:	"Blog",
							hier	:	"Sports, Olympics, Summer Olympics"	},
						{	pageId	:	"finishline",
							atlas	:	"SPORTS.OTHER",
							prop2	:	"The Finish Line",
							prop3	:	"Blog",
							hier	:	"Sports, More Sports, The Finish Line Blog"	},
						{	pageId	:	"collegesports",
							atlas	:	"SPORTS.MORECOLLEGES.MOREDISTRICTCOLLEGES",
							prop2	:	"Red Shirt Diaries",
							prop3	:	"Blog",
							hier	:	"Sports, Other Colleges, Redshirt Diaries"	},
						{	pageId	:	"sketchblog",
							atlas	:	"NEWS.POLITICS",
							prop2	:	"Rob Rogers' Convention Sketch Blog",
							prop3	:	"Blog",
							hier	:	"Local News, Politics, Rob Rogers' Convention Sketch Blog"	},
						{	pageId	:	"robrogers",
							atlas	:	"CS.OTHER",
							prop2	:	"Rob Rogers' Sketch Blog",
							prop3	:	"Blog",
							hier	:	"Opinion, Rob Rogers, Rob Rogers Sketch Blog"	},
						{	pageId	:	"unconventional",
							atlas	:	"NEWS.POLITICS",
							prop2	:	"Unconventional",
							prop3	:	"Blog",
							hier	:	"Local News, Politics, Unconventional"	},
						{	pageId	:	"earlyreturns",
							atlas	:	"NEWS.POLITICS",
							prop2	:	"Early Returns",
							prop3	:	"Blog",
							hier	:	"Local News, Politics, Early Returns"	},
						{	pageId	:	"popi",
							atlas	:	"AE.CELEBRITIES",
							prop2	:	"POPi",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, People, POPi"	},
						{	pageId	:	"popnoise",
							atlas	:	"AE.MUSIC",
							prop2	:	"Pop Noise",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Music, Pop Noise"	},
						{	pageId	:	"torontofilm",
							atlas	:	"AE.MOVIES",
							prop2	:	"Toronto Film Festival",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Movies/Videos, Toronto Film Festival"	},
						{	pageId	:	"quickreads",
							atlas	:	"AE.BOOKS",
							prop2	:	"Quick Reads",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Books, Quick Reads blog"		},
						{	pageId	:	"madaboutmovies",
							atlas	:	"AE.MOVIES",
							prop2	:	"Mad About The Movies",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Movies/Videos, Mad About The Movies blog"		},														
						{	pageId	:	"cmunyc",
							atlas	:	"CS.OTHER",
							prop2	:	"CMU@NYC",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Art & Architecture, CMU@NYU"		},							
						{	pageId	:	"countdahn",
							atlas	:	"CS.OTHER",
							prop2	:	"Countdahn To Kickoff",
							prop3	:	"Blog",
							hier	:	"Sports, Steelers, Count dahn to Kickoff"	},									
						{	pageId	:	"mountaineers",
							atlas	:	"SPORTS.WVU",
							prop2	:	"'Eers to the Ground",
							prop3	:	"Blog",
							hier	:	"Sports, WVU"	},		
						{	pageId	:	"eyesonfire",
							atlas	:	"CS.OTHER",
							prop2	:	"Eyes On Fire",
							prop3	:	"Blog",
							hier	:	"Multimedia, Photo Journal, Eyes on Fire blog"		},	
						{	pageId	:	"pgtheaternow",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"pgTHEATERNOW",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Theater Now blog"		},	
						{	pageId	:	"audiencefeedback",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"Audience Feedback",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Audience Feedback blog"		},	
						{	pageId	:	"showblog",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"Pittsburgh Cultural Trust Blog",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Pittsburgh Cultural Trust Blog"		},
						{	pageId	:	"citytheatre",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"City Theatre Blog",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, City Theatre Blog"		},
						{	pageId	:	"pghclo",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"Pittsburgh Civic Light Opera Blog",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Pittsburgh Civic Light Opera Blog"		},							
						{	pageId	:	"ppt",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"Pittsburgh Public Theater Blog",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Pittsburgh Public Theater Blog"		},	
						{	pageId	:	"pict",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"Pittsburgh Irish & Classical Theatre Blog",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Pittsburgh Irish & Classical Theatre Blog"		},							
						{	pageId	:	"pict",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"Pittsburgh Irish & Classical Theatre Blog",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Pittsburgh Irish & Classical Theatre Blog"		},
						{	pageId	:	"backstage",
							atlas	:	"AE.THEATERDANCE",
							prop2	:	"Backstage Update Blog",
							prop3	:	"Blog",
							hier	:	"Arts & Entertainment, Backstage Update Blog"		},
						{	pageId	:	"daveskidney",
							atlas	:	"HEALTH.OTHER",
							prop2	:	"Dave's Kidney Blog",
							prop3	:	"Blog",
							hier	:	"Health, Dave's Kidney Blog"		}							
					];

							
function isCSPage(lookFor) {
	// Looks at the page title or URL to determine if this is the page we're looking for.
	var thisPageTitle = document.title.toLowerCase();
	var thisPageLoc = document.URL.toLowerCase();
	
	if(thisPageTitle.indexOf(lookFor) >= 0 || thisPageLoc.indexOf(lookFor) >= 0) 
		return true;
	else
		return false;
}
					
function injectBanner() {
	// Used to change the forum title for the Steeler Smackdown thing.
	var endDate = new Date(2009, 0, 1);
	var now = new Date();
	var titleDiv = $("CommonTitle");
	
	if(now < endDate) {	
		var url = document.URL.toLowerCase();
		
		if(isCSPage("/forums/t/75.aspx") || isCSPage("/forums/t/1565.aspx") ||
			isCSPage("/forums/t/1696.aspx") || isCSPage("/forums/t/1845.aspx") ||
			isCSPage("/forums/t/2402.aspx") || isCSPage("/forums/t/2632.aspx") || 
			isCSPage("/forums/t/2793.aspx") || isCSPage("/forums/t/3437.aspx") || isCSPage("/forums/t/4724.aspx") || 
			isCSPage("/forums/t/4143.aspx") || isCSPage("/forums/t/4538.aspx")) {		
				
			var newA = document.createElement("a");
			newA.setAttribute("href", "http://www.cardellolighting.com/");
			var newImg = document.createElement("img");
			newImg.src = "http://www.post-gazette.com/advertisers/670x90SteelerSmackdown.jpg";
			newImg.setAttribute("border", "0");
			newA.appendChild(newImg);
			
			while(titleDiv.childNodes[0]) {
				titleDiv.removeChild(titleDiv.childNodes[0]);
			}
			
			titleDiv.appendChild(newA);
		}	
		
		if(isCSPage("/forums/t/3475.aspx") || isCSPage("/forums/142.aspx")) {
			var newImg = document.createElement("img");
			newImg.src = "http://www.post-gazette.com/advertisers/670x90railroadmemories.jpg";
			newImg.setAttribute("border", "0");
			
			while(titleDiv.childNodes[0]) {
				titleDiv.removeChild(titleDiv.childNodes[0]);
			}
			
			titleDiv.appendChild(newImg);			
		}
	}
}

function touchUp() {
	// JLF 20090701 - Custom code to mess with Dejan's PBC blog.  Only runs while baseball season is on.
	/*
	if(window.location.href == "http://community.post-gazette.com/blogs/pbc/default.aspx" || window.location.href == "http://community.post-gazette.com/blogs/pbc/") {
		var frame = document.createElement("iframe");
		frame.setAttribute("src", "http://post-gazette.sportsdirectinc.com/sports-scores/TeamMatchup.aspx?TeamAbbr=PIT&League=MLB");
		frame.style.width = "495px";
		frame.style.height = "150px";
		frame.frameBorder = "none";
		frame.setAttribute("scrolling", "no");
		frame.setAttribute("frameborder", "no");
		$("CommonTitle").appendChild(frame);
		
	}
	*/
}

/*
	Work begins here; no changes should be needed below this line.
*/

// Defaults that will be set if we can't find a match in the object above.
var atlasPageName = "CS.OTHER";
s.prop2 = "(unknown Community page)";
s.prop4 = "CommunityServer";
s.hier1 = "Community, Other";
s.pageName = document.title;

var foundIt = false;
var i = 0;

while(foundIt == false && i < pageSettings.length) {
	if(isCSPage(pageSettings[i].pageId)) {
		atlasPageName = pageSettings[i].atlas;
		
		if(document.title == "post-gazette.com")
			s.pageName = pageSettings[i].prop2;
			
		s.prop2 = pageSettings[i].prop2;
		s.prop3 = pageSettings[i].prop3;
		s.hier1 = pageSettings[i].hier;
		foundIt = true;
	}
	
	i++;
}

var s_code = s.t();
if(s_code) {
	document.write(s_code);
}

// Run the actions in the touchUp routine.
Event.observe(window, 'load', touchUp);
