﻿<!--
	/************************************************************************
	*   Pre-load Image
	************************************************************************/
	img1Clear = new Image();
	img1Clear.src = "/_System/Lib/Image/1clear.gif";


	/************************************************************************
	*   Function newImage()
	*       IMAGE READY FUNCTION
	************************************************************************/
    function newImage(arg) {
	    if (document.images) {
		    rslt = new Image();
		    rslt.src = arg;
		    return rslt;
	    }
    }

	/************************************************************************
	*   Function changeImages()
	*       IMAGE READY FUNCTION
	************************************************************************/
    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];
		    }
	    }
    }

	/************************************************************************
	*   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 MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->


var count = 0;
function Anthem_PreCallBack() { 
    count++;
    setTimeout("CallBackStarted()", 500); 
}
function Anthem_PostCallBack() { CallBackFinished(); }

function CallBackStarted() {
  if (count > 0){  
    var item = document.getElementById('wait');
    if ((!window.XMLHttpRequest) && (document.documentElement)){
      item.style.position = 'absolute';
      //code to make ie6 behave
      if (document.documentElement.scrollTop){
        item.style.top = document.documentElement.scrollTop + 15;
      }
      else{ item.style.top = 15; }      
      item.style.right = 15;
    }
    item.style.display = 'block';    
  }
}
 
function CallBackFinished(){
  count--;
  if (count == 0){
    var item = document.getElementById('wait');
    if (item != null){
        item.style.display = 'none';
    }
  }
}
