// <!--
var idea_width;
var idea_height;
var idea_valign = "bottom";
var idea_align = "left";

// JavaScript helper required to detect Flash Player PlugIn version information
function idea_JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		flashVer = -1;
	}
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function idea_DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
	// Detect Client Browser type
	var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
	var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = idea_VBGetSwfVer(i);
		} else {
			versionStr = idea_JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
			// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}
}

// When called this function returns the code for displaying a flash movie
function idea_GetFlashMovie(loader, query, width, height)
{
	var hasProductInstall = idea_DetectFlashVer(6, 0, 65);	
	var hasReqestedVersion = idea_DetectFlashVer(8, 0, 0);	
	var size = 'width="' + width + '" height="' + height + '" ';
	query = '?' + query + '&';
	if ( hasProductInstall && !hasReqestedVersion ) {
		var MMredirectURL = window.location;
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		var MMdoctitle = document.title;
		query += 'MMredirectURL=' + MMredirectURL + '&MMdoctitle=' + MMdoctitle + '&';
	}	
	if (hasReqestedVersion || hasProductInstall) {
		var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"'
		+ size + 'id="flashLoader">'
		+ '<param name="movie" value="' + loader + query + 'MMplayerType=ActiveX" />'
		+ '<param name="quality" value="high" /><param name="wmode" value="transparent" />'
		+ '<embed src="' + loader + query + 'MMplayerType=PlugIn" ' + size
		+ 'quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" swLiveConnect=TRUE wmode="transparent">'
		+ '</embed>'
		+ '</object>';
		return oeTags;
	} else {
		var alternateContent = '<table width=420 cellpadding=0 cellspacing=0 border=1 bgcolor=white><tr><td bgcolor=white>'
		+ '<table border=0 cellpadding=10 cellspacing=0 width="100%"><tr><td align=center colspan=2>'
		+ '<H3><font color="#999999" face="Arial, Helvetica, sans-serif">This web site makes use of the<br><a href=http://www.macromedia.com/go/getflash/><font color="#999999">Macromedia Flash Player</font></a>.</font></H3></td></tr>'
		+ '<tr><td align=center><a href=http://www.macromedia.com/go/getflash/><img src="http://www.macromedia.com/images/shared/download_buttons/get_flash_player.gif" width="88" height="31" border="0" alt="Get Flash Player" /></a></td>'
		+ '<td align=center><font color="#333333" face="Arial, Helvetica, sans-serif">Why not download and install the latest version now? It will only take a moment.</font></td></tr>'
		+ '<tr><td colspan=2 align=center><a href="javascript:document.getElementById(\'idvideo\').style.display=\'none\'; void(0);"><font face="Arial, Helvetica, sans-serif" color="#FF3333"><b>Close</b></font></a></td></tr>'
		+ '</table></td></tr></table>';
		return alternateContent;
	}	
}

// When called this function prints the code for displaying a flash movie
function idea_ShowFlashMovie(loader, query, width, height)
{
	idea_width = width;
	idea_height = height;

	// check for required DOM functions to insert overweb code
	if (document.getElementById && document.createElement && document.body && document.body.appendChild) {
		if (document.getElementById("idvideo")) {
			idea_video = document.getElementById("idvideo");
			idea_video.style.display = "block";
		} else {
			idea_video = document.createElement("div");
			idea_video.id = "idvideo";
			document.body.appendChild(idea_video);
		}
		idea_video.style.position = "absolute";
		idea_video.style.top = "0px";
		idea_video.style.left = "0px";
		idea_video.style.height = idea_height + "px";
		idea_video.style.width = idea_width + "px"; // "100%";
		idea_video.style.zIndex = "10000";
		
		idea_Position();
		idea_hideSelects('hidden');
		
		idea_video.innerHTML = idea_GetFlashMovie(loader, query, width, height);
		
		idea_interval = setInterval('idea_Position()', 50);
	} else {
		window.status = "idea unable to load: browser not supported";
	}
}

function idea_Position() {
	if(idea_video.style.display != "none") {
		var ie = document.all && !window.opera;
		var iebody = (document.compatMode=="CSS1Compat") ?  document.documentElement : document.body;
		var scroll_top = (ie) ? iebody.scrollTop : window.pageYOffset;
		var scroll_left = (ie) ? iebody.scrollLeft : window.pageXOffset;
		var docheight = (ie) ? iebody.clientHeight : window.innerHeight;
		var docwidth = (ie) ? iebody.clientWidth : window.innerWidth;
		var intY = 0;
		var intX = 0;
		
		switch(idea_valign.toLowerCase()) {
			case "top": 
				intY = scroll_top + 5;
				break;
			case "bottom":
				intY = scroll_top + docheight - idea_height;
				if (navigator.userAgent.indexOf("Firefox") > 0) { intY = intY - 5; }
				break;
			case "middle": default:
				intY = scroll_top + (docheight - idea_height) / 2;
				break;
		}
		switch(idea_align.toLowerCase()) {
			case "left":
				intX = scroll_left + 5;
				break;
			case "right":
				intX = scroll_left + docwidth - idea_width;
				if (navigator.userAgent.indexOf("Firefox") > 0) { intX = intX - 5; }
				break;
			case "center":
				intX = scroll_left + (docwidth - idea_width) / 2;
				break;
		};
		
		idea_video.style.top = intY + 'px';
		idea_video.style.left = intX + 'px';
	} else {
		idea_hideSelects('visible');
		clearInterval(idea_interval);
	}
}

function idea_hideSelects(action) {
    //possible values for action are 'hidden' and 'visible'
    if (action!='visible') {
        action='hidden';
    }
    if (navigator.appName.indexOf("MSIE")) {
        for (var S = 0; S < document.forms.length; S++) {
            for (var R = 0; R < document.forms[S].length; R++) {
                if (document.forms[S].elements[R].options) {
                    document.forms[S].elements[R].style.visibility = action;
                }
            }
        }
    }
}

var idea_oldOnload, idea_funcOnLoad;
function idea_SetupOnLoad(functionName) {
	idea_funcOnLoad = functionName;
	if (window.addEventListener)
		window.addEventListener("load",functionName,false);
	else if (window.attachEvent)
		window.attachEvent("onload",functionName);
	else {
		if(typeof(window.onload) == "function") {
			idea_funcOnLoad = functionName;
			idea_oldOnload = window.onload;
			window.onload = idea_OnLoad;
		} else {
			window.onload = functionName;
		}
	}
}
function idea_OnLoad() {
	if(typeof(idea_oldOnload) == "function") idea_oldOnload();
	if(typeof(idea_funcOnLoad) == "function") idea_funcOnLoad();
}
// -->