// 2007.05.27 KJD: File Created

// 2007.09.19 KJD: Changed setClip to TCXMSetClip

// 2007.06.29 KJD: Updated to show div and styles
function DisplayDiv()
{
	
	var myString = "<DIV	ID='ThreatConWindow'	CLASS='TCXM_Window'	STYLE='width:180px;height:250px;position:relative;'>"
		+ "		<DIV		ID='ThreatConFrame'		CLASS='TCXM_Frame'	STYLE='width:200px;height:350px;position:absolute;overflow:hidden;'>"
		+ "			<DIV	ID='ThreatConXM'		CLASS='TCXM_Main' 	STYLE='position:relative;width:1000px;height:625px;top:-180px;left:-700px'>"
		+ "				Loading ThreatCon"
		+ "			</DIV>"
		+ "		</DIV>"
		+ "	</DIV>";

	return myString;
}

// 2007.05.27 KJD: Created the Display function
function DisplayThreatCon()
{

	// var PlayerFrame		= "ThreatConXM.swf";
	var PlayerFrame		= "/business/threatcon/ThreatConXM.swf";
	var Flash_width		= 875;
	var Flash_height	= 600; 
	var Flash_name		= "ThreatConXM";

	if( ( typeof Flash_name == "undefined" ) || ( Flash_name == "" ) ){ Flash_name = "FlashMovie"; }

	// 2006.08.29 KJD: The Flash string for loading and displaying
	var FlashString = "<object classid	= \"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" ";
	FlashString += "	codebase	= \"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" ";
	
	if( ( typeof Flash_width != "undefined" ) && ( Flash_width != "" ) )
	{
		FlashString += "	width		= \"" + Flash_width + "\" ";
	}
	
	if( ( typeof Flash_height != "undefined" ) && ( Flash_height != "" ) )
	{
		FlashString += "	height		= \"" + Flash_height + "\" ";
	}
	
	FlashString += "	id			= \"" + Flash_name + "\" ";
	//FlashString += "	align		= \"middle\" ";
	//FlashString += "	valign		= \"tl\" ";
	FlashString += ">";
	
	FlashString += "<param name	= \"allowScriptAccess\" value= \"always\" />";
	FlashString += "<param name	= \"movie\" 			value= \"" + PlayerFrame + "\" />";
	FlashString += "<param name	= \"swliveconnect\" 	VALUE= \"true\">";
	FlashString += "<param name	= \"quality\" 			value= \"high\" />";
	FlashString += "<param name	= \"bgcolor\" 			value= \"#ffffff\" />";
	FlashString += "<param name	= \"wmode\" 			value= \"transparent\" />";
	
	FlashString += "<embed src				= \"" + PlayerFrame + "\" ";
	FlashString += "	quality				= \"high\" ";
	FlashString += "	bgcolor				= \"#ffffff\" ";

	if( ( typeof Flash_width != "undefined" ) && ( Flash_width != "" ) )
	{
		FlashString += "	width				= \"" + Flash_width + "\" ";
	}
	
	if( ( typeof Flash_height != "undefined" ) && ( Flash_height != "" ) )
	{
		FlashString += "	height				= \"" + Flash_height + "\" ";
	}
	
	FlashString += "	swliveconnect		= \"true\" ";
	FlashString += "	name				= \"" + Flash_name + "\" ";
	// FlashString += "	align				= \"tl\" ";
	FlashString += "	allowScriptAccess	= \"always\" ";
	FlashString += "	type				= \"application/x-shockwave-flash\" ";
	FlashString += "	pluginspage			= \"http://www.macromedia.com/go/getflashplayer\" ";
	FlashString += "	wmode				= \"transparent\" ";
	FlashString += "/>";
	
	FlashString += "</object>";

	return FlashString;
}

// 2007.06.12 KJD: Set clipping
function TCXMSetClip( flyoutname )
{
	// 2007.09.24 KJD: Re-written for FF non-IE issues

	var thisTC		= document.getElementById( 'ThreatConFrame' );
	var thisOuter	= document.getElementById( 'ThreatConXM' );
	
	if( 		flyoutname == "" 					)
	{
		thisTC.style.width		= "200px";
		thisOuter.style.margin	= "0px 0px 0px 0px";
		thisTC.style.left		= "0px";
	}
	else if( 	flyoutname == "ThreatWatch" 		)
	{
		thisTC.style.width		= "400px";
		thisOuter.style.margin	= "0px 0px 0px 200px";
		thisTC.style.left		= "-200px";
	}
	else if( 	flyoutname == "AttackExplorer" 		)
	{
		thisTC.style.width		= "700px";
		thisOuter.style.margin	= "0px 0px 0px 500px";
		thisTC.style.left		= "-500px";
	}	
	else if( 	flyoutname == "Environment" 		)
	{
		thisTC.style.width		= "510px";
		thisOuter.style.margin	= "0px 0px 0px 310px";
		thisTC.style.left		= "-310px";
	}		
	else if( 	flyoutname == 'threatflyout' 		)
	{
		thisTC.style.width		= "400px";
		thisOuter.style.margin	= "0px 0px 0px 200px";
		thisTC.style.left		= "-200px";
	}
	else if( 	flyoutname == 'threatflyoutClose' 	)	{	}
	else{}

}

// 2007.06.25 KJD: Next three functions added for FF 1.5
function setscroller1()
{
	document.getElementById( 'myitem' ).style.top = "3000px";
	document.getElementById( 'myitem' ).focus();
	setTimeout( setscroller2, 250 );
}

function setscroller2()
{
	document.getElementById( 'myitem' ).style.top = "20px";
	document.getElementById( 'myitem' ).focus();
	setTimeout( setscroller3, 250 );
}

function setscroller3()
{
	document.getElementById( 'myitem' ).style.top = "0px";
	document.getElementById( 'myitem' ).focus();
	document.getElementById( 'myitem' ).style.visibility = "hidden";
}


	
// 2007.06.29 KJD: Write the divs
document.write( DisplayDiv() );
document.write( "<input type=text name='this' value='' ID='myitem' STYLE='position:absolute;top:0px;left:0px;width:1px;height:1px;'>" );
document.getElementById( 'ThreatConXM' ).innerHTML = DisplayThreatCon();

TCXMSetClip( '' );


// 2007.06.25 KJD: Only do if FF 1.5
if( 
	( navigator.userAgent.indexOf( "Firefox/1.5" ) > -1 ) ||
	( navigator.userAgent.indexOf( "Netscape" ) > -1 )
)
{
	setTimeout( setscroller1, 250 );
}
else
{
	document.getElementById( 'myitem' ).style.visibility = "hidden";
}

