<!--
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("min. 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("min. length of password is 5");
		return false;
	}

	if (isWhitespace(s))
	{
		alert("please enter the 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 enter 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 enter 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, enter value for " + elements[i].name.substr(4))
								return false;
							}
							break;
					case "2" :
							if (isNaN(elements[i].value) || isWhitespace(elements[i].value))
							{
								alert("please, enter numeric value for " + elements[i].name.substr(4))
								return false;
							}
							break;
					case "3" :
							if (isWhitespace(elements[i].value))
							{
								alert("please, enter 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")
	}
}

	function MM_openPopupWindow(theURL,winName,features) 
	{ 
		var hWnd =   window.open(theURL,winName,features);
		if ((document.window != null) && (!hWnd.opener))
			hWnd.opener = document.window;
	}
	
	function OpenPopUp()
	{

		ScreenWidth  = screen.width
		ScreenHeight = screen.height
		PopupWidth   = 520
		PopupHeight  = 550
		PopupLeft    = (ScreenWidth-PopupWidth)/2
		PopupTop     = (ScreenHeight-PopupHeight)/2
		MM_openPopupWindow('privacy.htm.asp?' + 'loc=' + LocationId + "&" + 'action=' + action + "&" + 'currentDate=' + currentDate,'PopupWindow','maximize=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+PopupWidth+',height='+PopupHeight+',left='+PopupLeft+',top='+PopupTop);
	}

	Function.prototype.bind = function(obj){
		var method = this, temp = function(){
			return method.apply(obj, arguments);
		}
		return temp;
	}
	
	function FS_Menus()
	{
		this.m_szActive = null;
		this.m_lpszMenus = new Object();
		this.m_nTimer = null;
		
		/**
		 * 
		 * @param {Object} szMenuId	The ID attribute of the div to display as a menu.
		 * @param {Object} dParentObj	The object which the menu should be positioned relative to.
		 */
		this.ShowMenu = function(szMenuId, dParentObj)
		{
			var dObj = "";
			var dCoords = null;
			if(!this.m_lpszMenus[szMenuId])
			{
				this.m_lpszMenus[szMenuId] = document.getElementById(szMenuId);
			}
			if(this.m_szActive != null)
			{
				this.HideAll();
				clearTimeout(this.m_nTimer);
				this.m_nTimer = null;
			}
			
			dObj = document.getElementById(szMenuId);
			
			dCoords = this.GetAbsolutePos(dParentObj);
			dCoords.top += 26; 	// I'm hard coding this. The offsetHeight property on the block-level links
						// was always 0, and I don't feel like figuring out why.
			
			dObj.style.position = "absolute"
			dObj.style.left = dCoords.left + "px";
			dObj.style.top = dCoords.top + "px";
			dObj.style.display = "block";
			
			dObj.onmouseover = this.CancelHide.bind(this);
			dObj.onmouseout = this.HideTimer.bind(this);
			
			this.m_szActive = szMenuId;
		}
		
		this.HideAll = function()
		{
			for(szMenuId in this.m_lpszMenus)
			{
				this.m_lpszMenus[szMenuId].style.display = "none";
			}
		}
		
		this.HideTimer = function()
		{
			this.m_nTimer = setTimeout("FSMenus.HideAll()", 1000)
		}
		
		this.CancelHide = function()
		{
			if(this.m_nTimer != null)
			{
				clearTimeout(this.m_nTimer);
				this.m_nTimer = null;
			}
		}
		
		/**
		 * This function retrieves the absolute position of an element by summing the offsets for it and each of
		 * its parent elements.
		 * @param {Object} dObj		The object you want to determine the absolute position of.
		 * @return {Object} Generic object with two properties, left and top, which contain the coordinates of the parameter. 
		 */
		this.GetAbsolutePos = function(dObj)
		{
			var dPos = new Object();
			dPos.top = 0;
			dPos.left = 0;
			while(dObj != null)
			{
				dPos.top += dObj.offsetTop;
				dPos.left += dObj.offsetLeft;
				
				dObj = dObj.offsetParent; 
			}
			
			return dPos;
		}
	}
	
	var FSMenus = new FS_Menus();
	
	function newImage(arg) {
		if (document.images) {
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}
	
	function changeImages() {
		if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}
	
	var preloadFlag = false;
	function preloadImages() {
		if (document.images) {
			navigation_07_over = newImage("images/navigation_07-over.gif");
			navigation_08_over = newImage("images/navigation_08-over.gif");
			navigation_09_over = newImage("images/navigation_09-over.gif");
			navigation_10_over = newImage("images/navigation_10-over.gif");
			navigation_11_over = newImage("images/navigation_11-over.gif");
			preloadFlag = true;
		}
	}

//-->

