menu_status = new Array();

function showHide(submenuid, menuid) {
	if (document.getElementById) {
		var switch_id = document.getElementById(submenuid);
		var menu_id = document.getElementById(menuid);
		
		if(menu_status[submenuid] != 'show') {
			switch_id.className = 'show';
			menu_status[submenuid] = 'show';
			menu_id.className = 'submenu-active';
			menu_id.blur();
		} else {
			switch_id.className = 'hide';
			menu_status[submenuid] = 'hide';
			menu_id.className = 'submenu';
			menu_id.blur();
		}
	}
}

function highlight(menuid) {
	if (document.getElementById) {
		var menu_id = document.getElementById(menuid);
		
		menu_id.className = 'menu-active';
	}
}

function dehighlight(menuid) {
	if (document.getElementById) {
		var menu_id = document.getElementById(menuid);
		
		menu_id.className = 'menu';
	}
}

function highlighttb(menuid) {
	if (document.getElementById) {
		var menu_id = document.getElementById(menuid);
		menu_id.className = 'head-bottom-link-active';
	}
}


function hideButton(button1, button2, checkbox) {
	if (document.getElementById) {	
		var button1_id = document.getElementById(button1);
		var button2_id = document.getElementById(button2);		
		var checkbox_id = document.getElementById(checkbox);		
		
		if(checkbox_id.checked) {
			button1_id.style.visibility="visible";
			button2_id.style.visibility="visible";			
		} else {
			button1_id.style.visibility="hidden";
			button2_id.style.visibility="hidden";			
		}
	}
}

function hideButton2(button1, button2, button3, checkbox) {
	if (document.getElementById) {	
		var button1_id = document.getElementById(button1);
		var button2_id = document.getElementById(button2);		
		var button3_id = document.getElementById(button3);				
		var checkbox_id = document.getElementById(checkbox);		
		
		if(checkbox_id.checked) {
			button1_id.style.visibility="visible";
			button2_id.style.visibility="visible";			
			button3_id.style.visibility="visible";						
		} else {
			button1_id.style.visibility="hidden";
			button2_id.style.visibility="hidden";			
			button3_id.style.visibility="hidden";						
		}
	}
}

  function printWindow() {
     version = parseInt(navigator.appVersion);
     if (version >= 4) window.print();
  }

function printText(txt) {
	version = parseInt(navigator.appVersion);
	if (version >= 4) {
		popup = window.open('','popup','toolbar=no,menubar=no,width=200,height=150');
		popup.document.open();
		popup.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
		popup.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
		popup.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
		popup.document.write('<script lang="javascript" type="text/javascript">');
		popup.document.write('function clearFlows() {');
		popup.document.write('elements = document.getElementsByTagName("*");');
		popup.document.write('for(i=0; i<elements.length; i++) if (elements[i].style.overflow && elements[i].style.overflow != "visible") {');
		popup.document.write('elements[i].style.height = "auto";');
		popup.document.write('elements[i].style.width = "auto";');
		popup.document.write('elements[i].style.overflow = "visible";');
		popup.document.write('}');
		popup.document.write('}');
		popup.document.write('<'+'/script><link href="inc/styles.css" rel="stylesheet" type="text/css" />');
		popup.document.write('</head><body onload="clearFlows(); print(); close();">');
		popup.document.write(txt);
		popup.document.write("</body></html>");
		popup.document.close();
	}
}

function printElem(id) {
	elem = document.getElementById(id);
	printText(elem.innerHTML);
}
