
	/*--------------------------------------+
	 | Title: Global Scripts								|
	 | Version: 1.0													|
	 | Author: Dan Green, Web Developer			|
	 | Company: TMP Government, LLC					|
	 +--------------------------------------*/

var gteIE7 = false /*@cc_on || @_jscript_version >= 5.7 @*/;

// Load External Files
//if(!gteIE7)loadExternalFile("global/_js_source/DD_belatedPNG.js");
//loadExternalFile("global/_css_source/app_script_enabled.css"); // Styles for javascript-enabled browsers only
loadExternalFile('global/_js_source/swfobject.js'); 
loadExternalFile('global/_js_source/app_localfunctions.js');
//if (getQueryVariable("print"))loadExternalFile('global/_css_source/app_print_preview.css');


// Set Global Variables and Object References
var objBody;
var objPrimaryNav;
function getDomObjects() {
	objBody = document.getElementsByTagName("body")[0];
	objPrimaryNav = document.getElementById("nav-primary");
}

// Initialize Global Page Scripts
function initPage(){
	if ((!document.getElementById)||(!document.getElementsByTagName)) return false;
	getDomObjects();
	addListClass("nav-global");
	hideTopLink();
	//showActivePlugins();
}
addLoadEvent(initPage);

function loadExternalFile(filename){
	if(!document.createElement)return false;
	if(filename.indexOf('_js')!=-1){
		var fileref=document.createElement('script');
		fileref.setAttribute("type","text/javascript");
		fileref.setAttribute("src", filename);
	}
	if(filename.indexOf('_css')!=-1){
		var fileref=document.createElement("link");
		fileref.setAttribute("rel", "stylesheet");
		fileref.setAttribute("type", "text/css");
		fileref.setAttribute("href", filename);
	}
 	if (typeof fileref!="undefined")document.getElementsByTagName("head")[0].appendChild(fileref);
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
		oldonload();
		func();
		}
	}
}

function addListClass(myElementID){
	if(document.getElementById(myElementID)){
		arrListItems = document.getElementById(myElementID).getElementsByTagName("ul")[0].getElementsByTagName("li");		
		arrListItems[arrListItems.length-1].className='lastItem';
	}
}

function getX(obj){
  return(obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft+getX(obj.offsetParent));
}

function getY(obj) {
	return(obj.offsetParent==null ? obj.offsetTop : obj.offsetTop+getY(obj.offsetParent));
}

function hideTopLink(){
	if(document.all) {
		if(document.all.contentBot){
		    if ((getY(document.all.contentBot)) < 610) document.all.contentBot.style.display = 'none';
		}	
	} else if(document.getElementById) {
		    if (document.getElementById("contentBot")){
		        if ((getY(document.getElementById("contentBot"))) < 610) document.getElementById("contentBot").style.display = 'none';
		    }
	}
	//alert(getY(document.getElementById("contentBot")));
}

function showActivePlugins(){
	var intCount = 0;
	var arrPlugins = document.getElementById("plugins").getElementsByTagName("li");
	var arrLinks = document.links;
	var arrActivePlugins = new Array();
	var boolIsActiveExt;
	
	for(i=0;i<arrPlugins.length;i++){
		arrPlugins[i].style.display = "none";
		currentFileExt = arrPlugins[i].id.replace(/pluginLink-/i,".");
		boolIsActiveExt = false;
		
		for(j=0;j<arrLinks.length;j++){
			currentArrLink = arrLinks[j].href.toLowerCase();
			if(currentArrLink.indexOf(currentFileExt)!=-1)boolIsActiveExt = true;
		}
		
		if(currentFileExt == ".swf" && document.getElementById("flashcontent"))boolIsActiveExt = true;
		
		if(boolIsActiveExt){
			arrActivePlugins[intCount] = arrPlugins[i];
			intCount++;
		}
		
	}
	
	for(i=0;i<arrActivePlugins.length;i++){
		arrActivePlugins[i].style.display = "inline";
		if (i == 0) arrActivePlugins[i].innerHTML = "[ " + arrActivePlugins[i].innerHTML;
		if (i < (arrActivePlugins.length-1)) arrActivePlugins[i].innerHTML += ", ";
		if (i == arrActivePlugins.length-1) arrActivePlugins[i].innerHTML += " ]";
		//alert(arrActivePlugins[i].innerHTML);
	}
	
	if(arrActivePlugins.length == 0)document.getElementById("plugins").style.display = "none";	
		
}




