<!--
	/************************************************************************
	*   Pre-load Image
	************************************************************************/
	img1Clear = new Image();
	img1Clear.src = "/_System/Lib/Image/1clear.gif";


	function showpane_custom(url,ttl,a,b) 
	{
	w=screen.width*.95;
	h=screen.height*.95-40;
	l=(screen.width-w)/2;
	t=(screen.height-h)/2;
	win=window.open(url,ttl,"toolbar=no,status=no,menubar=no,location=no,resizable=no,scrollbars=yes,top="+t+",left="+l+",width="+w+",height="+h);
	if(win.window.focus) {
		win.window.focus();
		}
	}


	/************************************************************************
	*   Function PopUp()
	*       Creates a new popup window
	*
	************************************************************************/
	function PopUp(pstrURL, pstrName, pintWidth, pintHeight, pblnScroll, pblnResize, pblnMenus, pblnStatus)
	{
		intLeftPosition = (screen.width) ? (screen.width/3) : 0;
		intTopPosition = (screen.height) ? (screen.height/3) : 0;		
		
		strSettings = 'width='+pintWidth+',height='+pintHeight+',top='+intTopPosition+',left='+intLeftPosition+'toolbar='+pblnMenus+',location='+pblnMenus+',directories='+pblnMenus+',status='+pblnStatus+',menubar='+pblnMenus+',scrollbars='+pblnScroll+',resizable='+pblnResize;
		objNewWindow = window.open(pstrURL, pstrName, strSettings);
		if(objNewWindow.window.focus)
		{
			objNewWindow.window.focus();
		}
	}

	/************************************************************************
	*   Function MakeNewWindow()
	*       Creates a new popup window
	*
	************************************************************************/
	function MakeNewWindow(strURL, intWidth, intHeight, blnResizeable, blnScrollbars) 
	{
		var strOptions
			strOptions = "width=" + intWidth + ",height=" + intHeight + ",resizable=" + blnResizeable + ",scrollbars=" + blnScrollbars
		
		this.name = "frmMainWindow"
		SourceWindow=window.open(strURL, "" ,strOptions);
		SourceWindow.focus();
		}

	/************************************************************************
	*   Function mouseOver()
	*       changes graphics on a page during mouse events
	*
	************************************************************************/ 
	function mouseOver(strCurrentImage, strNewImage)
	{
		if (parseFloat(navigator.appVersion) >= 3.0)
		{
			document.images[strCurrentImage].src = strNewImage;
		}
	}


	/************************************************************************
	*   Function toggleView()
	*       toggles the Hide / Show style of an element on the page
	*
	************************************************************************/ 
	function toggleView(p_objElement)
	{
		if (document.getElementById(p_objElement).className == "SHOW")
		{
			document.getElementById(p_objElement).className = "HIDE";
		}
		else
		{
			document.getElementById(p_objElement).className = "SHOW"
		}
	} 


	/************************************************************************
	*   Variables: Validation
	*       Validation Masks for use throught the site
	*
	************************************************************************/
	var MASK_ALPHA               = /^([a-z]|[A-Z]|[0-9])+$/;
	var MASK_ALPHA_WITH_SPACES   = /^(\w|\s)+$/;
	var MASK_NUMERIC             = /^(\d)+$/;
	var MASK_NUMERIC_WITH_SPACES = /^(\d|\s)+$/;
	var MASK_DOMAINNAME          = /^([a-z]|[A-Z]|[0-9]|-|\.)+$/;
	var MASK_IPADDRESS           = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;

	/************************************************************************
	*   Function isRequired()
	*       checks to make sure a value exists
	*
	************************************************************************/
	function isRequired(p_strValue)
	{
		if (p_strValue.length > 0 )
			return true;
		else
			return false;
	}

	/************************************************************************
	*   Function isIPAddress()
	*       checks for proper IP Address with regular expressions
	*
	************************************************************************/
	function isIPAddress(p_strIPValue, p_blnRequired)
	{
		var intCount;
		var blnContinue = true;
	    
		//Check to see if required
		if (p_blnRequired == true)
		{
			blnContinue = isRequired(p_strIPValue);
		}
	    
		//Check for proper format
		if (blnContinue == true) 
		{
			var astrIP = p_strIPValue.match(MASK_IPADDRESS);
			if (astrIP == null)
			{
				return false;
			} 
			else 
			{
				for (intCount = 0; intCount < 4; intCount++) 
				{
					if (astrIP[intCount+1] > 255) 
					{
						return false;
					}
				}
			}
		} 
		else 
		{
			return false;
		}
		return true;
	}

	/************************************************************************
	*   Function ValidateCheck()
	*       General Validate check using regular expressions
	*
	************************************************************************/
	function ValidateCheck(p_strValue, p_objMask, p_blnRequired)
	{
		var blnContinue = true;
	    
		//Check to see if required
		if (p_blnRequired == true)
		{
			blnContinue = isRequired(p_strValue);
		}
	    
		//Check for proper format
		if (blnContinue == true) 
		{
			var astrValue = p_strValue.match(p_objMask);
			if (astrValue == null)
			{
				return false;
			} 
		} 
		else 
		{
			return false;
		}
		return true;
	}


function format_number(obj)
{
var s="";
v=obj.value;
for(a=0;a<v.length;a++) {
	c=v.substr(a,1);
	if(!isNaN(c)) {
		s+=c;
		}
	}
if(s=="") {
	s="0";
	}
obj.value = s;
}


function format_dec(obj,places)
{
var s="";
v=obj.value;
for(a=0;a<v.length;a++) {
	c=v.substr(a,1);
	if(!isNaN(c) || c==".") {
		s+=c;
		}
	}
if(s=="") {
	s="0";
	}
n = parseFloat(s);
e = Math.pow(10,places);
j = Math.round( n*e );
j /= e;
obj.value = j;
}


function f_validate_date(obj)
{
var today=new Date();
v=obj.value;
p=v.split("/");
if(p.length==1) {
	obj.value="";
	return(0);
	}
else if(p.length==2) { 
	m=p[0];
	d=p[1];
	y=today.getFullYear();
	}
else if(p.length==3) {
	m=p[0];
	d=p[1];
	while(p[2].substr(0,1)=="0" && p[2].length>1) {
		p[2] = p[2].substr(1);
		}
	y=parseInt(p[2]);
	if(y<=99) { y+=2000; }
	}
if(isNaN(m) || isNaN(d) || isNaN(y)) {
	obj.value="";
	return(0);
	}
else if(m<1 || m>12 || d<1 || d>31 || y<0) {
	obj.value="";
	return(0);
	}
s=m+"/"+d+"/"+y;
obj.value = s;
}


function f_fmt_date(s)
{
var dd;
dd = new Date();
p=s.split("/");
ctr = p.length;
if(ctr==3) {
	m = p[0];
	d = p[1];
	y = p[2];
	//alert(ctr + ':' + m + ',' + d + ',' + y);
	s = m + "/" + d + "/" + y;
	}
else if(ctr==2) {
	m = p[0];
	d = p[1];
	y = dd.getFullYear();
	//alert(ctr + ':' + m + ',' + d + ',' + y);
	s = m + "/" + d + "/" + y;
	}
else {
	s = "";
	}
if(!isNaN(m) && (m>=1) && (m<=12) && !isNaN(d) && (d>=1) && (d<=31) && !isNaN(y) ) {}
else s="";	
return(s);
}


function f_datediff_today(dd1)
{
var d;
d = new Date();
p=dd1.split("/");
m1 = parseInt(p[0])-1;
d1 = parseInt(p[1]);
y1 = parseInt(p[2]);
dd_1 = new Date(y1,m1,d1);
diff = (dd_1 - d) / 86400000;
i = Math.ceil(diff);
return(i);
}


//-->
