function HideTabs(num){
	try{
		var count;
		for (count = 1; count <= num; count++) {
			document.getElementById('TabContent'+count).style.display = 'none';
			document.getElementById('Tab'+count).className = '';
		}
	}catch(e){}
}



function SetTab(TabNum, Total){
	try{
		HideTabs(Total);
		document.getElementById('TabContent'+TabNum).style.display = 'block';
		document.getElementById('Tab'+TabNum).className = 'Sel';
		return true;
	}catch(e){}
}


// Resize home page news scrolling div

AttachResize = function() {
	try {
		if(document.getElementById('HomeContent')){
			var ScrollElement = document.getElementById('Scroll');
			var ContentElement = document.getElementById('HomeContent');
			var ScrollElementTop = getElementPosition('Scroll').top - getElementPosition('News').top;
			var ScrollElementHeight = ContentElement.clientHeight - ScrollElementTop - 30;
			ScrollElement.style.height = ScrollElementHeight + 'px';
		}else{}
	} catch(e) {}
}



function getElementPosition(elemID) {
   	try {	
		var offsetTrail = document.getElementById(elemID);
		var offsetLeft = 0;
		var offsetTop = 0;
		while (offsetTrail) {
			offsetLeft += offsetTrail.offsetLeft;
			offsetTop += offsetTrail.offsetTop;
			offsetTrail = offsetTrail.offsetParent;
		}
		if (navigator.userAgent.indexOf("Mac") != -1 && 
			typeof document.body.leftMargin != "undefined") {
			offsetLeft += document.body.leftMargin;
			offsetTop += document.body.topMargin;
		}
		return {left:offsetLeft, top:offsetTop};
	}catch(e){
	   return {left:0, top:0};
	}
    //return "left:" + offsetLeft + ", " + "top:" + offsetTop;
}






/*WriteFlash = function() {
	try {
		var str='';
		str+='	<object type="application\/x-shockwave-flash" data="\/files\/flash\/LHHome.swf" width="750" height="250" title="" id="FlashBanner">';
		str+='		<param name="wmode" value="transparent">';
		str+='		<param name="movie" value="\/files\/flash\/LHHome.swf">';
		str+='	<img src="\/files\/images\/template\/home_logo.gif" width="272" height="214" border="0">';
		str+='	<\/object>';
		var element = window.document.getElementById('HomeFlash');
		element.innerHTML = str;
	} catch(e) {}
}
*/





if(window.addEventListener) { // gecko, safari, konqueror and standard
	window.addEventListener('load', AttachResize, false);
	window.addEventListener('load', WriteFlash, false);
} else if(document.addEventListener) {  // opera 7
	document.addEventListener('load', AttachResize, false);
	document.addEventListener('load', WriteFlash, false);
} else if(window.attachEvent) { // win/ie
	window.attachEvent('onload', AttachResize);
	window.attachEvent('onload', WriteFlash);
} else { // mac/ie5
	if(typeof window.onload == 'function') {
		var existing = onload;
		window.onload = function() {
			existing();
			AttachResize();
			WriteFlash();
		}
	} else {
		window.onload = function() {
			AttachResize();
			WriteFlash();
		}
	}
}
