function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function showSubMenu(tID) {
	hideAllMenu("SubMenu");
	tObject = document.getElementById(tID).style;
	tObject.display = "block";
	tObject.zIndex = 999;
}

var allPageTags = new Array();
function hideAllMenu(theClass)
{
	var allPageTags=document.getElementsByTagName("div");
	for (var i=0; i<allPageTags.length; i++)
	{
		if (allPageTags[i].className==theClass) 
		{
			allPageTags[i].style.display = "none";
		}
	}
}
function AddFavority(title, url)
{
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, '');
}

function setClientHeight(mainAreaID)
{
	obj = document.getElementById(mainAreaID);
	//alert(document.body.clientHeight);

		if (window.innerHeight)	//¦pªG¬Ofirefox
		{
			if (parseInt(document.height) >= parseInt(window.innerHeight))
				obj.style.height = 'auto';
			else
				obj.style.height = parseInt(self.innerHeight) -228 + "px";
		}
		else if (document.all) //else if browser supports document.all (IE 4+)
		{
			if (parseInt(document.body.scrollHeight) >= parseInt(document.body.clientHeight))
				obj.style.height = '700px';
			else
				obj.style.height = parseInt(document.body.clientHeight) + "px";
//			alert(document.body.clientHeight); 
		}
//		alert(obj.style.height);
};