	var getPos = function(owner){
		if(owner == undefined){
			return {top : 0, left:0 , width : 0, height : 0};
		}
		var e = owner;
		var oTop = e.offsetTop;
		var oLeft = e.offsetLeft;
		var oWidth = e.offsetWidth;
		var oHeight = e.offsetHeight;

		while(e = e.offsetParent)
		{
			oTop += e.offsetTop;
			oLeft += e.offsetLeft;
		}

		return {top:oTop, left:oLeft, width:oWidth, height:oHeight}
	}

	function notEmpty(myElem){
		if(myElem.value.length == 0){
			return false;
		}
		return true;
	}
	function emailValidator(myElem){
		var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		if(myElem.value.match(emailExp)){
			return true;
		}else{
			return false;
		}
	}
	function isNumeric(myElem){
		var numericExpression = /^[0-9]+$/;
		if(myElem.value.match(numericExpression)){
			return true;
		}else{
			return false;
		}
	}

	function isPhone(myElem){
		var alphaExp = /^[0-9]+$/;
		if(myElem.value.match(alphaExp)){
			return true;
		}else{
			return false;
		}
	}

  function valFormElem(myElem)
	{
		if(myElem.getAttribute('checkType') == "length")
		{
			return !notEmpty(myElem);
		}
		if(myElem.getAttribute('checkType') == "email")
		{
			return !emailValidator(myElem);
		}
		if(myElem.getAttribute('checkType') == "number")
		{
			return !isNumeric(myElem);
		}
		if(myElem.getAttribute('checkType') == "phone")
		{
			return !notEmpty(myElem);
		}
	}
