
    function showHideElementsArray(e) {

	for(x in formIdsToShowHide[e]) {
	    showHideElementById(formIdsToShowHide[e][x]);
	}

    }

    function showHideElementById(e) {

	var sectionid = document.getElementById(e);

	if(sectionid.style.display == '') {
	    sectionid.style.display='none';
	} else {
	    sectionid.style.display='';
	}

    }

    function showElementById(e) {

	var sectionid = document.getElementById(e);
	sectionid.style.display='';

    }

    function hideElementById(e) {

	var sectionid = document.getElementById(e);
	sectionid.style.display='none';

    }

    function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
    }

    function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
    }

    function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
    }

    function in_array(needle, haystack) {

	var length = haystack.length;

	for(var i = 0; i < length; i++) {
	    if(trim(haystack[i].toLowerCase()) == trim(needle.toLowerCase())) {
		return true;
	    }
	}

	return false;

    }


