//=========================================================================
//=== BEGIN: TRIM WHITE SPACES FROM PARSED STRING						===
//=== ----------------------------------------------------------------- ===
//=== trimSpaces(targetString)											===
//=== this will trim all white spaces from the left and the right		===
//=== of the parsed string and returns the trimmed string				===
//===																	===
//=== -- EXAMPLE ------------------------------------------------------ ===
//=== trimSpaces('    this is my text    ') = 'this is my text'			===
//=========================================================================
	function trimSpaces(targetString)
	{
	    var trimmedString   = "" ;
	    var startPosCounter = "" ;
	    var endPosCounter 	= "" ;
		var currentChar     = "" ;
	    var startPos 	    = 0  ;
	    var endPos  	    = 0  ;
		
	    if (targetString!="")
	    {
			//start from the beginning of the parsed string and find the first non " " character
			//then set this character position to be the startPos of the new trimmed string
	        for (startPosCounter=0;startPosCounter<=targetString.length-1;startPosCounter++)
	        {
	            currentChar = targetString.charAt(startPosCounter)
	            
	            if (currentChar!=" ")
	            {
	                startPos = startPosCounter ;
	                break ;
	            }
	        }
	        
			//start from the end of the parsed string and find the first non " " character
			//then set this character position to be the endPos of the new trimmed string
	        for (endPosCounter=targetString.length-1;endPosCounter>=0;endPosCounter--)
	        {
	            currentChar = targetString.charAt(endPosCounter)
	            
	            if (currentChar!=" ")
	            {
	                endPos = endPosCounter + 1 ;
	                break ;
	            }
	        }
	        
	        trimmedString = targetString.substring(startPos,endPos) ;
	        return trimmedString ;
	    }
	    else
	    {
			return targetString
		}
	}
//=========================================================================
//=== END: TRIM WHITE SPACES FROM PARSED STRING							===
//=========================================================================