function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function resetBackground(el){
	el.style.background = "#ffffff";
}

function highlightAndFocus(el){
	el.focus();
	el.select();
	el.style.background = '#ffaaaa';
	el.onblur = new Function("resetBackground(this)");
}

function checkAll(aBox, prefix) {
	
	var boxName = 0;
	
	if(!prefix || prefix == '')
		prefix = 'box';

	while(true){
		if(document.getElementById(prefix + boxName) != null){
			document.getElementById(prefix + boxName).checked = aBox.checked;
		}
		else{
			break;
		}
		boxName++;
	}
}

function setHint(hint){
	if(document.getElementById('hint'))
		document.getElementById('hint').innerHTML = hint;
}
