//	FORCE VERTICAL SCROLL TO ALL PAGES
var $browserHeight=120;

//	DETECT BROWSER
var isIE5 	= 	(document.all && document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 5.0') != -1) ? true : false;
var isIE55 	= 	(document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 5.5') != -1) ? true : false;
var isIE6 	= 	(document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 6.0') != -1) ? true : false;
var isIE7 	= 	(document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 7.0') != -1) ? true : false;
var isIE	= 	(navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    
var isSafari=	(navigator.userAgent.indexOf('Safari')!=-1) ? true : false;
var isMacIE =	(navigator.userAgent.indexOf('MSIE')!=-1 && navigator.userAgent.indexOf('Mac')!=-1) ? true : false;
var isGecko = 	(!document.all && document.getElementById) ? true : false;
var isOP	=	((navigator.appName.indexOf('Opera') != -1)||(navigator.plugins.length>0 && navigator.appName.indexOf('Microsoft') != -1)||(!navigator.product && navigator.appName.indexOf('Netscape') != -1))
var isWindows=(navigator.userAgent.toLowerCase().indexOf('win')!=-1) ? true : false;
var isMac=(navigator.userAgent.toLowerCase().indexOf('mac')!=-1) ? true : false;
var thisbrowser = 'unknown';

//FireFox PC AND MAC
if (isGecko){
	if(isMac){thisbrowser = "MacGecko";}else{thisbrowser = "PCGecko"; $browserHeight=130;}
		}
//IE 5 WINDOWS
if (isIE){
		thisbrowser = "IE"; 
		if(isIE5 && isWindows){$browserHeight=120;thisbrowser = "IE5 Windows";}
//IE 5.5 WINDOWS
		if (isIE55)	{
			thisbrowser = "IE";
			if(isIE55 && isWindows){$browserHeight=120;	thisbrowser = "IE55 Windows";}
			}
//IE 6 WINDOWS
		if (isIE6){
			thisbrowser = "IE";
			if(isIE6 && isWindows)thisbrowser = "IE6 Windows"; 
			}
//MAC IE
		if(isMac){
			thisbrowser = "IE Mac";
			}
		}
//MAC SAFARI
if(isSafari){
	thisbrowser = "Safari";
	}

//	IE6 CONDITIONAL EXPRESSIONS
//	PRO - This saves having to write IE conditional statements to each page
//	CON - Does not work with javascript disabled	


if(isIE){
/*	LT IE7	*/
document.write(''+
'<!--[if lt IE 7]>'+
'<style type="text/css" media="screen">'+
'		 * html #page-layout{width: expression((document.body.clientWidth < 778) ? "770px" : "100%" ); }'+
'		 * html div#header-title ul{margin-left: expression((document.body.clientWidth < 778) ? "535px" : "" ); }'+
'		 * html div#header-title ul{width: expression((document.body.clientWidth < 778) ? "230px" : "230px" ); }'+
'		 * html div#content-Area{width: expression((document.body.clientWidth < 778) ? "488px" : "100%" ); }'+
'		 * html div.block{width: expression((document.body.clientWidth < 778) ? "488px" : "100%" ); }'+
'   </style>'+
'<![endif]-->'+
'');
/*	LT IE6	*/
document.write(''+
'<!--[if lt IE 6]>'+
'<style type="text/css" media="screen">'+
'		 * html div#header-nav, * html div#navbar    { width: expression((document.body.clientWidth < 778) ? "774px" : "100%" ); }'+
//'		 * html div.two{width: expression((document.body.clientWidth < 778) ? "239px" : "49.1%" ); }'+
//'		 * html div.right{width: expression((document.body.clientWidth < 778) ? "239px" : "49.1%" ); }'+
//'		 * html div.three{width: expression((document.body.clientWidth < 778) ? "156px" : "32.1%" ); }'+
//'		 * html div.three-margin{margin-left: expression((document.body.clientWidth  < 778) ? "10px" : "1.8%" ); }'+
'   </style>'+
'<![endif]-->'+
'');

}


//	BUILD CSS DROPDOWN
function startList() 
{
document.body.style.height=((screen.availHeight)-($browserHeight))+"px";
for(i=0;i< document.links.length; i++){
	if(document.links[i].className.indexOf("cssMenu")!=-1){
		var startTag=""; var endTag="";
		var $width=180;
		if(isIE6)$width=190;
		{startTag="<table class='navbarTD' style='width:"+($width)+"px;cursor:hand' cellpadding=0 cellspacing=0 border=0><tr><td style='cursor:hand'>";endTag="</td></tr></table>"}
		document.links[i].innerHTML=startTag+(document.links[i].innerHTML)+endTag;
		document.links[i].onmousedown=function(){
			location.href=this.href;
			}
		document.links[i].onmouseover=function(){	
			var thisMenu=eval('document.getElementById("'+(this.className)+'")');	
			thisMenu.className="mainitemsOver";
			}
		document.links[i].onmouseout=function(){	
			var thisMenu=eval('document.getElementById("'+(this.className)+'")');	
			thisMenu.className="mainitems";
			}
		}
	}
	if (document.all || document.getElementById) 
		{
		var cssdropdownRoot = document.getElementById("cssdropdown");
		if(cssdropdownRoot)
			{
			for (i=0; i<cssdropdownRoot.childNodes.length; i++) 
				{
				var node = cssdropdownRoot.childNodes[i];
				if (node.nodeName=="LI") 
					{
					node.onmouseover=function(){
						this.className="mainitemsOver";//+=" over";
						}
					node.onmouseout=function(){
						this.className="mainitems";//this.className.replace(" over", "");
						}
					}
				}
			}
		}
}

//	RESIZE HUB CONTENT BOXES
function sizeDivs() 
{
var divArray = document.getElementsByTagName('div');
for(i=0;i<divArray.length;i++)
	{
	var thisDiv=divArray[i]	
	if(thisDiv.className.indexOf("containerDiv")!=-1)
		{
		var thisHeight=0;
		var thisContaner=divArray[i];
		for(ii=0;ii<thisContaner.childNodes.length;ii++){
			var $class=thisContaner.childNodes[ii].className;
			if(typeof($class)!='undefined'){
				if($class.indexOf("box")!=-1){
					if(isIE){thisContaner.childNodes[ii].style.removeAttribute("height");}
					if(thisContaner.childNodes[ii].offsetHeight>thisHeight)thisHeight=thisContaner.childNodes[ii].offsetHeight;
					}
				}
			}
		thisHeight=(thisHeight/*-10*/)+"px";
		for(j=0;j<thisContaner.childNodes.length;j++){
			var $valid=thisContaner.childNodes[j].style; 
			if(typeof($valid)!='undefined'){
				thisContaner.childNodes[j].style.height=thisHeight;
				}
			}
		}
	}
}

//	CSS DROPDOWN DEFAULT TOP LINK
function getMenuItem(URLtxt,URLlink,URLtarget)
{
document.write('<a title="'+(URLtxt)+'" href="'+(URLlink)+'" target="'+(URLtarget)+'">'+(URLtxt)+'<\/a>')
}

window.onload=function(){
	sizeDivs();
	startList();
	}

//	REFRESH OR RELOAD THE PAGE WHEN HUB CONTENT BOXES ARE RESIZED AFTER RESIZING THE BROWSER WINDOW
window.onresize=function resize(){
	if (isIE){sizeDivs();return}
	location.replace(location.href);
	}