	function $(id) { return document.getElementById(id); }

	function set_form_action_and_id (action, id) {
		document.getElementById("form_action").value = action;
		document.getElementById("form_action_id").value = id;
	}

	function set_form_action (action) {
		document.getElementById("form_action").value = action;
	}
	
	function submit_form ( form_name, action ) {
		if ( typeof ( action ) != 'undefined' ) { $(form_name).action = action; }
		$(form_name).submit();
	}

	function findOption ( col, value ) {
	
		found = -1;
	
		for ( loop = 0; loop < col.length; loop ++ ) {
			if (col[loop].value == value) {
				found = loop;
				break;
			}
		}
		
		return found;
	
	}

	function is_selected ( oDiv ) {
		return (oDiv.className.indexOf("selected") >= 0);
	}

	function mouse_over ( oDiv ) {
		if ( !is_selected ( oDiv ) ) {
			oDiv.style.backgroundColor = "#bfe";
			oDiv.style.color = "#5a5a5a"
		}
	}
	
	function mouse_out ( oDiv ) {
		oDiv.style.backgroundColor = "";
		oDiv.style.color = "";
	}
		
	function ClickButtonOnEnterKey(event, btnToClick)
	{ 	
		NS4 = (document.layers) ? true : false;
		var code = 0;
		
		if (NS4) {
			code = event.which;
		} else {
			code = event.keyCode;
		}
		if (code==13) { // enter key

		// execute the click event of bthToClick
			document.getElementById(btnToClick).click();
			// set focus back to the calling element.
			
			event.returnValue=false;
			event.cancel = true;
		}
		
	}
	
	function Trim(TRIM_VALUE){
	if(TRIM_VALUE.length < 1){
	return"";
	}
	TRIM_VALUE = RTrim(TRIM_VALUE);
	TRIM_VALUE = LTrim(TRIM_VALUE);
	if(TRIM_VALUE==""){
	return "";
	}
	else{
	return TRIM_VALUE;
	}
	} //End Function
	
	function RTrim(VALUE){
	var w_space = String.fromCharCode(32);
	var v_length = VALUE.length;
	var strTemp = "";
	if(v_length < 0){
	return"";
	}
	var iTemp = v_length -1;
	
	while(iTemp > -1){
	if(VALUE.charAt(iTemp) == w_space){
	}
	else{
	strTemp = VALUE.substring(0,iTemp +1);
	break;
	}
	iTemp = iTemp-1;
	
	} //End While
	return strTemp;
	
	} //End Function
	
	function LTrim(VALUE){
	var w_space = String.fromCharCode(32);
	if(v_length < 1){
	return"";
	}
	var v_length = VALUE.length;
	var strTemp = "";
	
	var iTemp = 0;
	
	while(iTemp < v_length){
	if(VALUE.charAt(iTemp) == w_space){
	}
	else{
	strTemp = VALUE.substring(iTemp,v_length);
	break;
	}
	iTemp = iTemp + 1;
	} //End While
	return strTemp;
	} //End Function
	
	function node_clicked(baseId) {
		$(baseId).className=(($(baseId).className=='expanded')?'collapsed':'expanded');
		$(baseId + '_img').className=(($(baseId + '_img').className=='expanded_img')?'collasped_img':'expanded_img');
	}


