
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// -----------------------------------------------------------------------------

// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);


var playerId = "widget";
var playlist = "timdraper_2";
var campaign = "4";
var affiliate = "237";
var flow_type = "replyY";
var promo_display = "false";
var mobile_link_display = "false";
var email_link_display = "false";
var autoPlay = "false";
var info_xml = "WidgetInfo.xml";
var email_action = "true";
var sms_action = "true";
var embed_action = "false";
var info_action = "false";

// Note this setting is used if the production swf's are not located at "http://www.mogreet.com/flash/"
// If they are located at a different location then you have to use the base_location setting.
var base_location = "http://www.mogreet.com/genWTest/";
	
var widgetSetting = "playerId="+playerId+"&playlist="+playlist+"&campaign="+campaign+"&affiliate="+affiliate+"&flow_type="+flow_type+"&promo_display="+promo_display+"&autoPlay="+autoPlay+"&mobile_link_display="+mobile_link_display+"&email_link_display="+email_link_display+"&info_xml="+info_xml;
widgetSetting += "&email_action="+email_action+"&sms_action="+sms_action+"&embed_action="+embed_action+"&info_action="+info_action;

//Note if use custom base_location uncomment the line below
widgetSetting += "&base_location="+base_location;

if ( hasProductInstall && !hasRequestedVersion ) {
	// DO NOT MODIFY THE FOLLOWING FOUR LINES
	// Location visited after installation is complete if installation is required
	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;

	AC_FL_RunContent(
		"src", "http://www.mogreet.com/flash/playerProductInstall",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
		"width", "300",
		"height", "250",
		"align", "middle",
		"id", "MogreetWidgetMidRec",
		"quality", "high",
		"bgcolor", "#000",
		"name", "MogreetWidgetMidRec",
		"allowScriptAccess","always",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
} else if (hasRequestedVersion) {
	// if we've detected an acceptable version
	// embed the Flash Content SWF when all tests are passed
	AC_FL_RunContent(
			"src", "http://www.mogreet.com/genWTest/MogreetWidgetMidRec",
			"width", "300",
			"height", "250",
			"align", "middle",
			"FlashVars", widgetSetting,
			"id", "MogreetWidgetMidRec",
			"quality", "high",
			"bgcolor", "#000",
			"name", "MogreetWidgetMidRec",
			"allowScriptAccess","always",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
} else {  // flash is too old or we can't detect the plugin
	var alternateContent = 'Alternate HTML content should be placed here. '
  	+ 'This content requires the Adobe Flash Player. '
   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent);  // insert non-flash content
}
