
function openpopup(u, h, w) {
	if (h == 'undefined') h = 600;
	if (w == 'undefined') w = 600;

	var l = 'no';
	var s = ',menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no';

	var cH = (screen.height / 2) - (h / 2);
	var cW = (screen.width / 2) - (w / 2);

	window.open(u, "","height="+h+",width="+w+",top="+cH+",left="+cW+",location="+l+s);

	return false;
}

function toogle(id, class_name, e, delta_x, delta_y) {
	var el = document.getElementById(id);

	if (el != null) {
		if (el.className == class_name){
			el.className = '';
		} else {
			el.className = class_name;
		}

		if (typeof(e) != 'undefined') {
			if (e.x && e.y && typeof(delta_x) != 'undefined') {
				el.style.top = (e.clientY + document.body.scrollTop - delta_y) + 'px';
				el.style.left = (e.x - delta_x) + 'px';
			}

			if (e.pageX && e.pageY) {
				el.style.top = (e.pageY - delta_y) + 'px';
				el.style.left = (e.pageX -delta_x) + 'px';
			}
		}
	}
}
