// 2007.05.27 KJD: File Created

// 2007.09.19 KJD: Changed setClip to TCXMSetClip

// 2007.06.29 KJD: Updated to show div and styles

var OS = navigator.platform.toLowerCase();
    if ((OS.indexOf("win")!=-1) || (OS.indexOf("mac")!=-1))
    {
		function DisplayDiv()
		{
			
			var myString = "<DIV	ID='ThreatConWindow'	CLASS='TCXM_Window'	STYLE='width:180px;height:240px;position:relative; z-index:100'>"
				+ "		<DIV		ID='ThreatConFrame'		CLASS='TCXM_Frame'	STYLE='width:200px; height:240px;position:absolute;overflow:hidden;'>"
				+ "			<DIV	ID='ThreatConXM'		CLASS='TCXM_Main' 	STYLE='position:relative;width:180px;top:-195px;left:-700px;'>"				
				+ "<DIV style='width:180px;position:absolute;top:200px;left:700px;' >"
				+ " <div class='mainBdyWrap'>"
				 + " <div class='gSnavTopGrey'>"
				+ "	<div class='gs1Grey'><b></b></div>"
				+ "	<div class='gs2Grey'></div>"
				+ "	<div class='gs3Grey'><b></b></div>"
				+ "	<div class='gs4Grey'><b></b></div>"
				 + " </div>"
				 + " <div class='mainBdyWrapTxtGreyTc'>"
				+	"<div class='mainBdyWrap'>"
				+"  <div class='gSnavTop'>"
				+ "		<div class='gs1'><b></b></div>"
				+ "	<div class='gs2'></div>"
				+"	<div class='gs3'><b></b></div>"
				+"						<div class='gs4'><b></b></div>"
				+"	  </div>"
				+ "	  <div class='mainBdyWrapTxtTc'><h3>"
				+ myTitle
				+ "</h3><p><strong>"
				+ level
				+ "</strong></p>"
				+ levelImage
				+ "<p><a href='#' onClick=\"javascript:window.open(\'" + url +"','learnabout','resizable,scrollbars,height=550,width=420')\">"
				+ learn
				+ "</a></p><br/>"
				+ "</div>"
          		+ "<div style='clear:both'></div>"
          		+" <div class='gSnavBtm'>"
           		+" <div class='gs4'><b></b></div>"
            	+ "<div class='gs3'><b></b></div>"
            	+" <div class='gs2'></div>"
            	+" <div class='gs1'><b></b></div>"
          		+"</div>"
       			+" </div>"
      			+ "</div>"
      			+"<div class='gSnavBtmGrey'>"
        		+"<div class='gs4Grey'><b></b></div>"
        		+"<div class='gs3Grey'><b></b></div>"
        		+"<div class='gs2Grey'></div>"
        		+"<div class='gs1Grey'><b></b></div>"
      			+"</div>"
    			+"</div>"
				+ "			</DIV>"
				+ "			</DIV>"
				+ "		</DIV>"
				+ "	</DIV>";
		
			return myString;
		}
		
		// 2007.05.27 KJD: Created the Display function
		function DisplayThreatCon()
		{
		
			// var PlayerFrame		= "ThreatConXM.swf";
			var PlayerFrame		= "/business/threatcon/20090108/ThreatConXM.swf";
			var Flash_width		= 875;
			var Flash_height	= 600; 
			var Flash_name		= "ThreatConXM";
			
			
		
			if( ( typeof Flash_name == "undefined" ) || ( Flash_name == "" ) ){ Flash_name = "FlashMovie"; }
			
			   var so = new SWFObject("/business/threatcon/20090108/ThreatConXM.swf",Flash_name, Flash_width, Flash_height, "8", "#fff");
			   so.addParam("wmode", "transparent");
			   so.addVariable("id", Flash_name);
			   
			   so.addVariable("allowScriptAccess","always");			  
			   so.addVariable("movie",PlayerFrame);	 
			   so.addVariable("swliveconnect","true");	   
			    
			   so.write("ThreatConXM");
			
		}
		
		// 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";
				thisTC.style.overflow="hidden";
				thisTC.style.height		= "250px";
				
				
			}
			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		= "700px";
				thisOuter.style.margin	= "0px 0px 0px 500px";
				thisTC.style.left		= "-500px";
				thisTC.style.height		= "350px";
			}
			else if( 	flyoutname == 'threatflyoutClose' 	)	{thisTC.style.height		= "250px";	}
			else{thisTC.style.height		= "250px";}
		
		}
		
		// 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; border:0px'>" );
		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";
		}
	}