//javascript lookups for omniture
//get section string
var sURL = window.location.pathname;
var sAccount, sCategory, sSite, sSiteSections, sPageName, sContentType, sLeadType
var sSearchResults, sSearchRefinement, sSearchType, sSearchPhrase;

//divide up sections of SEO link
var aSections = sURL.split("/");

//set defaults
sAccount = "babyzone";
sCategory = "dfam";
sSite = "bbz";
sSiteSections = "";
sPageName = "";
sContentType = "";
sLeadType = "";
sSearchResults = "";
sSearchRefinement = "";
sSearchType = "";
sSearchPhrase = "";

//create reg exp object
var regEx = new RegExp();
regEx.ignoreCase = true;
regEx.global = true;

function limitSiteSection(sInput, iMax)
{
	var aInput = sInput.split(":");
	while(aInput.length > iMax){
		aInput.pop();
	}
	var sSections = aInput.toString();
	sSections = sSections.replace(/,/g,":");
	
	return sSections;
}

//process URL
for(var x = 0;x < aSections.length;x++){

	//look for content indicator
	//	articles
	if(aSections[x].toString().toLowerCase() == "article"){
		var sTitle = aSections[x + 1];
		regEx.compile(".*-pg[0-9]{1}$");
		
		if(regEx.test(sTitle)){
			var sText = sTitle.replace(/-pg[0-9]{1}$/, "");
			sSiteSections = limitSiteSection(sSiteSections,3);
			sSiteSections += ":" + sText;
			sPageName = sTitle.replace(sText, "");
			sPageName = sPageName.replace("-pg", "");
			sContentType = "multipage-article";
		}
		else{
			if(typeof(bMulti) != "undefined"){
				sSiteSections = limitSiteSection(sSiteSections,3);
				sSiteSections += ":" + sTitle;
				sPageName = "1";
				sContentType = "multipage-article";
			}
			else{
				sSiteSections = limitSiteSection(sSiteSections,4);
				sPageName = sTitle;
				sContentType = "single-article";
			}
		}
		
		break;
	}
	//	slideshows
	else if(aSections[x].toString().search("photos_") == 0){
		sSiteSections = limitSiteSection(sSiteSections,3);
		sSiteSections += ":" + aSections[x].toString().replace("photos_", "");
		if(typeof(aSections[x + 1]) == "undefined"){
			sPageName = "1";
		}
		else{
			sPageName = aSections[x + 1];
		}
		sContentType = "slideshow";
		
		break;
	}
	// topic index
	else if(aSections[x].toString().search("-index") != -1){
		sSiteSections = limitSiteSection(sSiteSections,3);
		sSiteSections += ":" + aSections[x].toString().replace("-index", "");
		if(sSiteSections.indexOf(":") == 0){
			sSiteSections = sSiteSections.replace(/:/,"");
		}
		sPageName = "all-index";
		sContentType = "all-index";
		
		break;
	}
	// polls
	else if(aSections[x].toString().toLowerCase() == "poll"){
		sContentType = "poll";
		sSiteSections = limitSiteSection(sSiteSections,2);
		sSiteSections = "polls:" + sSiteSections + ":" + aSections[x + 1];
		if(aSections[x + 1].toString().search("-result") != -1){
			sPageName = "poll-result";
		}
		else{
			sPageName = "poll-vote";
		}
		
		break;
	}
	// quizzes
	else if(aSections[x].toString().toLowerCase() == "quiz"){
		sContentType = "quiz";
		sSiteSections = limitSiteSection(sSiteSections,2);
		sSiteSections = sSiteSections + ":" + aSections[x + 1];

		//set page title as page number
		regEx.compile("currentpage=[0-9]{1,2}");
		if(regEx.test(document.URL.toString().toLowerCase())){
			//get current page number
			regEx.exec(document.URL.toString().toLowerCase());
			regEx.compile("[0-9]{1,2}$");
			regEx.exec(RegExp.lastMatch);
			var pageNum = RegExp.lastMatch;
			//get the total questions
			regEx.compile("questioncount=[0-9]{1,2}");
			regEx.exec(document.URL.toString().toLowerCase());
			regEx.compile("[0-9]{1,2}$");
			regEx.exec(RegExp.lastMatch);
			var pageTotal = RegExp.lastMatch;	
			if(parseInt(pageNum) > parseInt(pageTotal)){
				sPageName = "result-page";
			}
			else{ 
				sPageName = pageNum;
			}
		}
		else{
			sPageName = 1;
		}
		
		break;
	}
	else if(aSections[x].toString().toLowerCase() == "quizzes"){
		sContentType = "quiz";
		sSiteSections = "quizzes:boy or girl";
		sPageName = "register";
	}
	// ask an expert
	else if(aSections[x].toString().toLowerCase() == "askanexpert"){
		sSiteSections = "ask-expert";
		sContentType = "ask-expert";
		if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "default.asp") || (aSections[x + 1].toString().toLowerCase() == "")){
			sPageName = "home";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "expertquestions.asp"){
			sSiteSections += ":" + sExpertName;
			regEx.compile("pg=[0-9]{1,2}");
			if(regEx.test(document.URL.toString().toLowerCase())){
				//get current page number
				regEx.exec(document.URL.toString().toLowerCase());
				regEx.compile("[0-9]{1,2}$");
				regEx.exec(RegExp.lastMatch);
				sPageName = RegExp.lastMatch;
			}
			else{
				sPageName = 1;
			}
		}
		else if(aSections[x + 1].toString().toLowerCase() == "askquestion.asp"){
			sPageName = "ask-question";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "submitthanks.asp"){
			sPageName = "ask-question-thanks";
		}
		else if(aSections[x + 1].toString().toLowerCase().search("search.asp") > -1){
			sContentType = "search-result";
			regEx.compile("searchword=([^&]*)");
			if(regEx.test(document.URL.toString().toLowerCase())){
				//get current page number
				regEx.exec(document.URL.toString().toLowerCase());
				sSearchPhrase = RegExp.lastMatch.replace("searchword=","");
				sSearchPhrase = sSearchPhrase.replace("&","");
				sSearchPhrase = sSearchPhrase.replace(/\+/g," ");
			}
			else{
				sPageName = "blank";
				sSearchResults = 0;
			}
			if(typeof(iPassedTotalRecords) != "undefined"){
				if(parseInt(iPassedTotalRecords) > 0){
					sPageName = "success";
					sSearchResults = iPassedTotalRecords;
				}
				else if(parseInt(iPassedTotalRecords) == 0){
					sPageName = "failed";
					sSearchResults = 0;
				}
				else{
					sPageName = "blank";
					sSearchResults = 0;
				}
			}
		}
		else{
			sPageName = aSections[x + 1];
		}
		
		break;
	}
	// mom to mom stories
	else if(aSections[x].toString().toLowerCase() == "momtomom"){
		sSiteSections = "mom-to-mom";
		sContentType = "mom-to-mom";
		if(aSections[x + 1].toString().toLowerCase() == "stories.asp"){
			if(iMulti > 1){
				sPageName = iPageNum;
				sContentType = "multipage-stories";
				sSiteSections += ":" + sMomTitle;
			}
			else{
				sPageName = sMomTitle;
				sContentType = "single-stories";
			}
		}
		else if(aSections[x + 1].toString().toLowerCase() == "submitstory.asp"){
			sPageName = "submit-story";
			sSiteSections += ":" + sMomTitle;
		}
		else if(aSections[x + 1].toString().toLowerCase() == "submitthanks.asp"){
			sPageName = "submit-story-thanks";
			sSiteSections += ":" + sMomTitle;
		}
		else if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "default.asp") || (aSections[x + 1].toString().toLowerCase() == "")){
			sPageName = "home";
		}
		
		break;
	}
	// community chat
	else if(aSections[x].toString().toLowerCase() == "community"){
		sSiteSections = "community:chat";
		sContentType = "chat";
		if(aSections[x + 1] == "chat.asp"){
			sPageName = "home";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "chatlogin.asp"){
			if(typeof(bLite) != "undefined"){
				sPageName = "chat-applet-lite";
			}
			else{
				sPageName = "chat-applet-regular";
			}
		}

		break;
	}
	// video section
	else if(aSections[x].toString().toLowerCase() == "videos"){
		sSiteSections = "video";
		sPageName = "home";
		sContentType = "videos";
		
		break;
	}
	// about us section
	else if(aSections[x].toString().toLowerCase() == "aboutus"){
		sSiteSections = "";
		if(aSections[x + 1].toString().toLowerCase() == "faq.asp"){
			sPageName = "faq";
			sContentType = "faq";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "contact_us.asp"){
			sPageName = "contact-us";
			sContentType = "contact-us";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "disclaimer.asp"){
			sPageName = "disclaimer";
			sContentType = "disclaimer";
		}
		
		break;
	}
	// user section : login, register, edit profile
	else if(aSections[x].toString().toLowerCase() == "user"){
		sSiteSections = "accounts";
		if(aSections[x + 1].toString().toLowerCase() == "login.asp"){
			sPageName = "login";
			sContentType = "login";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "profile.asp"){
			sPageName = "edit-profile";
			sContentType = "edit-profile";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "regstart.asp"){
			sPageName = "regstart";
			sContentType = "regstart";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "register.asp"){
			sPageName = "join";
			sContentType = "join";
		}
		
		break;
	}
	// interstitial page
	else if(aSections[x].toString().toLowerCase() == "intern.asp"){
		sSiteSections = "";
		sPageName = "interstitial";
		sContentType = "interstitial-ad";
		
		break;
	}
	// calendar
	else if(aSections[x].toString().toLowerCase() == "calendar"){
		sSiteSections = "calendar";
		sContentType = "calendar";
		if(x == 2){
			sSiteSections = aSections[x - 1] + ":calendar"
			sPageName = "join"
			sContentType = "accounts";
		}
		else if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "default.asp") || (aSections[x + 1].toString().toLowerCase() == "")){
			sPageName = "home";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "day.asp"){
			sPageName = "day";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "addedit.asp"){
			sPageName = "add-event";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "printable.asp"){
			sPageName = "printable";
		}
		
		break;
	}
	// checklists, milestone trackers
	else if((aSections[x].toString().toLowerCase() == "checklist") || (aSections[x].toString().toLowerCase() == "growth-milestones")){
		sSiteSections += ":checklist";
		sContentType = "checklist";
		if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "")){
			sPageName = "current";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "default.asp"){
			regEx.compile("clt=[0-9]{1}");
			if(regEx.test(document.URL.toString().toLowerCase())){
				//get current page number
				regEx.exec(document.URL.toString().toLowerCase());
				regEx.compile("[0-9]{1}$");
				regEx.exec(RegExp.lastMatch);
				sPageName = RegExp.lastMatch;
				if(sPageName == 1){
					sPageName = "current";
				}
				else if(sPageName == 2){
					sPageName = "completed";
				}
				else{
					sPageName = "remaining";
				}
			}
			else{
				sPageName = "current";
			}
		}
		
		if(document.URL.toString().toLowerCase().search("update") != -1){
			sPageName += "-update";
		}
		
		break;
	}
	// gender predictor
	else if(aSections[x].toString().toLowerCase() == "genderpredictor"){
		sSiteSections = "pregnancy:gender-predictor";
		sContentType = "gender-predictor";
		if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "")){
			sPageName = "home";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "register.asp"){
			sPageName = "join-for-result";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "result.asp"){
			sPageName = "result-just-joined";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "default.asp"){
			if(document.URL.toString().toLowerCase().search("dob") != -1){
				sPageName = "result-logged-in";
			}
			else{
				sPageName = "home";
			}
		}
		
		break;
	}
	// pregnancy calculator
	else if(aSections[x].toString().toLowerCase() == "pregnancycalculator.asp"){
		sSiteSections = "pregnancy";
		sContentType = "calculator";
		if(document.URL.toString().toLowerCase().search("lmpdate") != -1){
			sPageName = "pregnancy-calculator-home";
		}
		else{
			sPageName = "pregnancy-calculator";
		}
		
		break;
	}
	// baby names
	else if(aSections[x].toString().toLowerCase() == "babynames"){
		if(parseInt(x) == 1){
			sSiteSections = "babynames";
			sContentType = "babynames";
			if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "")){
				sPageName = "home";
			}
			else if((aSections[x + 1].toString().toLowerCase() == "boy") || (aSections[x + 1].toString().toLowerCase() == "girl")){
				sSiteSections += ":" + aSections[x + 1];
				sPageName =  aSections[x + 2];
				if(typeof(bVoted) != "undefined"){
					sSiteSections += ":voted";
				}
			}
			else if(aSections[x + 1].toString().length == 1){
				sSiteSections += ":" + aSections[x + 1];
				if((typeof(aSections[x + 2]) == "undefined") || (aSections[x + 2].toString().toLowerCase() == "")){
					sPageName = 1;
				}
				else{
					regEx.compile("page-[0-9]{1,2}");
					if(regEx.test(document.URL.toString().toLowerCase())){
						//get current page number
						regEx.exec(document.URL.toString().toLowerCase());
						regEx.compile("[0-9]{1,2}$");
						regEx.exec(RegExp.lastMatch);
						sPageName = RegExp.lastMatch;
					}
					else{
						sPageName = 1;
					}
				}
			}
			else if(aSections[x + 1].toString().toLowerCase() == "baby-name-advisor.asp"){
				if(document.URL.toString().toLowerCase().search("babyname=") != -1){
					sPageName = "baby-name-advisor-result";
				}
				else{
					sPageName = "baby-name-advisor";
				}
			}
			else if(aSections[x + 1].toString().toLowerCase() == "nameresults.asp"){
				sPageName = "empty-search-result";
			}
			else if(aSections[x + 1].toString().toLowerCase() == "mybabynames.asp"){
				if(document.URL.toString().toLowerCase().search("action=add") != -1){
					sPageName = "my-basket-add";
				}
				else{
					sPageName = "my-basket";
				}
			}
			else if(aSections[x + 1].toString().toLowerCase() == "createpoll.asp"){
				sPageName = "create-poll";
			}
			else if(aSections[x + 1].toString().toLowerCase() == "createpollthanks.asp"){
				sPageName = "create-poll-thanks";
			}
			else if(aSections[x + 1].toString().toLowerCase() == "nameinventor.asp"){
				sPageName = "name-inventor";
			}
			else if(aSections[x + 1].toString().toLowerCase() == "bnpoll.asp"){
				sPageName = "polls";
			}
			else if(aSections[x + 1].toString().toLowerCase() == "bnpolladmin.asp"){
				sPageName = "polls-admin";
			}
			else if(aSections[x + 1].toString().toLowerCase() == "celebritynames.asp"){
				sPageName = "celebrity-names";
			}
			else{
				sSiteSections += ":" + aSections[x + 1];
				regEx.compile("page-[0-9]{1,2}");
				if(regEx.test(document.URL.toString().toLowerCase())){
					//get current page number
					regEx.exec(document.URL.toString().toLowerCase());
					regEx.compile("[0-9]{1,2}$");
					regEx.exec(RegExp.lastMatch);
					sPageName = RegExp.lastMatch;
				}
				else{
					sPageName = 1;
				}
			}

			break;
		}
	}
	// baby horoscopes
	else if(aSections[x].toString().toLowerCase() == "best-astro-baby-finder.asp"){
		sSiteSections = "preconception:baby-horoscope";
		sContentType = "baby-horoscope";
		if(document.URL.toString().toLowerCase().search("sign1=") != -1){
			sPageName = "result";
		}
		else{
			sPageName = "home";
		}
				
		break;
	}
	// baby pages - pregnancy journals
	else if(aSections[x].toString().toLowerCase() == "babypages"){
		//determine book type
		var iBookType = 0;
		regEx.compile("booktypeid=[0-9]{1}");
		if(regEx.test(document.URL.toString().toLowerCase())){
			//get current page number
			regEx.exec(document.URL.toString().toLowerCase());
			regEx.compile("[0-9]{1}$");
			regEx.exec(RegExp.lastMatch);
			iBookType = RegExp.lastMatch;
		}
		if(iBookType > 0){
			if(iBookType == 2){
				sSiteSections = "pregnancy-journal";
				sContentType = "pregnancy-journal";
			}
			else if(iBookType == 1){
				sSiteSections = "babypages";
				sContentType = "babypages";
			}
		}
		else if((typeof(iPassedBookType) != "undefined") && (iPassedBookType > 0)){
			if(iPassedBookType == 2){
				sSiteSections = "pregnancy-journal";
				sContentType = "pregnancy-journal";
			}
			else if(iPassedBookType == 1){
				sSiteSections = "babypages";
				sContentType = "babypages";
			}
		}
		// end determine book type

		if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "") || (aSections[x + 1].toString().toLowerCase() == "default.asp")){
			sSiteSections = "babypages";
			sContentType = "babypages";
			sPageName = "home";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "journal.asp"){
			sSiteSections = "pregnancy-journal";
			sContentType = "pregnancy-journal";
			sPageName = "home";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "search.asp"){
			sPageName = "";
			sContentType = "search-result";
			regEx.compile("letter=[a-z]{1}");
			if(regEx.test(document.URL.toString().toLowerCase())){
				sContentType = "search-by-letter-result";
				//get search letter
				regEx.exec(document.URL.toString().toLowerCase());
				regEx.compile("[a-z]{1}$");
				regEx.exec(RegExp.lastMatch);
				sPageName = RegExp.lastMatch.toUpperCase();
			}
			regEx.compile("pg=[0-9]{1,2}");
			if(regEx.test(document.URL.toString().toLowerCase())){
				//get current page number
				regEx.exec(document.URL.toString().toLowerCase());
				regEx.compile("[0-9]{1,2}$");
				regEx.exec(RegExp.lastMatch);
				sPageName += "-" + RegExp.lastMatch;
			}
			else{
				sPageName += "-" + "1";
			}
		}
		else if(aSections[x + 1].toString().toLowerCase() == "create.asp"){
			sPageName = "create-new";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "mypages.asp"){
			sPageName = "view-all-saved";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "customize.asp"){
			sPageName = "customize";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "page.asp"){
			sPageName = "view-one";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "contents.asp"){
			sPageName = "view-one-contents";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "guestbook.asp"){
			sPageName = "guestbook";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "addcomment.asp"){
			sPageName = "guestbook-addcomment";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "entryadd.asp"){
			sPageName = "add-entry";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "entryaddedit.asp"){
			sPageName = "edit-entry";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "contacts.asp"){
			sPageName = "family-friends";
		}
		
		break;
	}
	// photo contest
	else if(aSections[x].toString().toLowerCase() == "photocontest"){
		sSiteSections = "photo-contest";
		sContentType = "photo-contest";
		if((typeof(aSections[x + 1]) == "undefined") || (aSections[x + 1].toString().toLowerCase() == "") || (aSections[x + 1].toString().toLowerCase() == "default.asp")){
			sPageName = "home";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "photos_vote.asp"){
			sPageName = "vote";
			regEx.compile("type=(baby|toddler|preschool|child)");
			if(regEx.test(document.URL.toString().toLowerCase())){
				//get current page number
				regEx.exec(document.URL.toString().toLowerCase());
				regEx.compile("(baby|toddler|preschool|child)$");
				regEx.exec(RegExp.lastMatch);
				sSiteSections += ":" + RegExp.lastMatch;
			}
		}
		else if(aSections[x + 1].toString().toLowerCase() == "photos_submit.asp"){
			sPageName = "photo-submit";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "previouswinners.asp"){
			sPageName = "previouswinners";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "photos_faq.asp"){
			sPageName = "faq";
		}
		else if(aSections[x + 1].toString().toLowerCase() == "rules.asp"){
			sPageName = "rules";
		}
		
		break;
	}
	// gearing up for baby
	else if(aSections[x].toString().toLowerCase() == "gearing_up_for_baby"){
		sSiteSections += ":" + aSections[x];
		sContentType = "gearing_up_for_baby";
		regEx.compile("room=(essentials|bathroom|kitchen|nursery|getting_around)");
		if(regEx.test(document.URL.toString().toLowerCase())){
			//get current page number
			regEx.exec(document.URL.toString().toLowerCase());
			regEx.compile("(essentials|bathroom|kitchen|nursery|getting_around)");
			regEx.exec(RegExp.lastMatch);
			sPageName = RegExp.lastMatch;
		}
		else{
			sPageName = "intro";
		}
		
		break;
	}
	else if(aSections[x].toString().toLowerCase() == "baby_toddler_preschooler_health"){
		aSections[x] = "health_and_wellness";
	}
	else if(aSections[x].toString().toLowerCase() == "rightrail"){
		sSiteSections = "Right Rail";
		sContentType = "accounts";
		sPageName = aSections[x + 1].toString().replace(".asp","");
		
		break;
	}
	else if(aSections[x].toString().toLowerCase() == "search"){
		sSiteSections = "";
		sContentType = "search";
		sSearchType = "bbz_reg";
		//determine search phrase
		regEx.compile("q=([^&]*)&");
		if(regEx.test(document.URL.toString().toLowerCase())){
			//get current page number
			regEx.exec(document.URL.toString().toLowerCase());
			sSearchPhrase = RegExp.lastMatch.replace("q=","");
			sSearchPhrase = sSearchPhrase.replace("&","");
			sSearchPhrase = sSearchPhrase.replace(/\+/g," ");
		}
		else{
			sPageName = "blank";
			sSearchResults = 0;
		}
		if(typeof(omni_total_results) != "undefined"){
			if(parseInt(omni_total_results) > 0){
				sPageName = "success";
				sSearchResults = omni_total_results;
			}
			else if(parseInt(omni_total_results) == 0){
				sPageName = "failed";
				sSearchResults = 0;
			}
			else{
				sPageName = "blank";
				sSearchResults = 0;
			}
		}
		
		break;
	}
	else if(aSections[x].toString().toLowerCase() == "nl"){
		sSiteSections = "newsletter";
		sContentType = "accounts";
		sPageName = "manage";
		
		break;
	}
	else if(aSections[x].toString().toLowerCase() == "babynursery"){
		sSiteSections = aSections[x].toString().toLowerCase();
		sPageName = aSections[x + 1].toString().replace(".asp","");
		
		break;
	}
	else if(aSections[x].toString().toLowerCase() == "loadpage"){
		if(aSections[x + 1].toString().toLowerCase().search("authorcontent.asp") > -1){
			sSiteSections = "author-content";
			if(typeof(sPassedAuthorName) != "undefined"){
				sSiteSections += ":" + sPassedAuthorName;
			}
			sContentType = "author-content";
			regEx.compile("pg=[0-9]{1,2}");
			if(regEx.test(document.URL.toString().toLowerCase())){
				//get current page number
				regEx.exec(document.URL.toString().toLowerCase());
				regEx.compile("[0-9]{1,2}$");
				regEx.exec(RegExp.lastMatch);
				sPageName = RegExp.lastMatch;
			}
			else{
				sPageName = 1;
			}
		}
		
		break;
	}

	//general statement to build site sections string
	if((aSections[x].toString().toLowerCase() != "default.asp") && (aSections[x].toString().toLowerCase() != "")){
		if(sSiteSections != ""){
			sSiteSections += ":";
		}
		sSiteSections += aSections[x];
	}
}

//home page and topic pages
if((sSiteSections.length == 0) && (sPageName.length == 0)){
	sPageName = "home";
	sContentType = "homepage";
}
else if(sSiteSections.search(":") == -1){
	if(sPageName.length == 0){
		sPageName = "home";
		sContentType = "category-home";
	}
}
else{
	if(sPageName.length == 0){
	  //fetal development gallery?
	  if(limitSiteSection(sSiteSections,4) == "pregnancy:fetal_development:week") {
	    var weekNum = 2;
	    sContentType = "slideshow";
	    sSiteSections = "pregnancy:fetal_development:gallery";
	    // determine which week
	    regEx.compile("week=[0-9]{1,2}");
	    if(regEx.test(document.URL.toString().toLowerCase())){
			//get current week number
			regEx.exec(document.URL.toString().toLowerCase());
			regEx.compile("[0-9]{1,2}$");
			regEx.exec(RegExp.lastMatch);
			weekNum = RegExp.lastMatch;
		}
		sPageName = weekNum - 1; //Since we start with week 2, week # is 1 more than page number
	  }
  	else {
			sPageName = "home";
			sSiteSections = limitSiteSection(sSiteSections,4); 
			sContentType = "sub-category-home";
		 }
	}
}
