/* this code contains methods that allows the app to track events inside flash */
//
// vars
//
type="";
urlLoc="";

// trackTypeAndGo1 is called by the text link "more"
// it tracks the event and redirects the browser to a new location within the site
function trackTypeAndGo1(whatType, whatUrlLoc) {
	//alert("trackTypeAndGo1(): " + whatType + ", whatUrlLoc: "+ whatUrlLoc);
	type = whatType;
	urlLoc = whatUrlLoc;
	reportAndGo(type, urlLoc);
	clearType();
}
// trackTypeAndGo2 is called by the main picture
// it tracks the event and redirects the browser to a new location within the site
function trackTypeAndGo2(what) {
	//alert("trackTypeAndGo2(): " + what);
	var sps = what.split("&");
	type = sps[0]
	urlLoc = sps[1]
	reportAndGo(type, urlLoc);
	clearType();
}
// trackTypeAndOpen is called by the DVD icon link
// it tracks the event and opens a new window to an offsite location
function trackTypeAndOpen(what) {
	//alert("trackTypeAndOpen(): " + what);
	var sps = what.split("&");
	type = sps[0]
	urlLoc = sps[1]
	reportAndOpenNew(type, urlLoc);
	clearType();
}
// trackType is called by the text link next to the DVD icon link if there is any
// CURRENTLY NOT IN USE - NEEDS TESTING IF IMPLEMENTED
function trackType(what) {
	//alert("trackType(): " + what);
	type = what;
	reportPopUp(type);
	clearType();
}
//clear methods //
function clearType() {
	type = "";
	urlLoc="";
	
}


// omniture methods
//
// tracks the event and redirects the browser within the site
function reportAndGo(whatType, whatUrlLoc) {
	var sendThis = "DVD UK: Flash Module: "+whatType;
	//alert("reportAndGo:" +sendThis+", whatUrlLoc: "+whatUrlLoc);
	var s=s_gi(s_account);
	s.linkTrackVars='prop1,prop9,server';
	s.linkTrackEvents='None';
	s.prop1="International";
	s.prop9=sendThis;
	s.server='homeboxoffice.co.uk';
	s.t(this,'o');
	//alert("Goodbye");
	window.location.href = whatUrlLoc;
}
// tracks the event and open up a new window to an offsite location
function reportAndOpenNew(whatType, whatUrlLoc) {
	var sendThis = "DVD UK: DVD Link: Flash Module: "+whatType;
	//alert("reportAndOpenNew: "+sendThis+", whatUrlLoc: "+whatUrlLoc);
	var s=s_gi(s_account);
	s.linkTrackVars='prop1,prop9,server';
	s.linkTrackEvents='None';
	s.prop1="International";
	s.prop9=sendThis;
	s.server='homeboxoffice.co.uk';
	s.t(this,'o');
	//alert("Goodbye");
	window.open(whatUrlLoc);
}

// tracks the event for a pop up from the text link next to the buy now link
//NOT CURRENTLY USED - NEEDS TESTING IF IMPLEMENTED
function reportPopUp(myText) {
	var sendThis = "DVD UK: Flash Module: "+myText;
	//alert("send_to_omniture2: " +sendThis);
	var s=s_gi(s_account);
	s.linkTrackVars='prop1,prop9,server';
	s.linkTrackEvents='None';
	s.prop1="International";
	s.prop9=sendThis;
	s.server='homeboxoffice.co.uk';
	//alert("HI");
	s.t(this,'o');
}
