	//This section is passing variables to the flash video player.
	var passHost = location.host;
	var vid_locale = nsw_data.video_region;
	var sub_locale=nsw_data.video_region;
	var current_guid = getQuerystring("guid");
	var currentURL = "";
	
	var vid_guid = 'af389138-1efa-de6f-735b-89c9228964d0_id1253';
		if (nsw_data.platypus_region == 'en_US') vid_guid = 'cf1006a4-f1b5-b627-97ce-daff834c6f21_id1387641';
		
		if (nsw_data.platypus_region == 'en_APAC') vid_guid = 'af389138-1efa-de6f-735b-89c9228964d0_id1253';
		if (nsw_data.platypus_region == 'th_TH') vid_guid = 'af389138-1efa-de6f-735b-89c9228964d0_id1253';
		if (nsw_data.platypus_region == 'zh_TW') vid_guid = 'af389138-1efa-de6f-735b-89c9228964d0_id1253';
		if (nsw_data.platypus_region == 'zh_HK') vid_guid = 'ce767b25-becd-4d81-e9aa-55656bf01f67_id1253';
		if (nsw_data.platypus_region == 'zh_CN') vid_guid = 'ce767b25-becd-4d81-e9aa-55656bf01f67_id1253';
		if (nsw_data.platypus_region == 'ja_JP') vid_guid = '6f5ac6a7-dbf0-d380-05be-07e1844379ca_id1253';
	var vid_siteConfig =  'http://'+passHost+'/sportswear/global/xml/videoSiteConfig.xml';
	var vid_regionConfig = 'http://'+passHost+'/nikeos/global/modules/video/v1/xml/reg/reg_config_'+sub_locale+'.xml';
	
	if (current_guid != "")
	{
	currentURL = 'http://'+passHost+'/nikeos/p/sportswear/'+nsw_data.platypus_region+'/media_details?video=3%26videotype=video%26guid=' + current_guid;
	}
	else
	{
	currentURL = 'http://'+passHost+'/nikeos/p/sportswear/'+nsw_data.platypus_region+'/media';
	}
	var encodecurrentURL = escape(currentURL);
	

	function createDynLoader(vid_locale, vid_guid, vid_siteConfig, vid_regionConfig, encodecurrentURL){
		JQ().find("#video_wide").each(function(){
			var so = new SWFObject(nsw_data.video_swf, "feature", "908", "510", "9", "#ffffff");
			so.addParam("scale", "noscale");
			so.addParam("allowScriptAccess", "always");
			so.addParam("allowFullScreen", "true");
			so.addParam("wmode", "opaque");
			so.addParam("menu", "false");
			so.addVariable("locale", vid_locale);
			so.addVariable("guid", vid_guid);
			so.addVariable("siteConfig", vid_siteConfig);
			so.addVariable("regionConfig", vid_regionConfig);
			so.addVariable("currentUrl", encodecurrentURL);
			so.addVariable("trackerObject", escape(JSON.stringify(nav_tracker_obj)));
			var f=so.write("video_wide");
			if(!f)
				JQ("div#video_wide").append(JQ("div#no_flash_content").html());
		});
	}
	//This section passes in the videotype, lang and guid
	function individualVidLoader(videotype, vid_locale, fileID){
		if(videotype == "video"){
			vid_guid = fileID;
		createDynLoader(vid_locale, fileID, vid_siteConfig, vid_regionConfig, encodecurrentURL);
		}
		if(videotype == "channel"){
			vid_guid = fileID;
		createDynLoader(vid_locale, vid_guid, vid_siteConfig, vid_regionConfig, encodecurrentURL);
		}
	}
	
JQ(document).ready(function(){
		var findLading = JQ().find('.mlanding');
		if(findLading.length = 1){
			createDynLoader(vid_locale, vid_guid, vid_siteConfig, vid_regionConfig, encodecurrentURL);
		}
});//ready

function getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}

