
// Functions for My Home-Page
// Hamid Zarrabi-Zadeh
// Dec 20, 2005


// shade the backgraound of obj
function shade(obj)
{
	obj.className = 'sidemenu_shaded_BG';
}

// restore the backgraound of obj
function unshade(obj)
{
	obj.className = 'sidemenu_BG';
}

// open an url in the current window
function openwin(url)
{
	window.open(url, '_self');
	return false;
}

// compute the height of the window
function findPageHeight()
{
	var myHeight = 0;
	if (typeof( window.innerWidth ) == 'number') //Non-IE
		myHeight = window.innerHeight;
	else if	(document.documentElement && ( document.documentElement.clientWidth ||
			 document.documentElement.clientHeight)) //IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	else if (document.body && ( document.body.clientWidth || document.body.clientHeight)) //IE 4 compatible
		myHeight = document.body.clientHeight;
	return myHeight;
}

// make external links open in a new window
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";
	}
}

// initializing the page
function initPage()
{
	if (document.getElementById)
	{
		var obj = document.getElementById('full-height');
		obj.height = findPageHeight()- 85;
	}
	externalLinks();
}



