String.prototype.trim=function String_trim() { return this.replace(/^ +| +$/g,''); }

function isValidInput(value) { 
	return (value.indexOf(String.fromCharCode(160)) == -1 && value.indexOf("\\") == -1) 
}

function checkEmail(email) {
	//return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(email));
	return (/^[_\.0-9a-zA-Z-]+\@([0-9a-zA-Z-]+\.)+[a-zA-Z]{2,4}$/.test(email));
}

function isIEBrowser() {
	var sAgent = navigator.userAgent.toLowerCase() ;
	return ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
}

function checkTelefoonnummer(strNummer) {
	strNummer = strNummer.replace(/\s/g, "");
	strNummer = strNummer.replace(/\+/g, "");
	strNummer = strNummer.replace(/\-/g, "");
	strNummer = strNummer.replace(/\(/g, "");
	strNummer = strNummer.replace(/\)/g, "");
		
	return (/^[0-9]{10}$/.test(strNummer));
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
