/*
 * -----------------------------------------------------------------
 * Copyright (c) Fluid, Inc. All Right Reserved.
 * This software is the proprietary information of Fluid, Inc.
 * Use is subject to strict licensing terms.
 * -----------------------------------------------------------------
 *
 * CVS Information:
 * $Author: afierro $
 * $Date: 
 * $Revision: 1.4 $
 *
 */

var ssflex;
var ssflexID;
var analyticManager;
var headerHeight;
var applicationWidth;
	
function setupSWF(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, localAnalyticManager) {
	if (! (checkHeaderHeight (parseInt(heightStr)) && checkApplicationWidth (parseInt(widthStr)) && checkOpenHeight (flashvarsObj["openHeight"]))) {
		alert ("Bad dimension parameters. Header height min value is 55, application width min value is 320, open height min value is 340. Aborting ... ");
		exit();
	}
	if (swfobject.hasFlashPlayerVersion(swfVersionStr)) {
		this.headerHeight = heightStr;
		this.applicationWidth = widthStr;
		swfobject.embedSWF(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj);
	} else {
		var contentL = document.getElementById("content");
		contentL.innerHTML = 	"<div align=center style=\"border: gray 1px solid;padding: 15px;background-color:#e8e8e8;width:" + widthStr + "px;height:" + heightStr + "px\">" + 
									"This content requires the Adobe Flash Player." +
									"<p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a></p>" +
								"</div>";
	}
	ssflexID = attObj.id;
	analyticManager = localAnalyticManager;
}
	
function getSWF(id) {
	if (this.swfMovie == null) this.swfMovie = thisMovie(id);
	return this.swfMovie;
}

function setHeight(height){
	if(ssflex == null){
		ssflex = getSWF(ssflexID);
	}
	if(ssflex != null){
	 	ssflex.height = height;
	}
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document.getElementById(movieName);
	}
}

// return the header height specified in the setupSWF() call; this fxn is used by the flash app
// to determine the header height
function getHeaderHeight() {
	return this.headerHeight;
}

// return the application width specified in the setupSWF() call; this fxn is used by the flash app
// to determine the application width
function getApplicationWidth() {
	return this.applicationWidth;
}

// Header height must be at least 55
function checkHeaderHeight(height) {
	return (height >= 55);
}

// Application width must be at least 320
function checkApplicationWidth(width) {
	return (width >= 320);
}

function checkOpenHeight(height) {
	return (height >= 340);
}

// Contains the fluid social info temporary
var infoAboutFluidSocial = "";

// Start the process to show an alert with about fluid social information
function showInfoAboutFluidSocial(info) {
	infoAboutFluidSocial = info;
	self.setTimeout("executeShowInfoAboutFluidSocial()", 10);
}

// Show an alert with about fluid social information
function executeShowInfoAboutFluidSocial() {
	alert(infoAboutFluidSocial);
}
