function getKeyCode(e) 
{
	var key = (window.event) ? event.keyCode : e.which;   
	if (window.event) key = event.keyCode   
	else key = e.which   // Was key that was pressed a numeric character (0-9) , backspace (8), or tab (9)?  
	return key;
}
function CheckNumeric(e) 
{   
	var key = getKeyCode(e);
	if ( key > 32 && key < 58 || key > 90 && key < 106 || key == 8 || key == 9 || key == 17 || key == 18 ) return; // if so, do nothing   
	else {
		if (window.event) //IE       
			window.event.returnValue = null;     
	else //Firefox       
		e.preventDefault(); 
	}
}
/* create new window and center on screen*/
function newwin(lnk,w,h) {
	leftPos = 0
	topPos = 0
	if (screen) {
		leftPos = (screen.width / 2) - (w/2)
		topPos = (screen.height / 2) - (h/2)
	}
	ElementWindow = window.open(lnk,'New','width='+w+',height='+h+',left='+leftPos+',top='+topPos+',toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=yes,status=yes');
}


// ID elements must be separated by spaces.
// example: showHide(form_box title_box, content_box header_box footer_box);
function showHide(id_string_show,id_string_hide)
{
	id_array_show=id_string_show.split(" ");
	id_array_hide=id_string_hide.split(" ");

	//loop through ids you want to show
	if (id_array_show != "") {
		for(var i=0; i <id_array_show.length; i++) {
			id_box = document.getElementById(id_array_show[i]);
			if (id_box) {
				id_box.style.display="";
			}
		}
	}
	//loop through ids you want to hide
	if (id_array_hide != "") {
		for(var i=0; i <id_array_hide.length; i++) {
			id_box = document.getElementById(id_array_hide[i]);
			if (id_box) {
				id_box.style.display="none";
			}
		}
	}
}