var int_delay_hide = 300;

/* Initiates the hidemenu timer to "exploded" (and hide the menu) after disapperdelay milliseconds
 */
function delay_hide(str_obj)
{
	if (ie4 || ns6) {
		clear_hide();
		tmr_hide = setTimeout("hide('" + str_obj + "')", int_delay_hide);
//		$('content').innerHTML += '<font color="red">started</font>, ';
	}
}

function dynamic_hide(str_obj, e)
{
	// Did the mouse coursor leave the required object?
	if ( (dom = $(str_obj)) && bln_mouseout(dom, e)) {
//		$('content').innerHTML += 'shall start, ';
		delay_hide(str_obj);
	}
}

/*
 * We're going to display a new menu. Interrupt the delayed hide of previous menu
 * if a timer has been started
 */
function clear_hide()
{
	if (typeof(tmr_hide) != 'undefined') {
		clearTimeout(tmr_hide);
//		$('content').innerHTML += '<font color="green">stopped</font>, ';
	}/* else {
//		$('content').innerHTML += 'didnt stop, ';
	}*/
}

/*
 * Hides the menu (called by the timer started in delayhidemenu)
 */
function hide(str_obj)
{
	if ( (dom = $(str_obj)) && (ie4 || ns6)) {
		dom.style.display = 'none';
//		dom.style.visibility = "hidden";
//		$('content').innerHTML += 'completed, ';
	}
}

function show(str_obj, e)
{
	dom = $(str_obj);

	if (window.event) {
		event.cancelBubble = true;
	} else if (e.stopPropagation) {
		e.stopPropagation();
	}

	clear_hide();

	if ((e.type == 'click') && (dom.style.display == 'none') || (e.type == 'mouseover')) {
		dom.style.display = 'block';
//		dom.style.visibility = "visible";
	} else if (e.type == 'click') {
		dom.style.display = 'none';
//		dom.style.visibility = "hidden";
	}
}

function check(str_prefix, bln_check)
{
	arr_boxes = document.getElementsByTagName('input');

//	alert(arr_boxes[i].name);
	for (i = 0; i < arr_boxes.length; i++)
		if (arr_boxes[i].name.match(str_prefix)) {
//			alert(arr_boxes[i].name);
			arr_boxes[i].checked = bln_check;
		}
}

function show_hide(str_obj)
{
	if ( (dom = $(str_obj))) {
		// Object is hidden, show it
		if (dom.style.display == 'none') {
			dom.style.display = 'block';
		// Object is visible, hide it
		} else {
			dom.style.display = 'none';
		}
	}
}

function swap(str_show, str_hide)
{
	// Hide 'str_hide'
	if ( (dom_hide = $(str_hide))) {
		dom_hide.style.display = 'none';
	}

	// Show 'str_show'
	if ( (dom_show = $(str_show))) {
		dom_show.style.display = 'block';
	}
}

function display(str_dom, str_display)
{
	// Set display style to 'str_dom'
	if ( (dom = $(str_dom))) {
		dom.style.display = str_display;
	}

	return false;
}

