/**
			*  Created by Christoforos J. Korifidis
			*  Date Created  2008 January 09
			*  Usefull String functions
			*  v1.0
			*
			**/
			
			
		function trim(stringToStrip){
			return rtrim(ltrim(stringToStrip));
		}

		function ltrim(stringToStrip){
			var leftPosition=0;
			while(leftPosition < stringToStrip.length && stringToStrip[leftPosition] == ' '){	
				leftPosition++; 
			}
			return stringToStrip.substring(leftPosition, stringToStrip.length);
		}

		function rtrim(stringToStrip){
			var rightPosition=stringToStrip.length -1;
			while(rightPosition > 0 && stringToStrip[rightPosition] == ' '){	
				rightPosition -=1;	
			}
			return stringToStrip.substring(0, rightPosition + 1);
		}
			
			
		function getQueryStringValue(queryValue){
			var pattern = "[\\?|&]" +queryValue+"=\\w*"
			var re = new RegExp(pattern);
			re.ignoreCase = true;
			if(re.test(window.location)) return ((re.exec(window.location)+"").split("=")[1]);
		 	return "";
		}

		
			
		
			
				
			/**
			* Created by Christoforos J. Korifidis 
			* Date Created 2008 March 15
			* convenient functions for ajax request without the need of  specifiec library
			*  v 1.1
			* to do : synchronous call with get 
			**/
			
			
			
			
			//function AjaxCalls(){
				
				var concurCall = new Array();
				
				
				function makeAjaxPostCallAsync(url,params,handlerFunction){
					makeAjaxPostCall(url,params,true,handlerFunction);
				}
				
				function makeAjaxPostCall(url,params,isAsynchronous,handlerFunction){
					if(isAsynchronous != true) isAsynchronous = false;
					makeAjaxCall(url,params,true,isAsynchronous,handlerFunction);
				}
				
				function makeAjaxGetCallAsync(url,params,handlerFunction){
					makeAjaxGetCall(url,params,true,handlerFunction);
				}
				
				function makeAjaxGetCall(url,params,isAsynchronous,handlerFunction){
					if(isAsynchronous != true) isAsynchronous = false;
					makeAjaxCall(url,params,false,isAsynchronous,handlerFunction);
					
				}
				
				function makeAjaxCall(url,params,callIsPost,isAsynchronous,handlerFunction){
					//alert(isAsynchronous);
					var http = getXMLHTTPObject();
					var callIndex = concurCall.length;
					concurCall[callIndex] = http;
					concurCall[callIndex].onreadystatechange = function(){
						if(concurCall[callIndex].readyState == 4){
							eval(handlerFunction)(concurCall[callIndex]);
						}
					};
								
					if (callIsPost){
						concurCall[callIndex].open("POST",url,isAsynchronous);
						concurCall[callIndex].setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
						concurCall[callIndex].setRequestHeader("Content-length", params.length);  
						concurCall[callIndex].setRequestHeader("Connection", "close");
						concurCall[callIndex].send(params);
					}else{
						concurCall[callIndex].open("GET",url + "?" + params,isAsynchronous);
						concurCall[callIndex].send(null);
					}
				};
				
				
				function getXMLHTTPObject() {
					var req;
					try {
						req = new XMLHttpRequest();
					} catch(err1) {
						try {
							req = new ActiveXObject("Msxml2.XMLHTTP");
						} catch (err2) {
								try {
									req = new ActiveXObject("Microsoft.XMLHTTP");
								} catch (err3) {
									req = null;
								} 
							} 
					}
					return req;
				}
								
				function handleResponse(httpRequest){
					
				}
				
				
				
			
			//}

/**
 function getXPosition(elm){
	var posX;
    if(elm.pageX){
  		posX = elm.pageX;
  	}else{
  		posX = elm.clientX;
  	}
	return posX; 	
}


function getYPosition(elm){
	var posY;
	if(elm.pageY){
  		posY = elm.pageY;
 	}else{
  		posY = elm.clientY;
 	}
	return posY;
}
**/