<!--
var alphabet = "abcdefghijklmnopqrstuvwxyz";
var numeric  = "0123456789";

function isValidwithBag(name,Bag)
{
	var i;
	name = name.toLowerCase();
	for(i=0;i<name.length;++i)
		if (Bag.indexOf(name.charAt(i)) == -1) 
			return false;
	return true;
}		

function isEmpty(s)
{
	// if the string is null or having the length of zero
	// the function will return true
	return((s==null) || (s.length==0));
}

function isWhitespace(s)
{
	// 	Check if s is empty

	if (isEmpty(s)) return true;	

	// Checks for whitespace. If there is atleast a non-whitespace character
	// the function will return false.

	var spaces = " \n\t\r"
	var i;
	for(i=0;i<s.length;++i)
		if (spaces.indexOf(s.charAt(i)) == -1) 
			return false;
	return true;
}

function isLogin(s)
{
	if (s.length < 5)
	{
		alert("Please provide minimum length of login iD is 5");
		return false;
	}

	if (!isValidwithBag(s,alphabet + numeric + "-._"))

	{
		alert("Login ID should contain only the characters from alphabet, numbers and '-._'");
		return false;
	}
	if (!isValidwithBag(s.charAt(s.length-1),alphabet + numeric))
	{
		alert("Login ID should end with an alphanumeric characters.");
		return false;
	}
	if (!isValidwithBag(s.charAt(0),alphabet + numeric))
	{
		alert("Login ID should start with an alphanumeric characters.");
		return false;
	}
	return true;
}

function isPassword(s)
{
	if (s.length < 5)
	{
		alert("Please provide a minimum length of password is 5");
		return false;
	}

	if (isWhitespace(s))
	{
		alert("Please provide a value for password without spaces");
		return false;
	}
	return true;
}


function isEmail(s)
{
	var i = 1,Length = s.length,result;

	while((i<Length) && (s.charAt(i) != '@')) i++;
	
	if ((i == Length) || (s.charAt(i) != '@'))
	{
		alert("Email address don\'t have the character @ after the login name");
		return false;
	}
	
	i+=2;
	
	while((i<Length) && (s.charAt(i) != '.')) i++;

	if ((i == Length) || (s.charAt(i) != '.'))
	{
		alert("Email address don\'t have the character . after the domain name ");
		return false;
	}

	if (i+1 >= Length)
	{
		alert("Email address should have atleast one character after . ");
		return false;
	}
	
	return true;
}

function validateDB(objForm)
{
	var i,j;
	with(objForm)
	{	
		for(i=0;i < elements.length;i++)
		{
			if(elements[i].name.substr(0,2) == "_1" || (elements[i].name.substr(0,2) == "_0" && elements[i].value != ""))
			{
				j = elements[i].name.charAt(2);
				
				switch(j)
				{
					case "1" :
							if (isWhitespace(elements[i].value))
							{
								alert("Please provide a value for " + elements[i].name.substr(4))
								elements[i].focus();
								return false;
							}
							break;
					case "2" :
							if (isNaN(elements[i].value) || isWhitespace(elements[i].value))
							{
								alert("Please provide numeric value for " + elements[i].name.substr(4))
								elements[i].focus();
								return false;
							}
							break;
					case "3" :
							if (isWhitespace(elements[i].value))
							{
								alert("Please select yes/no for " + elements[i].name.substr(4))
								elements[i].focus();
								return false;
							}
							break;
					case "9" :
							if (isWhitespace(elements[i].value))
							{
								alert("Please select a file for " +  elements[i].name.substr(4))
								elements[i].focus();
								return false;
							}	
							elements[elements[i].name.substr(4)].value = elements[i].value;
				}
				
			}
			else if(elements[i].name.substr(0,3) == "_09")
				elements[elements[i].name.substr(4)].value = elements[i].value;
			
		}
	}
	return true;
}


function validateDB1(objForm)
{
	var i,j;
	with(objForm)
	{	
		for(i=0;i < elements.length;i++)
		{
			if(elements[i].name.substr(0,2) == "_1")
			{
				j = elements[i].name.charAt(2);
				
				switch(j)
				{
					case "1" :
							if (isWhitespace(elements[i].value))
							{
								alert("Please provide value for " + elements[i].name.substr(4))
								return false;
							}
							break;
					case "2" :
							if (isNaN(elements[i].value) || isWhitespace(elements[i].value))
							{
								alert("Please provide numeric value for " + elements[i].name.substr(4))
								return false;
							}
							break;
					case "3" :
							if (isWhitespace(elements[i].value))
							{
								alert("Please provide date value for " + elements[i].name.substr(4))
								return false;
							}
							break;
					case "9" :
							if (isWhitespace(elements[i].value))
							{
								alert("Please select a file for " +  elements[i].name.substr(4))
								return false;
							}	
							elements[elements[i].name.substr(4)].value = elements[i].value;
				}
				
			}
			
			else if(elements[i].name.substr(0,3) == "_09")
			{
					elements[elements[i].name.substr(4)].value = elements[i].value;
			}
			
		}
	}
	return true;
}

function win_open(location, width, height)
{
	//determine browser type
	var ns4up = (document.layers) ? 1 : 0;  
	var ie4up = (document.all) ? 1 : 0;
	
	//if compatable browser
	if (ns4up || (ie4up))
	{
		//if netscape 4 or up
		if (ns4up)
		{
			//width & height X% of client's current brower
			if (width.indexOf("%") > -1)
			{
				var win_width = Math.round(self.innerWidth * (parseFloat(width)*.01));
			}
			else
			{
				var win_width = parseFloat(width)
			}
			if (height.indexOf("%")  > -1)
			{
				var win_height = Math.round(self.innerHeight * (parseFloat(height)*.01));
			}
			else
			{
				var win_height = parseFloat(height)
			}
			
		}
		//if internet explorer 4 or up
		else if (ie4up)
		{
			//width & height X% of client's current brower
			if (width.indexOf("%")  > -1)
			{ 
				var win_width = Math.round(document.body.clientWidth * (parseFloat(width) *.01))
			}
			else
			{
				var win_width = parseFloat(width)
			}
			if (height.indexOf("%")  > -1)
			{
				var win_height = Math.round(document.body.clientHeight * (parseFloat(height)*.01))
			}
			else
			{
				var win_height = parseFloat(height)
			}
		}
			//parm string
			var win_size = "scrollbars=no,width=" + win_width + ",height=" + win_height +",top=0,left=0,"
			//open window
			window.open(location,"", win_size)
	}
	//else incompatable broswer, open window to default size
	else
	{
		//open window with default settings
		window.open(location, "", "scrollbars=Yes,menubar=yes,top=0,left=0")
	}
}

//-->
