$(document).ready(function(){
	$("#smartCheckList1").hide();
	$("#newsItems").cycle({
		fx: 'fade',
		pause: 1
	});
	$(".checkList").attr("href","javascript:void(0);").click(function() {
   		$(this).parent().children("ul").toggle("fast");
	});
	$("tr.training").hide();
	$("tr#trainingNo").hide();
	$("tr.trainingYes").hide();
	
	$("tr#location select").change(function() {
		$(this).val() == "DoD - Iraq/Afghanistan" ? $("tr.training").show() : $("tr.training").hide();
		$("tr.trainingYes").hide();
		$("tr#trainingNo").hide();
		$("input#hadTraining_Yes").attr('checked', false);
		$("input#hadTraining_No").attr('checked', false);
	} );
	
	$("input#hadTraining_Yes").click(function() {
		$("tr.trainingYes").show();
		$("tr#trainingNo").hide();
	} );
	
	$("input#hadTraining_No").click(function() {
		$("tr.trainingYes").hide();
		$("tr#trainingNo").show();
	} );
	
});

IS_DOM = (document.getElementById) ? true : false;

// image-swapping functions
function imgOn(imgName) {
  if (document.getElementById) {
    document.getElementById(imgName).src = eval(imgName + "on.src");
  }
}
 
function imgOff(imgName) {
  if (document.getElementById) {
    document.getElementById(imgName).src = eval(imgName + "off.src");
  }
}

function popIt(url, windowName, width, height) {
window.open(url,windowName,"top=100,left=100,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=yes")
}

// preload constant
/*
var aConstants = new Array();
aConstants = ["","home","sitemap"];
for (i = 1; i < aConstants.length; i++) { 
	eval("cnst"+i+"on = new Image();"); eval("cnst"+i+"off = new Image();");
	eval("cnst"+(i)+"on.src = \"" + sFolderLevel + "img/navigation/cnst-"+aConstants[i]+"-r.gif\";");
	eval("cnst"+(i)+"off.src = \"" + sFolderLevel + "img/navigation/cnst-"+aConstants[i]+"-0.gif\";");
}
*/
// preload level1 menu buttons
var aLevel1 = new Array();
aLevel1 = ["","company","products_solutions","investor","service_support"];
for (i = 1; i < aLevel1.length; i++) { 
	eval("l1nav"+i+"on = new Image();"); eval("l1nav"+i+"off = new Image();");
	eval("l1nav"+(i)+"on.src = \"" + sFolderLevel + "img/navigation/l1nav-"+aLevel1[i]+"-r.gif\";");
	eval("l1nav"+(i)+"off.src = \"" + sFolderLevel + "img/navigation/l1nav-"+aLevel1[i]+"-0.gif\";");
}

var aExtranetLevel1 = new Array();
aExtranetLevel1 = ["", "welcome", "securedcontent", "security", "reports"];
for (i = 1; i < aExtranetLevel1.length; i++) { 
	eval("l1enav" + i + "on = new Image();");
	eval("l1enav" + i + "off = new Image();");
	eval("l1enav" + i + "on.src = \"" + sFolderLevel + "extranet/_app/img/navigation/l1-" + aExtranetLevel1[i] + "-r.gif\";");
	eval("l1enav" + i + "off.src = \"" + sFolderLevel + "extranet/_app/img/navigation/l1-" + aExtranetLevel1[i] + "-0.gif\";");
};


/* This function is used when you want to have browsers that do not 
have flash player installed write an image file instead */

function writeFlashOrImage(FlashName,ImageName,Width,Height,Alt,FlashVersion) {
	// first, write the opening object tag

	strObjectTag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	strObjectTag = strObjectTag + ' width="' + Width + '" height="' + Height + '" ';
	strObjectTag = strObjectTag + 'codebase="http://active.macromedia.com/flash5/cabs/swflash.cab#version=';
	strObjectTag = strObjectTag + FlashVersion + '">';
	strMovieParam = '<param name="movie" value="' + FlashName + '">';
	document.write(strObjectTag);
	document.write(strMovieParam);
	document.write('<param name=\"play\" value=\"true\">');
	document.write('<param name=\"loop\" value=\"true\">');
	document.write('<param name=\"quality\" value=\"high\">');
	document.write('<param name=\"wmode\" value=\"transparent\">');

	// if the Flash Plug-in is installed and a browser than user plug-ins is the browser, write an embed tag
	plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		strImageTag = '<image src="' + ImageName + '" width="' + Width + '" height="' + Height + '" ';
		strImageTag = strImageTag + ' border="0" alt="' + Alt + '">';
	if ( plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4 )
		{
		strEmbedTag = '<embed src="' + FlashName + '" width="' + Width + '" height="' + Height + '" ';
		strEmbedTag = strEmbedTag + 'play="true" loop="true" quality="high" ';
		strEmbedTag = strEmbedTag + 'wmode="transparent"';
		strEmbedTag = strEmbedTag + 'pluginspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
		document.write(strEmbedTag);
		document.write('</embed>');
		}
	// otherwise, then write an image tag.
	else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
		document.write(strImageTag);
		}
	
	//finally, write the closing object tag
	document.write('</object>');
}

// opens centered window
function popUp(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// targets parent window
function loadParent(url) {
  window.opener.location.href = url;
}

function toggleList(sList)
{
	if (document.getElementById)
	{
		oList = document.getElementById(sList);
		if (oList)
		{
			if (bShowSmartCheckList)
			{
				oList.style.display = 'none';
				bShowSmartCheckList = 0;
			}
			else
			{
				oList.style.display = 'block';
				bShowSmartCheckList = 1;
			}
		}
	}
}
bShowSmartCheckList = 0;
