function next_form(form_action)
{
	document.admin_form.action=form_action;
	document.admin_form.submit();
}

function isBlank(s)
{
	var len=s.length;
	var i;
	for(i=0;i<len;++i)
	{
		if(s.charAt(i)!=" ") return false;
	}
	return true;
}

function openBrWin(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function openEditorWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function echeck(str) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(at)==-1)
	{
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	{
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
	{
	   return false
	}

	 if (str.indexOf(at,(lat+1))!=-1)
	 {
	   return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
	 {
	   return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1)
	 {
	   return false
	 }
	
	 if (str.indexOf(" ")!=-1)
	 {
		return false
	 }
	 return true					
}

function check_number(obj_val)
{
	//Returns true if value is a number or is NULL
	//otherwise returns false
	
	if (obj_val.length == 0) return true;
	
	//Returns true if value is a number defined as
	//   having an optional leading +.
	//   having at most 1 decimal point.
	//   otherwise containing only the characters 0-9.
	var start_format = " .+0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;
	
	//The first character can be + .  blank or a digit.
	check_char = start_format.indexOf(obj_val.charAt(0))
	//Was it a decimal?
	if (check_char == 1) decimal = true;
	else if (check_char < 1) return false;
	
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < obj_val.length; i++)
	{
		check_char = number_format.indexOf(obj_val.charAt(i))
		if (check_char < 0) return false;
		else if (check_char == 1)
		{
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)
				trailing_blank = true;
			// ignore leading blanks
		}
		else if (trailing_blank) return false;
		else digits = true;
	}
	//All tests passed, so...
	return true
}
