//<![CDATA[

/**
 * JavaScript Functions
 * __________________________________________________________________
 *
 * @date		19.08.2005
 * @modified	15.09.2005
 * @version		1.0
 * @author		Roland Schaer
 */

String.prototype.trim = function(){
	return this.replace(/^\s*|\s*$/g,"");
}
String.prototype.ltrim = function(){
	return this.replace(/^\s*/g,"");
}
String.prototype.rtrim = function(){
	return this.replace(/\s*$/g,"");
}

Email = function(){};
/**
 * Checks if Email is valid
 *
 * @param Input element (i.e. this.parentNode.email)
 */
Email.isValid = function(obj){
	var proto  = "(mailto:)?";
	var usr    = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";
	var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";
	var regex  = "^" + proto + "?" + usr + "\@" + domain + "$";
	var rgx    = new RegExp(regex);
	return rgx.exec(obj.value) ? true : false;
};


function openWindow(theURL,winName,features) { //v2.0
	fenster = window.open(theURL,winName,features);
}

//]]>