// JavaScript Document eventually call createPgView()



//recordOutboundLink as an event
function recordOutboundLinkFromFlash(action) {
	try {
		var pageTracker=_gat._getTracker("UA-826627-1");
		//alert('recordOutboundLinkFromFlash '+action);
		pageTracker._trackEvent('Outbound Links', action);
		}
	catch(err){}
}

//flushToAnalytics
function flushToAnalytics(kidsOrTeens, id, loginType){
	var stringToPass;
	var addLoginType = true;
	//verify its a kids call
	if(kidsOrTeens == "K"){
		//case statement to get string value of id	
		switch(id){
			case 1:
			  stringToPass = "/index.htm";
			  addLoginType = false;
			  break;
			  
			  case 2:
			  stringToPass = "/kits/index.htm";
			  addLoginType = false;
			  break;
			  
			  case 3: case 74:
			  stringToPass = "/kits/nutrition.htm";
			  break;
			  
			  case 4:
			  stringToPass = "/kits/Nutrition/Activity4/Nutrition_WebQuest_WS.pdf";
			  break;
			  
			  case 5: case 75:
			  stringToPass = "/kits/senseable-me.htm";
			  break;
			  
			  case 6:
			  stringToPass = "/kits/SenseableMe/Activity5/SenseableMe_WebQuest_WS.pdf";
			  break;
			  
			  case 7: case 76:
			  stringToPass = "/kits/huffin-n-puffin.htm";
			  break;
			  
			  case 8:
			  stringToPass = "/kits/HuffinNPuffin/Activity4/HuffinNPuffin_WebQuest_WS.pdf";
			  break;
			  
			  case 9: case 77:
			  stringToPass = "/kits/transformation-information.htm";
			  break;
			  
			  case 10:
			  stringToPass = "/kits/TransformationInformation/Activity4/TransformationInformation_WebQuest_WS.pdf";
			  break;
			  
			  case 11: case 78:
			  stringToPass = "/kits/tooth-decay-no-way.htm";
			  break;
			  
			  case 12:
			  stringToPass = "/kits/ToothDecayNoWay/Activity3/ToothDecayNoWay_WebQuest_WS.pdf";
			  break;
			  
			  case 13: case 79:
			  stringToPass = "/kits/fueling-your-special-body.htm";
			  break;
			  
			  case 14:
			  stringToPass = "/kits/FuelinmyBody/Activity3/FuelinmyBody_WebQuest_WS.pdf";
			  break;
			  
			  case 15: case 80:
			  stringToPass = "/kits/seaing-me-for-me.htm";
			  break;
			  
			  case 16:
			  stringToPass = "/kits/K-3MentalHealth/Activity3/MentK-3_WebQuest_WS.pdf";
			  break;
			  
			  case 17: case 81:
			  stringToPass = "/kits/power-of-me.htm";
			  break;
			  
			  case 18:
			  stringToPass = "/kits/4-6MentalHealth/Activity3/Ment4-6_WebQuest_WS.pdf";
			  break;
			  
			  case 19:
			  stringToPass = "/health-tip.htm";
			  addLoginType = false;
			  break;
			  
			  case 20:
			  stringToPass = "/resources/index.htm";
			  addLoginType = false;
			  break;
			  
			  case 21:
			  stringToPass = "/tell-a-friend.htm";
			  break;
			  
			  case 22:
			  stringToPass = "/tell-a-friend-send.htm";
			  break;
			  
			  case 23:
			  stringToPass = "/register.htm";
			  addLoginType = false;
			  break;
			  
			  case 24:
			  stringToPass = "/register-thank-you.htm";
			  addLoginType = false;
			  break;
			  
			  case 25: case 73:
			  stringToPass = "/login.htm";
			  addLoginType = false;
			  break;
			  
			  case 26:
			  stringToPass = "/premium-login.htm";
			  addLoginType = false;
			  break;
			  
			  case 27:
			  stringToPass = "/survey.htm";
			  addLoginType = false;
			  break;
			  
			  case 28:
			  stringToPass = "/profile.htm";
			  break;
			  
			  case 29:
			  stringToPass = "/message-board/respond.htm";
			  addLoginType = false;
			  break;
			  
			  case 30:
			  stringToPass = "/message-board/details.htm";
			  addLoginType = false;
			  break;
			  
			  case 31:
			  stringToPass = "/help/index.htm";
			  addLoginType = false;
			  break;
			  
			  case 32:
			  stringToPass = "/locker.htm";
			  break;
			  
			  case 33:
			  stringToPass = "/contact/index.htm";
			  addLoginType = false;
			  break;
			  
			  case 34:
			  stringToPass = "/site-requirements.htm";
			  addLoginType = false;
			  break;
			  
			  case 35:
			  stringToPass = "/sitemap.htm";
			  addLoginType = false;
			  break;
			  
			  case 36:
			  stringToPass = "/forgot-password";
			  addLoginType = false;
			  break;
			  
			  case 37:
			  stringToPass = "/quick-poll-vote.htm";
			  addLoginType = false;
			  break;
			  
			  case 38:
			  //outbound link
			  recordOutboundLinkFromFlash('http://www.highmarkhealthyhigh5.org/index.shtml');
			  addLoginType = false;
			  stringToPass = "noValueFound"
			  break;
			  
			  case 39:
			  //outbound link
			  recordOutboundLinkFromFlash('http://www.byrneshec.com/');
			  addLoginType = false;
			  stringToPass = "noValueFound"
			  break;
			  
			  case 40:
			  stringToPass = "/health-log.htm";
			  break;
			  
			  case 41:
			  stringToPass = "/playground/index.htm";
			  break;
			  
			  case 42:
			  stringToPass = "/playground/coloring-pages/index.htm";
			  break;
			  
			  case 43:
			  stringToPass = "/playground/coloring-pages/tuffy-paste.htm";
			  break;
			  
			  case 44:
			  stringToPass = "/playground/coloring-pages/simons-lab.htm";
			  break;
			  
			  case 45:
			  stringToPass = "/playground/coloring-pages/chef-simon.htm";
			  break;
			  
			  case 46:
			  stringToPass = "/playground/coloring-pages/draw-coach.htm";
			  break;
			  
			  case 47:
			  stringToPass = "/playground/coloring-pages/draw-heart.htm";
			  break;
			  
			  case 48:
			  stringToPass = "/playground/ecards/index.htm";
			  break;
			  
			  case 49:
			  stringToPass = "/playground/ecards/heart/preview.htm";
			  break;
			  
			  case 50:
			  stringToPass = "/playground/ecards/heart/select.htm";
			  break;
			  
			  case 51:
			  stringToPass = "/playground/ecards/heart/sent.htm";
			  break;
			  
			  case 52:
			  stringToPass = "/playground/ecards/chef-simon/preview.htm";
			  break;
			  
			  case 53:
			  stringToPass = "/playground/ecards/chef-simon/select.htm";
			  break;
			  
			  case 54:
			  stringToPass = "/playground/ecards/chef-simon/sent.htm";
			  break;
			  
			  case 55:
			  stringToPass = "/playground/ecards/tuffy/preview.htm";
			  break;
			  
			  case 56:
			  stringToPass = "/playground/ecards/tuffy/select.htm";
			  break;
			  
			  case 57:
			  stringToPass = "/playground/ecards/tuffy/sent.htm";
			  break;
			  
			  case 58:
			  stringToPass = "/playground/ecards/senses/preview.htm";
			  break;
			  
			  case 59:
			  stringToPass = "/playground/ecards/senses/select.htm";
			  break;
			  
			  case 60:
			  stringToPass = "/playground/ecards/senses/sent.htm";
			  break;
			  
			  case 61:
			  stringToPass = "/playground/ecards/byrnes/preview.htm";
			  break;
			  
			  case 62:
			  stringToPass = "/playground/ecards/byrnes/select.htm";
			  break;
			  
			  case 63:
			  stringToPass = "/playground/ecards/byrnes/sent.htm";
			  break;
			  
			  case 64:
			  stringToPass = "/playground/ecards/received.aspx";
			  break;
			  
			  case 65:
			  stringToPass = "/healthResources/index.htm";
			  addLoginType = false;
			  break;
			 
			default:
				stringToPass = "noValueFound"
			  //code to be executed if n is different from case 1 and 2
		}
		
		if(stringToPass != "noValueFound"){
			//add in login type
			if(addLoginType){
				//convert 'none' to 'samples'
				if(loginType == 'none'){
					loginType = 'samples';	
				}
				stringToPass = "/"+loginType+stringToPass;	
			}
			
			//prepend with kids
			stringToPass = "/kids"+stringToPass;
			//alert("tracking string sent to google: " + stringToPass);
			createPgView(stringToPass);
		}
	}
}
