// *** Last Updated 06-14-09
if (typeof(wsstag_enabled) == 'undefined' || wsstag_enabled != "false") { //enabtest
// setup paths to js files
// - use relative path starting from domain name to keep the protocol intact

// set ON/OFF flag
if (typeof(wsstag_enabled) == 'undefined')
  var wsstag_enabled = "true";
var wsstag_batch = "false";
var wsstag_location = document.location;
var wsstag_doctitle = document.title;
var _wss_temp_url = null;
var wsstag_querystring = document.location.search;

if (typeof(wss_testonly) != "undefined") {
  if (wss_testonly == "true") {
    wsstag_batch = "true";
    wsstag_location = new Object();
    wsstag_location.protocol = wss_testprotocol;
    wsstag_location.hostname = wss_testhostname;
    wsstag_location.href = wss_testhref;
    wsstag_location.pathname = wss_testpathname;
    wsstag_location.search = wss_testsearch;
    wsstag_doctitle = wss_testtitle;	
  }
}

// Disable the tag if the page contains an iFrame - contains an override if necessary
if (window.frames.length > 0) {
	wsstag_enabled = "false";
	if(typeof(wsstag_iFrame_override) != "undefined"){
		wsstag_enabled="true";
	}
}

// Disable tag if page protocol starts with "file"
if (wsstag_location.protocol.indexOf("file") == 0)
{
  wsstag_enabled = "false";
}

// set prod env value
var wsstag_prodEnv = "prod";  // used to compare against environment result
var wsstag_testEnv = "test";

// determine current environment
var wsstag_hostname = location.hostname;
// check for typical non-prod domains as well as IP addresses
var wsstag_regex = new RegExp("\\b(dev|stage|test|localhost|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})\\b", "i");
var wsstag_matches = wsstag_hostname.match(wsstag_regex);

var wsstag_envResult = "";
if(wsstag_matches == null) {
   wsstag_envResult = "prod";
} else {
   wsstag_envResult = wsstag_matches[1].toLowerCase();
}
if (wsstag_location.href.indexOf('www.mastercard.com') != -1) {
	wsstag_envResult = "prod";
}
if (wsstag_location.href.indexOf('http://mastercard.com') != -1) {
	wsstag_envResult = "prod";
}

if (wsstag_location.href.indexOf('signup.mastercard.com.au') != -1) {
	wsstag_envResult = "prod";
}

if (wsstag_location.href.indexOf('signup.mastercardroadshow.co.nz') != -1) {
	wsstag_envResult = "prod";
}

if (typeof(wsstag_prefix) == 'undefined'){
	var wsstag_prefix = wsstag_hostname;
}

var wsstag_jsConfigURL = document.location.protocol + "//" + wsstag_prefix + "/common/js/wss_cms2_config.js";
var wsstag_jsDirURL = document.location.protocol + "//" + wsstag_prefix + "/common/js/wss_dir2_config.js";
var wsstag_jsImplURL = document.location.protocol + "//" + wsstag_prefix + "/common/js/hbx.js";

// include js files
if (wsstag_enabled == "true") {   
   document.write("<scr"+"ipt src=\""+wsstag_jsDirURL+"\"></scr"+"ipt>");
	document.write("<scr"+"ipt src=\""+wsstag_jsConfigURL+"\"></scr"+"ipt>");
   if (wsstag_batch != "true") {
		if(typeof(wsstag_videoType)!="undefined"){ 
			document.write("<scr"+"ipt src=\""+wsstag_jsImplURL+"\"></scr"+"ipt>");
		}
		else {
			document.write("<scr"+"ipt defer src=\""+wsstag_jsImplURL+"\"></scr"+"ipt>");
		}
   }   
}

}//end enabtest