function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent)
		while (1) {
			curleft += obj.offsetLeft;
			if (!obj.offsetParent)
				break;
			obj = obj.offsetParent
		}
	else if (obj.x)
		curleft += obj.x;
	return curleft
}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent)
		while (1) {
			curtop += obj.offsetTop;
			if (!obj.offsetParent)
				break;
			obj = obj.offsetParent
		}
	else if (obj.y)
		curtop += obj.y;
	return curtop
}
function djcms_popup(url, width, height) {
	window.open(url, "myWindow", "status = 0, height = " + height
			+ ", width = " + width + ", resizable = 1, scrollbars=yes")
}
function hide_form_hint() {
	hint_div = document.getElementById('hint');
	arrow_div = document.getElementById('hintpointer');
	hint_div.style.visibility = 'hidden';
	arrow_div.style.visibility = 'hidden'
}
function show_form_hint(obj, label, inputWidth) {
	if (!document.getElementById('hint')) {
		var hint_div = document.createElement('div');
		hint_div.setAttribute('id', 'hint');
		hint_div.setAttribute('class', 'hint');
		hint_div.style.position = "absolute";
		document.body.appendChild(hint_div)
	}
	if (!document.getElementById('hintpointer')) {
		var arrow_div = document.createElement('div');
		arrow_div.setAttribute('id', 'hintpointer');
		arrow_div.setAttribute('class', 'hintpointer');
		arrow_div.style.position = "absolute";
		document.body.appendChild(arrow_div);
		arrow_div = document.getElementById('hintpointer')
	}
	var posLeft = findPosX(obj) + inputWidth + 9;
	var posTop = findPosY(obj) - 3;
	hint_div = document.getElementById('hint');
	hint_div.innerHTML = label;
	hint_div.style.left = posLeft + 'px';
	hint_div.style.top = posTop + 'px';
	hint_div.style.visibility = 'visible';
	arrow_div = document.getElementById('hintpointer');
	arrow_div.style.left = (findPosX(obj) + inputWidth) + 'px';
	arrow_div.style.top = (findPosY(obj)) + 'px';
	arrow_div.style.visibility = 'visible'
}
