menu_status = new Array();
function showHide(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);
        if(menu_status[theid] != 'showlist') {
           switch_id.className = 'showlist';
           menu_status[theid] = 'showlist';
        }else{
           switch_id.className = 'hidelist';
           menu_status[theid] = 'hidelist';
        }
    }
}

function trim(str) {
	while (str.substring(0,1) == ' ')
		str = str.substring(1, str.length);
 
	while (str.substring(str.length-1, str.length) == ' ')
		str = str.substring(0,str.length-1);
 
	return str;
}
function isInteger(s){
	var i;
	if (isEmpty(s))
	if (isInteger.arguments.length == 1) 
		return 0;
	else 
		return (isInteger.arguments[1] == true);
	for (i = 0; i < s.length; i++){
		var c = s.charAt(i);
		if (!isDigit(c)) 
			return false;
	}
	return true;
}
function isString(s){
	var i;
	if (isEmpty(s))
	if (isString.arguments.length == 1) 
		return 0;
	else 
		return (isString.arguments[1] == true);
	for (i = 0; i < s.length; i++){
		var c = s.charAt(i);
		if (!isChar(c)) 
			return false;
	}
	return true;
}

function isEmpty(s){
	return ((s == null) || (s.length == 0))
}

function isDigit (c){
	return ((c >= "0") && (c <= "9") || (c == "."))
}
function isChar (c){
	return ((c >= "a") && (c <= "z") || ((c >= "A") && (c <= "Z")) || (c <= ' '))
}
function isEmail(string) {
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
		return false;
}