//keeping all objects inside one class emulates namespaces, which prevents name collisions.

//helper class
helper={
	//cross-browser ataching events to elements method
	addLoadEvent:function(func){
		var oldOnLoad = window.onload;
		if(typeof window.onload != 'function')
		{
			window.onload = func;
		}
		else
		{
			window.onload = function(){
				oldOnLoad();
				func();
			}
		}
	},
	addEvent:function(elm, evType, fn, useCapture){
		if (elm.addEventListener)
		{
			elm.addEventListener(evType, fn, useCapture);
			return true;
		} 
		else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		} else {
			elm['on' + evType] = fn;
		}
	},
	cancelClick:function(e){
		if (window.event){
			window.event.cancelBubble = true;
			window.event.returnValue = false;
			return;
		}
		if (e){
			e.stopPropagation();
			e.preventDefault();
		}
	},
	getTarget:function(e){
		//var target = window.event ? window.event.srcElement : e ? e.target : null;
		var target = window.event ? window.event.srcElement : e ? e.target : null;
		if (!target){return false;}
		//if (target.nodeName.toLowerCase() != 'a'){target = target.parentNode;}
		return target;
	},
	checkEmail:function(eMailer){
		 var check=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		 if (check.test(eMailer)) {
			 return true;
		 } else {
			 return false;
		 }
	}
}