function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) 
{
	return LTrim(RTrim(value));
}

function LCase(STRING)
{
	return STRING.toLowerCase();
}

function Right(STRING,CHARACTER_COUNT)
{
 return STRING.substring((STRING.length - CHARACTER_COUNT),STRING.length);
}

function convert_amp(STRING)
{
	if(STRING.indexOf('&') != -1)
	{
		arr_str = STRING.split('&');
		STRING= arr_str.join('!and!');
	}
	return STRING;
}	

// function used for searching type of browsers and according to dispaly hand on links
function change_cursor(obj)
 {			
 	brow=get_browser_type();
 	//alert (brow);
 			if (brow == "ie")
			{
				obj.style.cursor='hand';
			} 
			else if  (brow=="opera")
			{
			   obj.style.cursor='hand';
			   
			}
			else if (brow=="mozilla")
			{	
			   //obj.style.cursor='-moz-grab';
			   obj.style.cursor='pointer';
			   // JavaScript here for IE 4 and later
			}
			else if (brow=="netscape")
			{
				obj.style.cursor='pointer';
			   // JavaScript here for Nav3 and Opera 
			}
			else 
			{	
				obj.style.cursor='hand';
				
			   // JavaScript here for Nav2 and IE 3 
			}
 }

function get_browser_type()
{
	 var agt=navigator.userAgent.toLowerCase();
	 var is_major = parseInt(navigator.appVersion);
     var is_minor = parseFloat(navigator.appVersion);
     var br_type=""; 	 
     
   if  ( agt.indexOf("msie") != -1 ) 
   		br_type= "ie";
  else if ( (agt.indexOf(";nav") != -1) ||(agt.indexOf("; nav") != -1))
        br_type= "netscape";
  else if (agt.indexOf('mozilla')!=-1 ) 
  		br_type= "mozilla";
  else if (agt.indexOf("opera") != -1) 
  		br_type="opera";
  else if (agt.indexOf("aol") != -1) 
  	br_type="aol";
  	
  	return br_type;
	
}
