function Html() {
}

Html.set = function(id, val) {
	document.getElementById(id).value = val;
};

Html.get = function(id) {
	return document.getElementById(id);
};

Html.submit = function(id) {
	document.getElementById(id).submit();
};

Html.popup = function(url) {

	newwindow=window.open(url,'name','height=768,width=1024');
	
	if (window.focus) {
		newwindow.focus()
	}
	return false;

};

Html.toogleVisibility = function(id) {
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
	}
};

Html.toogleVisibilityPos = function(id, e) {
	
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.top = posy + 'px';
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
	}
};

function doSomething(e) {
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	// posx and posy contain the mouse position relative to the document
	// Do something with this information
}



Html.value = function(id) {
	return document.getElementById(id).value;
};