function watch_quicklink(_event, _object)
{
	if (_object.value != '')
	{
		window.location.href = _object.value;
	}
}

function open_print(_url)
{
	var print_window = window.open(_url+'?print=true', "Printview", "width=550,height=400,left=100,top=200,menubar=yes,scrollbars=Yes,toolbar=yes");
	print_window.focus();
}

var close_timer = null;
var current_menu = null;

function get_absolute_offset_top(object)
{
	/*
	if (object.getBoundingClientRect)
	{
		return object.getBoundingClientRect().top - 3;
	}
	*/
	var result = 0;
	
	//alert(object.parentNode.tagName);
	
	while (object.parentNode.tagName != 'BODY')
	{
		if (object.tagName != 'TBODY' && object.tagName != 'TR' && object.tagName != 'LI' && object.tagName != 'UL' && object.tagName != 'TABLE')
		{
			//alert(object.parentNode.tagName);
			//alert(parseInt(object.offsetTop));
			//alert(object.tagName+':'+parseInt(object.offsetTop));
			result += parseInt(object.offsetTop);
		}

		object = object.parentNode;
	}
	
	return result;
}

function get_absolute_offset_left(object)
{
	/*
	if (object.getBoundingClientRect)
	{
		return object.getBoundingClientRect().left - 3;
	}
*/
	if (object.getBoundingClientRect)
		var result = 1;
	else
		var result = 0;

	
	//alert(object.parentNode.tagName);
	
	while (object.parentNode.tagName != 'BODY')
	{
		if (object.tagName != 'TBODY' && object.tagName != 'TR' && object.tagName != 'TABLE' && object.tagName != 'UL')
		{
			//alert(object.tagName+':'+parseInt(object.offsetTop));
			result += parseInt(object.offsetLeft);
		}
		object = object.parentNode;
	}
	
	return result;
}

function show_menu(_event, _object)
{
	close_current_menu()
	
	if (current_menu != null)
	{
		current_menu.style.display = 'none';
	}
	
	var submenu = _object.getElementsByTagName('UL');
	submenu[0].style.display = 'block';
	submenu[0].style.position = 'absolute';
	submenu[0].style.top = get_absolute_offset_top(_object) + 25 + 'px';	
	submenu[0].style.left = get_absolute_offset_left(_object) + -11 + 'px';	
	
	submenu[0].offsetWidth;
	submenu[0].offsetHeight;
	
	current_menu = submenu[0];
}

function close_current_menu()
{
	stop_timer(null, null);
	
	if (current_menu != null)
	{
		current_menu.style.display = 'none';	
	}	
}

function start_timer(_event, _object)
{
	if (close_timer == null)
	{
		close_timer = window.setInterval('close_current_menu()', 250);
	}
}

function stop_timer(_event, _object)
{
	if (close_timer != null)
	{
		window.clearInterval(close_timer);
		close_timer = null;
	}
}

function reload_register_form(_event, _object)
{
	document.forms.register.submit();
}
