<!--
function Trim(s)
{
	var temp = " ";
	var i = 0;

	while ((temp == " ") && (i <= s.length)) {
		temp = s.charAt(i);
		i++;
	}
	s = s.substring(i - 1, s.length);
	return(s);
}

function IsEmpty(s)
{
	if (Trim(s) == "") {
		return(true);
	} else {
		return(false);
	}
}

function IsSelected(s)
{
	if (s.options[s.selectedIndex].value == -99) {
		return(false);
	} else {
		return(true);
	}
}

function IsOption(s)
{
	Temp = false;
	for (i = 0; i < s.length; i++) {
		if (s[i].checked == true) {
			Temp = true;
			break;
		}
	}
	return(Temp);
}

function IsChecked(s)
{
	if (s.checked == true) {
		return(true);
	} else {
		return(false);
	}
}

function IsEmail(email) 
{
	var pos;
	email = Trim(email);
	pos = email.indexOf("@");
	if ((pos < 3) || (email.indexOf(".", pos + 2) == -1)) {
		return(false);
	} else {
		return(true);
	}
}

function IsLong(s)
{
	var max = s.length
	if ( max > 255) {
		return(true);
	} else {
		return(false);
	}
}

function IsSame(s,o){
	if (s==o)	{
		return true;
	}else{
		return false;
	}
}

function IsNumeric(s) {
	if (isNaN(s)) {
		return false;
	} else {
		return true;
	}
}

function IsInteger(s) {
	var flag = false;
	var valid = "0123456789";
	
	if (!IsEmpty(s))
	{
		//  if s is a text
		if (isNaN(s)) {
			flag =  false;
		} else {
			flag =  true;
		}
		for (var i=0; i<s.length; i++) {
			temp = "" + s.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") flag = false;
		}
	}else{
		flag = false;
	}

	return flag;
}



function WarningLong(o)
{
	alert('Question is long more than 255.');
	o.value=""
	o.focus();
}


function WarningSame(o)
{
	alert('Please check password.');
	o.value = "";
	o.focus();
}

function WarningEmail(o,TXT)
{
	alert(TXT);
	o.value = "";
	o.focus();
}

function Warning(o,TXT)
{
	alert(TXT);
	o.value = "";
	o.focus();
}

function WarningSelect(o,TXT)
{
	alert(TXT);
	o.focus();
}

function WarningOption(o,TXT)
{
	alert(TXT);
	o[0].focus();
}

function WarningCheckBox(o,TXT)
{
	alert(TXT);
	o.focus();
}

function WarningNumeric(o)
{
	alert('Please enter the number.');
	o.value = "";
	o.focus();
}

function WarningInteger(o)
{
	alert('Please enter the number [ Integer ] .');
	o.value = "";
	o.focus();
}

function WarningMsg(o,TXT)
{
	alert(TXT);
	o.value = "";
	o.focus();
}



//-->