// Created by: Billy Saelim

// show/hide an item
function toggle(str)
{
	var obj = document.getElementById(str);

	if (obj.style.display == "none")
		obj.style.display = "block";
	else
		obj.style.display = "none";
}

// resizes Iframe according to content
function resizeIframe(obj) { 

	var docHeight;

	if (navigator.appName=="Netscape") 
		docHeight = infoFrame.document.documentElement.scrollHeight;
	else
		docHeight = infoFrame.document.body.scrollHeight;

	docHeight = docHeight + 20;	// adjustment

 	obj.style.height = docHeight + 'px';
} 

// highlight the menu item
function highlightMenuItem(str) {

	var obj, objs;

	// highlight the selected item
	obj = document.getElementById(str);
	obj.style.background = "#FEFBFA";
}

// unhighlight the menu item
function unHighlightMenuItem(str) {

        var obj, objs;

        // unhighlight the selected item
        obj = document.getElementById(str);
	if 	(((navigator.userAgent.indexOf("Mozilla")>=0) && 
		(obj.style.background == "rgb(254, 251, 250) none repeat scroll 0% 0%")) ||
		((navigator.userAgent.indexOf("MSIE")>=0) && 
		(obj.style.background == "#fefbfa"))) 
		obj.style.background = "#F7EBE7";
}

// select the menu item
function selectMenuItem(str, url, target) {

        var obj, objs;

        // unhighlight all menu items
        objs = document.getElementsByTagName("h1");
        for (var i=0; i < objs.length; i++) {
            obj = objs.item(i);
            if (obj.id.match(/^menu-/))
                obj.style.background = "#F7EBE7";
        }

        // highlight the selected item
        obj = document.getElementById(str);
        obj.style.background = "#E3EEF9";

	// open the url in the target frame
	window.open(url, target);
}
