//Omniture Tag Global Parameters
var sProductionAccount = "sitereportingsuite,globalreportingsuite";
var sDevAccount = "sitedevsuite,globaldevsuite";
var sDevURLId = "digitas.com";


//Omniture automated reporting suite detection (Determines dev or live environment)
var sCurURL = document.location.href; //Get the current url of the site
var sURLId = sDevURLId; //Define the string to identify if this is on dev or staging
var isProduction = (sCurURL.indexOf(sURLId) == -1) ? true : false;
var s_account = (isProduction) ? sProductionAccount : sDevAccount;




function trackPage(params)
{
		// takes a string of name-value pairs in a string and breaks it apart into properties.
        //var params = new Parameters(params);
        
        // Note: the Omniture "plug and play" interface creates a global
        //       Javascript object called 's' whenever an "account-adapted"
        //       version of the s_code.js code (e.g. mb_s_code.js) is
        //       "sourced" in the page (e.g. using <script...src="mb_s_code.js" />).

        // This function sets the available tracking properties in the
        // global Omniture tracking object.
        
        //s.pageName=params.get("pagename");
        //s.channel=params.get("channel");
        //s.prop2=params.get("prop2");
        //s.prop3=params.get("prop3");  // Custom Variable
       // s.prop5=params.get("prop5");  // Custom Variable
        	
        // ALERT: 	This is where omniture tracking will need to be implemented.
		//			Since we don't have the specifics on the s_code.js file
		//			running in the Samsung system, this will handled taking 
		//			Omniture tracking from flash and prepare it for the Omniture call
		//alert( "trackPage(" + params + ")");
        
}

function trackLink(params) {
  var params = new Parameters(params);
  
  s.linkTrackVars=params.get("pagename");
  s.eVar3=params.get("eVar3");
  
  //alert( "s.tl(" + s.linkTrackVars + ")");
}

function Parameters(qs) {
	this.params = new Object()
	this.get=Parameter_get

	if (qs.length == 0) return

	var args = qs.split(',') // parse out name/value pairs separated via ,
	
// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name
		
		this.params[name] = value
	}
}

function Parameter_get(key, default_) {
	if (default_ == null) default_ = null;
	
	var value=this.params[key]
	if (value==null) value=default_;
	
	return value
}

