function showmenu(elmnt)
{
	var disp = document.getElementById(elmnt).style.display;
	if (disp == 'none' || disp == '')
	{
		document.getElementById(elmnt).style.display = 'block';
	}
	else
	{
		document.getElementById(elmnt).style.display = 'none';
	}
	sizeMenu();
}

function Over(elmnt)
{
	document.getElementById(elmnt).style.color='blue';
}

function Out(elmnt)
{
	document.getElementById(elmnt).style.color='red';
}

function thisgroup(elmnt)
{
	document.getElementById(elmnt).style.display = 'block';
	fixSize()
}

function SizeHome()
{
    var width, width_str, height;
   
    width = parseInt(document.documentElement.clientWidth)
    width_str = String(width-420)+ "px"
    document.getElementById("main_div").style.right = "210px";
    document.getElementById("main_photo").style.width = width_str;
    height = document.documentElement.clientHeight     // bottom of window
    if ((document.getElementById("main_div").offsetHeight +79) > height) // content lower than window
    {
        height = document.getElementById("main_div").offsetHeight +79
    }
    if ((document.getElementById("sub_menu").offsetHeight + 170) > height)     // menu lower than everything
    {
        height = document.getElementById("sub_menu").offsetHeight + 170
    }
    document.getElementById("main_menu").style.height =  String(height-160) + "px"; // set height allow for offset
    document.getElementById("news_menu").style.height =  String(height-80) + "px"; // set height allow for offset
    document.getElementById("main_div").style.width = String(document.documentElement.clientWidth - 420)+"px"
}

function sizeThis(photo)
{
    var width, width_str;
   
    photo = String(photo)
    width = parseInt(document.body.clientWidth)
    width_str = String(width-215)+ "px"
    document.getElementById(photo).style.width = width_str;
    fixSize();
}

function printit()
{
	window.print()
	window.close()
	//alert("Print It")
}

function sizeMenu()
{
    var height;
    
    height = document.documentElement.clientHeight     // bottom of window
    if ((document.getElementById("main_div").offsetHeight +79) > height) // content lower than window
    {
        height = document.getElementById("main_div").offsetHeight +79
    }
    if ((document.getElementById("sub_menu").offsetHeight + 170) > height)     // menu lower than everything
    {
        height = document.getElementById("sub_menu").offsetHeight + 170
    }
    document.getElementById("main_menu").style.height =  String(height-160) + "px"; // set height allow for offset
    document.getElementById("main_div").style.width = String(document.documentElement.clientWidth - 210)+"px"
}

function fixSize()
{
    sizeMenu()
    document.getElementById("main_div").style.width = String(document.documentElement.clientWidth - 210)+"px"
}

function strip(str)	
{		// remove leading and trailing spaces
	var first, last;
	
	str = String(str)
	if (str.length > 0)		// Not empty
	{
		first = 0;
		while ((first < str.length) && (str.charAt(first) == " "))		//While space
		{
			first += 1;
		}
		if (first == str.length)				// All spaces
		{
			str = ""
		}
		else
		{
			last = str.length - 1
			while (str.charAt(last) == " ")			// While space
			{
				last -= 1;
			}
			str = str.substring(first,last+1);
		}
	}
	return(str)
}
