// JavaScript Document

function trimWhiteSpace(string) 
		{
			var newString  = '';
			var substring  = '';
			beginningFound = false;
 
			// copy characters over to a new string
			// retain whitespace characters if they are between other characters
			for (var i = 0; i < string.length; i++)
				{
 
				// copy non-whitespace characters
					if (string.charAt(i) != ' ' && string.charCodeAt(i) != 9)
						{
 
					// if the temporary string contains some whitespace characters, copy them first
							if (substring != '') 
								{
									newString += substring;
									substring = '';
								}
							newString += string.charAt(i);
							if (beginningFound == false) beginningFound = true;
						}
 
		// hold whitespace characters in a temporary string if they follow a non-whitespace character
						else if (beginningFound == true) substring += string.charAt(i);
			}
		return newString;
	}
	
	
	function checkBranchCode()
		{
			
			var str=trimWhiteSpace(document.BranchDetail.txtBranchCode.value);
			
			if (str=="")
			
				{
					alert ("Branch Code is Mandatory");
					return false;
				}
			else
				{
					return true;
				}
				
		}
	


