/*	
this code contains methods that allows the app to track events inside flash
*/
//
// vars
//
type="";
urlLoc="";
//
// public methods
//
// track trackTypeAndGo1 is called by the text "details"
function trackTypeAndGo1(whatType, whatUrlLoc) {
	//alert("trackTypeAndGo1(): " + whatType + ", whatUrlLoc: "+ whatUrlLoc);
	type = whatType;
	urlLoc = whatUrlLoc;
	reportTypeAndGo();
	clearTypeAndGo();
}
// track trackTypeAndGo2 is called by the picture
function trackTypeAndGo2(what) {
	//alert("trackTypeAndGo2(): " + what);
	var sps = what.split("^");
	type = sps[0]
	urlLoc = sps[1]
	reportTypeAndGo();
	clearTypeAndGo();
}
// track type is called by the "video trailler"
function trackType(what) {
	//alert("trackType(): " + what);
	type = what;
	reportType();
	clearType();
}
// report methods
function reportTypeAndGo() {
	send_to_omniture1(type, urlLoc);
}
function reportType() {
	send_to_omniture2(type);
}
//clear methods	
function clearTypeAndGo() {
	type = "";
	urlLoc="";
}
function clearType() {
	type = "";
}
// omniture methods
function send_to_omniture1(whatType, whatUrlLoc) {
	var sendThis = "HOD: Flash Module: "+whatType;
	//alert(sendThis);
	// redirect the browser here
	window.location.href = whatUrlLoc;
	var s=s_gi(s_account);
	//alert(s_account);
	s.linkTrackVars='prop1,prop9,server';
	s.linkTrackEvents='None';
	s.prop9=sendThis;
	s.server='hbo.com';
	s.prop1="HOD"
	s.t(this,'o',whatType);
}
function send_to_omniture2(myText) {
	var sendThis = "HOD: Flash Module: "+myText;
	//alert(sendThis);
	var s=s_gi(s_account);
	//alert(s_account);
	s.linkTrackVars='prop1,prop9,server';
	s.linkTrackEvents='None';
	s.prop9=sendThis;
	s.server='hbo.com';
	s.prop1="HOD"
	s.t(this,'o',myText);
}