
		function openBrWindow(theURL) 
		{ 
			window.open(theURL,'newWindow','scrollbars=yes,resizable=yes,titlebar=no,width=570,height=700');
		}



function GetNext(CurrentField,NextField,NumberForNext)
{

if (CurrentField.value.length==NumberForNext)
	NextField.focus();

}
function limitText(limitField, limitCount, limitNum) {

	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.innerHTML  = limitNum - limitField.value.length;
	}
}

function MyReload() 
		{	
			window.location.reload(); 
		} 

function replaceCommas( strValue )
{
	var ogValue = document.getElementById(strValue).value;
 	var objRegExp = /,/g; //search for commas globally
 	document.getElementById(strValue).value = ogValue.replace(objRegExp,'');


	var ValidChars = "0123456789.";
	var IsNumber=true;
 	var Char;
	var sText =  document.getElementById(strValue).value;
 
  	 for (i = 0; i < sText.length && IsNumber == true; i++) 
  	    { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
         {
        	IsNumber = false;
		alert("The value you entered must be a number.");
  		document.getElementById(strValue).value="";

         }
      }

}


		// Function to 'activate' images.
		function imgOn(imgName) {

			if (document.images) {
				document[imgName].src = eval(imgName + "On.src");
			}
		}

		// Function to 'deactivate' images.
		function imgOff(imgName) {
			if (document.images) {
				document[imgName].src = eval(imgName + "Off.src");
			}	
		}

function autoTab(input,len, e) {
				var isNN = (navigator.appName.indexOf("Netscape")!=-1);
				var keyCode = (isNN) ? e.which : e.keyCode; 
				var filter = (isNN) ? [0,8,9,16,17,18] : [0,8,9,16,17,18,37,38,39,40,46];
				if(input.value.length >= len && !containsElement(filter,keyCode)) {
					input.value = input.value.slice(0, len);
					input.form[(getIndex(input)+1) % input.form.length].focus();
					//input.form[(getIndex(input)+1) % input.form.length].select();
					return input;
				}
			
				function containsElement(arr, ele) {
					var found = false, index = 0;
					while(!found && index < arr.length)
						if(arr[index] == ele)
							found = true;
						else
							index++;
							return found;
				}
				
				function getIndex(input) {
					var index = -1, i = 0, found = false;
					while (i < input.form.length && index == -1)
						if (input.form[i] == input)index = i;
							else i++;
							return index;
					}
					return true;
			}



