function getAbsoluteLeft(o) {
	oLeft = o.offsetLeft            // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent    // Get parent object reference
		oLeft += oParent.offsetLeft // Add parent left position
		o = oParent
	}
	// Return left postion
	return oLeft
}

function getAbsoluteTop(o) {
	oTop = o.offsetTop            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent  // Get parent object reference
		oTop += oParent.offsetTop // Add parent top position
		o = oParent
	}
	// Return top position
	return oTop
}

function getScreenWidth() { //{{{2
	if (document.all) return(document.body.clientWidth + document.body.scrollLeft)
	else return(window.innerWidth + window.scrollX)
}
function getScreenHeight() { //{{{2
	if (document.all) return(document.body.clientHeight + document.body.scrollTop)
	else return(window.innerHeight + window.scrollY)
} 

function intValue(val){
	return parseInt(parseFloat(val));
}


function showHelp(span)
{
	if(span.DIV==null)
	{
		span.DIV = document.createElement('DIV');
		span.DIV.innerHTML = span.title.replace("\r\n","<br/><br/>");
		span.DIV.innerHTML = span.DIV.innerHTML.replace('&lt;','<');
		span.DIV.innerHTML = span.DIV.innerHTML.replace('&gt;','>');
		span.DIV.style.backgroundColor = 'White';
		span.DIV.style.border = '1px solid Gray';
		span.DIV.style.color = 'Black';
		span.DIV.style.fontSize = '0.9em';
		span.DIV.style.left = (span.offsetWidth)+5+getAbsoluteLeft(span)+'px';
		span.DIV.style.padding = '5px';
		span.DIV.style.position = 'absolute';
		span.DIV.style.top = getAbsoluteTop(span)+'px';
		span.DIV.style.width = '200px';
		span.appendChild(span.DIV);	
		span.title = '';
		span.onmouseout = function(){
			this.DIV.style.display = 'none';
		}	
	}
	span.DIV.style.display='block';
}
function validateForm(form)
{
	var inputs = form.getElementsByTagName('INPUT');
	for(i in inputs)
	{
		try{
			if(inputs[i].onchange)
			{
				var success = inputs[i].onchange();
				if(success===false)
				{
					alert(inputs[i].name);
					return false;
				}
			}
		}catch(e){
			alert(e);
		}
	}
	return true;
}