function showSheet(content)
{
	var sheet = document.getElementById('sheet');
	var sheetContent = document.getElementById('sheetContent');
	sheetContent.innerHTML = content;
	sheet.style.visibility = 'visible';
	return false;
}

function toggleVisibility(whichForm, setVisible)
{
	var newstate="none"
	if(setVisible == true) 
		newstate = ""

	//alert("element " + whichForm + " toggled to " + setVisible);
	
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichForm).style;
		style2.display = newstate;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichForm].style;
		style2.display = newstate;
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichForm].style;
		style2.display = newstate;
	}
}
	

function setInnerHTML(div_id, value)
{
	var dstDiv = document.getElementById(div_id);
	dstDiv.innerHTML = value;
}

function openPopup(url, name, height, width)
{
	newwindow=window.open(url, name,'height='+height+',width='+width);
	if (window.focus) {newwindow.focus()}
	return false;
}




function openDiv (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "inline";
	}
}
function closeDiv (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "none";
	}
}

function showInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "inline";
	}
}
function hideInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "none";
	}
}


function blurElement (elName) {
	var theElement = document.getElementById(elName);
	if (theElement) {
		theElement.blur();
	}
}

function selectLink (elName) {
	var theElement = document.getElementById(elName);
	if (theElement) {
		theElement.className = "selectedNavLink";
	}
}
function unSelectLink (elName) {
	var theElement = document.getElementById(elName);
	if (theElement) {
		theElement.className = "unSelectedNavLink";
	}
}


function toggleDisplay(divName){
	tempDiv = document.getElementById(divName);
	if (!tempDiv) {
		return;
	}  
	 if (tempDiv.style.display=="block"){
	 	tempDiv.style.display="none";
	 }
	 else {	
	 	if (tempDiv.style.display=="none"){
			tempDiv.style.display="block";
		}
	 }
}

function hideDiv(divName){
	tempDiv = document.getElementById(divName);
	if (!tempDiv) {
		return;
	}
	if (tempDiv.style.display=="block"){
	     tempDiv.style.display="none";
	}
}

function showDiv(divName){
	tempDiv = document.getElementById(divName);
	if (!tempDiv) {
	  return;
	}
	if (tempDiv.style.display=="none"){
		tempDiv.style.display="block";
	}
}

function call(form, field) {
	var elements = form.elements;
	var flag = form.checkAll.checked;
	for(var index = elements.length; --index >=0; ) {
		var element = elements[index];
		if(element.type == 'checkbox' && element.name == field) {
			element.checked = flag;
		}
	}
}

function changeListStyle(id, element) {
	var root = document.getElementById(id);
	
	var elements = root.getElementsByTagName("li");
	for(var index = elements.length; --index >=0; ) {
		var e = elements[index];
		if(e.className == "tab_current") {
			e.className = "tab";	
		}
	}
	element.className = "tab_current";
}


function changeTabbedStyle(id, element) {
	var root = document.getElementById(id);
	var elements = root.getElementsByTagName("td");
	for(var index = elements.length; --index >=0; ) {
		var e = elements[index];
		if(e.className == "tab_current") {
			e.className = "tab";	
		}
	}
	element.className = "tab_current";
}