	//moved from rightblock_dictionary 12.12.2007 - jw!
	var CursorLast = null;

	//moved from rightblock_notes 12.12.2007 - jw!
	function GetKeyCode(e){
		var keynum = -1;
		if(window.event){ // IE
			keynum = e.keyCode;
		}else if(e.which){ // Netscape/Firefox/Opera
			keynum = e.which;
		}
		return keynum;
	}

	//moved from rightblock_dictionary 12.12.2007 - jw!
	function SaveMousePosition(e){		
		position = getPosition(e);
		CursorLast = position;
	}

	//01.07.2008 - jw!
	function ClearField(_obj){
		_obj.value = '';
	}

	function getEventPosition(e) {
		if (!e) var e = window.event;
//		var relTarg = e.relatedTarget || e.fromElement;
//		e = e || window.event;

		var cursor = {x:0, y:0};
		if (e.pageX || e.pageY) {
			cursor.x = e.pageX;
			cursor.y = e.pageY;
		}else{
			var de = document.documentElement;
			var b = document.body;
			cursor.x = e.clientX + 
				(de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
			cursor.y = e.clientY + 
				(de.scrollTop || b.scrollTop) - (de.clientTop || 0);
		}
		return cursor;
	}

	function getElementPosition(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];
	}	
	
	
	function Goto(_loc){
		window.location.href = _loc;
	}

	function Signup(){
		Goto('/signup');
	}

	function Login(){
		Goto('/login');
	}

	function IsEnter(e){
		var keynum = GetKeyCode(e);
		return (keynum == 13) ? true : false ;
	}

	function IsNumeric(strString) {
		var strValidChars = "0123456789.-";
		var strChar;
		var blnResult = true;
	
		if(strString.length == 0) return false;
	
	   // test strString consists of valid characters listed above
		for(i = 0; i < strString.length && blnResult == true; i++){
			strChar = strString.charAt(i);
			if(strValidChars.indexOf(strChar) == -1){
				blnResult = false;
			}
		}
		return blnResult;
	}

	function trimAll(sString){
		//alert("sSring is " + sString);
		while (sString.substring(0,1) == ' '){
			sString = sString.substring(1, sString.length);
		}
		while (sString.substring(sString.length-1, sString.length) == ' '){
			sString = sString.substring(0,sString.length-1);
		}
		return sString;
	}

	function setCookie(c_name,value,expiredays){
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	}