<!--
	
	// End script for display time zone
	function displayTime(intTime,strZone) {
		
		if (strZone == "EST")
		{
		//':'+padOut(New_York_time.getSeconds()) +
			document.write(padOut(New_York_time.getHours())+':'+padOut(New_York_time.getMinutes())+ " " + strZone);
		}
		else if (strZone == "GMT")
		{
			document.write(padOut(London_time.getHours())+':'+padOut(London_time.getMinutes())+ " " + strZone);
		}
		else if (strZone == "UTC")
		{
			document.write(padOut(Tokyo_time.getHours())+':'+padOut(Tokyo_time.getMinutes())+ " " + strZone);
		}
	}
	
	function getClientWidth(){
		var width	=	0;
		var ifclause	=	0;
		if( document.documentElement && document.documentElement.clientWidth ) {
			width	=	document.documentElement.clientWidth;
			ifclause	=	1;
		}
		else if( parent.document.body && parent.document.body.clientWidth ) {
			width	=	parent.document.body.clientWidth;
			ifclause	=	2;
		}
		else if( document.body && document.body.clientWidth ) {
			width	=	document.body.clientWidth;
			ifclause	=	3;
		}
		else if( window.innerWidth ) {
			width	=	window.innerWidth - 18;
			ifclause	=	4;
		}
		//alert('ifclause: '+ifclause+' width: '+width);
		return width;
	};
	
	function getClientHeight() {
		var height	=	0;
		var ifclause	=	0;
		if( document.documentElement && document.documentElement.clientHeight ) {
			height	=	document.documentElement.clientHeight;
			ifclause	=	1;
		}
		else if( parent.document.body && parent.document.body.clientHeight ) {
			height	=	parent.document.body.clientHeight;
			ifclause	=	2;
		}
		else if( document.body && document.body.clientHeight ) {
			height	=	document.body.clientHeight;
			ifclause	=	3;
		}
		else if( window.innerHeight ) {
			height	=	window.innerHeight - 18;
			ifclause	=	4;
		}
		//alert('ifclause: '+ifclause+' height: '+height);
		return height;
	}
	
	function resize_window(w,h) {
		setClientWidth = w;
		setClientHeight = h;
		window.resizeTo(w, h);
		//var thisClientWidth = window.document.body.clientWidth;
		//var thisClientHeight = window.document.body.clientHeight;
		var thisClientWidth = getClientWidth();
		var thisClientHeight = getClientHeight();
		if (thisClientWidth < w)
			var setClientWidth = w + (w - thisClientWidth);
		if (thisClientHeight < w)
			var setClientHeight = h + (h - thisClientHeight);
		
		//alert('setClientWidth: ' + setClientWidth + ' ' + 'setClientHeight: ' + setClientHeight);
		window.resizeTo(setClientWidth, setClientHeight);
	}
	
	function resize_window_according_to_document() {
	  w = getClientWidth();
	  h = getClientHeight();
	  resize_window(w,h);
	}
	
	
	var popUpWin=0;
	function popUpWindow(URLStr, left, top, width, height)
	{
	  if(popUpWin)
	  {
		if(!popUpWin.closed) popUpWin.close();
	  }
	  popUpWin	=	open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	  popUpWin.focus();
	}
	
	var popUpWinWH=0;
	function popUpWindowWH(URLStr, w, h)
	{
		if(popUpWinWH)
		{
			if(!popUpWinWH.closed) popUpWinWH.close();
		}
		var xsize	=	w;
		var ysize	=	h;
		var DocumentWidth	=	parseInt(getClientWidth());
		var DocumentHeight	=	parseInt(getClientHeight());
		var xpos	=	(DocumentWidth/2)-(xsize/2);
		var ypos	=	(DocumentHeight/2)-(ysize/2);
		//alert('xpos: '+xpos+' ypos: '+ypos);
		
		popUpWinWH	=	open(URLStr, 'popUpWinWH', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
		if (popUpWinWH.opener == null)
			popUpWinWH.opener	=	self;
		popUpWinWH.focus();
	}
	
	var popUpWinWHScroll=0;
	// Note: function name should be diffrent then the variable name
	function popUpWindowWHScroll(URLStr, w, h)
	{
		if(popUpWinWHScroll)
		{
			if(!popUpWinWHScroll.closed) popUpWinWHScroll.close();
		}
		var xsize	=	w;
		var ysize	=	h;
		var DocumentWidth	=	parseInt(getClientWidth());
		var DocumentHeight	=	parseInt(getClientHeight());
		var xpos	=	(DocumentWidth/2)-(xsize/2);
		var ypos	=	(DocumentHeight/2)-(ysize/2);
		//alert('xpos: '+xpos+' ypos: '+ypos);
		
		popUpWinWHScroll	=	open(URLStr, 'popUpWinWHScroll', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
		if (popUpWinWHScroll.opener == null)
			popUpWinWHScroll.opener	=	self;
		popUpWinWHScroll.focus();
	}
	
	var paramPop = 0 ;
	function popUpWindowWHParam(URLStr, w, h, param1)
	{
		if(paramPop)
		{
			if(!popUpWinWH.closed) popUpWinWH.close();
		}
		var xsize	=	w;
		var ysize	=	h;
		var DocumentWidth	=	parseInt(getClientWidth());
		var DocumentHeight	=	parseInt(getClientHeight());
		var xpos	=	(DocumentWidth/2)-(xsize/2);
		var ypos	=	(DocumentHeight/2)-(ysize/2);
		//alert('xpos: '+xpos+' ypos: '+ypos);
		
		URLStr = URLStr + "?p1=" + param1;
		
		popUpWinWH	=	open(URLStr, 'popUpWinWH', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
		if (popUpWinWH.opener == null)
			popUpWinWH.opener	=	self;
		popUpWinWH.focus();
	}


	
	/*************************************************/
	// show/hide elements
	function showHide(targetName) {
			if( document.getElementById ) { // NS6+
					target	=	document.getElementById(targetName);
			} else if( document.all ) { // IE4+
					target	=	document.all[targetName];
			}
			
			if( target ) {
					if( target.style.display == "none" )
						target.style.display	=	"inline";
					else
						target.style.display	=	"none";
			}//if
	}//func
	
	function showElement(targetName) {
			if ( document.getElementById ) { // NS6+
					target	=	document.getElementById(targetName);
			} else if( document.all ) { // IE4+
					target	=	document.all[targetName];
			}
	
			if( target ) {
				target.style.display	=	"inline";
			}//if
	} 
	
	function hideElement(targetName) {
			if( document.getElementById ) { // NS6+
					target	=	document.getElementById(targetName);
			} else if( document.all ) { // IE4+
					target	=	document.all[targetName];
			}
			
			if( target ) {
				target.style.display	=	"none";
			}//if
	} 
	
	/**********************************************************/
	//form validation functions
	
	// function isFilled(element, minLength, maxLength)
	// it returns 1 on success
	// it returns -1 if form element is null or empty
	// It returns -2 if element is not of the minimum length required. it does not check for the minimum length required if passed value is zero. 
	// It returns -3 if element exceeds the maximum length allowed. it does not check for the maximum length allowed if passed value is zero.
	//usage: isFilled(firstName, 0, 20)
	function isFilled(element, minLength, maxLength)
	{
		if (element.value == "" || element.value == null) 
			return -1;
	
		if ((minLength  != 0) && (element.value.length < minLength))
			return -2;
	
		if ((maxLength  != 0) && (element.value.length > maxLength))
			return -3;
	
		return 1;
	}//isFilled
	
	// Check for drop down
	// usage: isAnySelected(supervisor)
	function isAnySelected(element)
	{
		if (element.options[element.selectedIndex].value == "" ) 
			return false;
		else
			return true;
	}//isAnySelected
	
	/////////////////////////////////////////////////////////
	function selectAllOptions(selectField)
	{
		for(i=0; i<selectField.length; i++)
			selectField.options[i].selected	=	true;
	} //selectAllOptions
	
	// Check any of the check boxes is checked.
	// usage: isAnyChecked(supervisor)
	function isAnyChecked(checkboxObj)
	{
		var addresses	=	checkboxObj;
		var address_result	=	0;
		for (var a	=	0; a <addresses.length; a	=	a + 1){
			if(addresses[a].checked)
				address_result	=	address_result+1;
		}
		if (address_result > 0)
			return true;
		else
			return false;
	}//isAnyChecked
	
	// Check if the check boxe is checked.
	// usage: isChecked(supervisor)
	function isChecked(checkboxObj)
	{
		if (checkboxObj.checked)
			return true;
		else
			return false;
	}//isChecked
	
	function transferSelectedOptions(selectFrom, selectTo)
	{
		var i	=	0;
		while(i<selectFrom.length)
		{
			if (selectFrom.options[i].selected == true)
			{
				var newOption	=	new Option(selectFrom.options[i].text, selectFrom.options[i].value, false, false);
				selectTo.options[selectTo.length]	=	newOption;
				selectFrom.options[i]	=	null;
				i--;
			}//if
			i++;
	  }//while
		selectFrom.selectedIndex	=	0;
		selectTo.selectedIndex	=	0;
	} //transferSelectedOptions
	
	function transferAllOptions(selectFrom, selectTo)
	{
		while(selectFrom.length > 0)
		{
			var newOption	=	new Option(selectFrom.options[0].text, selectFrom.options[0].value, false, false);
			selectTo.options[selectTo.length]	=	newOption;
			selectFrom.options[0]	=	null;
	   }//while
	}//transferAllOptions
	/////////////////////////////////////////////////////////
	
	/*
	Name: checkBrowseFileName(strFileName)
	Author: Wasay (Wit Inc.)
	Date: 07/13/04
	Input: strFileName
	Ouput: true OR false
	Purpose: to check the uploading file for valid file name.
	*/
	function checkBrowseFileName(strFileName) {
		if (strFileName.length > 0) {
			var varFileNameString	=	strFileName.split("\\");
			var varFileName	=	varFileNameString[varFileNameString.length-1];
			var thePatternOrg	=	'^[a-zA-Z0-9.:_]+$';
			var thePattern	=	thePatternOrg;
			var myRegExp	=	new RegExp(thePattern);
			var strMatch	=	myRegExp.test(varFileName);	
			if (!strMatch) 			
				return false;  // Failed			
			else			
				return true;
		}
		else
			return true; // return true if the value is just null
	}
	
	function isEmail (emailStr) {
		var checkTLD=1;
		var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
		var emailPat=/^(.+)@(.+)$/;
		var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
		var validChars="\[^\\s" + specialChars + "\]";
		var quotedUser="(\"[^\"]*\")";
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
		var atom=validChars + '+';
		var word="(" + atom + "|" + quotedUser + ")";
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
		
		var matchArray=emailStr.match(emailPat);
		if (matchArray==null) {
			//alert("Email address seems incorrect (check @ and .'s)");
			return false;
		}
		var user=matchArray[1];
		var domain=matchArray[2];	
		for (i=0; i<user.length; i++) {
			if (user.charCodeAt(i)>127) {
				//alert("Ths username contains invalid characters.");
				return false;
			}
		}	
		for (i=0; i<domain.length; i++) {
			if (domain.charCodeAt(i)>127) {
				//alert("Ths domain name contains invalid characters.");
				return false;
			}
		}	
		if (user.match(userPat)==null) {
			//alert("The username doesn't seem to be valid.");
			return false;
		}	
		var IPArray=domain.match(ipDomainPat);
		if (IPArray!=null) {
			for (var i=1;i<=4;i++) {
				if (IPArray[i]>255) {
					//alert("Destination IP address is invalid!");
					return false;
				}
			}
			return true;
		}	
		// Domain is symbolic name.  Check if it's valid.
		var atomPat=new RegExp("^" + atom + "$");
		var domArr=domain.split(".");
		var len=domArr.length;
		for (i=0;i<len;i++) {
			if (domArr[i].search(atomPat)==-1) {
				//alert("The domain name does not seem to be valid.");
				return false;
			}
		}	
		/* domain name seems valid, but now make sure that it ends in a
		known top-level domain (like com, edu, gov) or a two-letter word,
		representing country (uk, nl), and that there's a hostname preceding 
		the domain or country. */
		if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
			//alert("The address must end in a well-known domain or two letter " + "country.");
			return false;
		}	
		// Make sure there's a host name preceding the domain.
		if (len<2) {
			//alert("This address is missing a hostname!");
			return false;
		}	
		// If we've gotten this far, everything's valid!
		return true;
	}
	
	function findDynamicIDFromURLPathName() {
		var local_pathname	=	location.pathname;
		var find_id=".id.";
		var find_htm=".htm";
		var the_id_location=local_pathname.indexOf(find_id);
		var the_htm_location=local_pathname.indexOf(find_htm);
		var the_id	=	"";
		if (the_id_location > 0 && the_htm_location > 0)
		{
			the_id_location	=	the_id_location + find_id.length;
			the_id	=	local_pathname.substring(the_id_location,the_htm_location);
		}
		else
		{
			the_id	=	0;
		}	
		//alert(local_pathname);
		//alert(the_id_location);
		//alert(the_htm_location);
		//alert(the_id);
		return the_id;
	}
	
	function findPosX(obj)
	{
		var curleft	=	0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj	=	obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}
	
	function findPosY(obj)
	{
		var curtop	=	0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj	=	obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}
	
	// Redirects the menu links TR onClick event
	var popUpWinBR=0;
	function browserRedirect(URLStr,targetInt)
	{
	  if(!targetInt == 1)
	  {
		  location	=	URLStr;
	  }
	  else
	  {	  
		  popUpWinBR	=	open(URLStr);
		  popUpWinBR.focus();
	  }
	}
	
	function searchFocus(obj)
	{
		if (obj.value == "Search")
		{
			obj.value = "";
		}	
		//return false;
	}
	
	function trimAll(sString) 
	{
		while (sString.substring(0,1) == ' ')
		{
			sString = sString.substring(1, sString.length);
		}
		while (sString.substring(sString.length-1, sString.length) == ' ')
		{
			sString = sString.substring(0,sString.length-1);
		}
		return sString;
	}
	
   function PopupPic(sPicURL) { 
     window.open( "/javascript/popuppic.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200"); 
   } 

//-->
