	var browseType;
	if (document.layers) {browseType=0;}
	if( document.getElementById )  {browseType=1;}
	if (document.all) {browseType=2;}
	
	var iTimeOut = (1000*60*6*8);	//the last digit is the # of hours
	var iSleep = 600000;		//sleep for ten minutes 600000
	var iErrorSleep = 60000;	//sleep for 1 minute if there was an error.
	var iCounter = 1;
	
	function refreshFunc()
	{
		iCounter = iCounter + iSleep;

		if( ( iCounter > iTimeOut ) && ( iTimeOut > 0 ) )
		{
			document.location = "logout.aspx";
			return;
		}

		document.getElementById('TopBanner1_refreshIt').src = "TopRefresh.aspx";
		setTimeout("checkResults()", 15000);	//wait 15 seconds before checking the page
	}
	
	function checkResults()
	{
		//if the object is not there then the iframe failed to load -- try back in a minute to load again.
		if( window.frames['TopBanner1_refreshIt'].document.getElementById('lblGotMe') == null )
			setTimeout("refreshFunc()", iErrorSleep);
		else
			setTimeout("refreshFunc()", iSleep);
	}

/*	setTimeout("refreshFunc()", 30000);	//wait for 30 seconds before doing refresh system
*/

	function openNewWindow(pgnew) 
	{
		mywin = top.open(pgnew, "ClosedSunday", "toolbar=0,scrollbars=1,location=0,menubar=no,status=no,resizable=1,height=550,width=780");
		mywin.location = pgnew;
	}

	function doFadeImage( thePic )
	{
		var el = document.getElementById(thePic);
		if (el == null)
			return;
		if (browseType == 2)
		{
			if( el.style.filter != null )
			{
				el.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=2)";
				el.filters[0].apply();
			}
		}
		el.style.visibility = "visible";
		
		if( (browseType == 2) && ( el.style.filter != null ) )
			el.filters[0].play();
	}

	function mainFade()
	{
		setTimeout("doFadeImage('mainPic')", 200);
		setTimeout("doFadeImage('findPic')", 800);
		setTimeout("doFocus('tbZipCity')", 1200);
	}
	
	function doFocus(sObjectName)
	{
		if( document.getElementById(sObjectName) != null )
			document.getElementById(sObjectName).focus();
	}
	
	function textCounter( textBox, iMaxCount )
	{
		if( textBox.value.length > iMaxCount )
		{
			textBox.value = textBox.value.substring(0, iMaxCount);
			alert('You have reached the maximum characters of ' + iMaxCount);
		}
	}
	
	function disableRight()
	{
		return;
		
		document.oncontextmenu = function(){return false}
		if(document.captureEvents)
		{
			window.captureEvents(Event.MOUSEDOWN);
			window.onmousedown = function(e)
			{
				if(e.target==document)return false;
			}
		}
		else
			document.onmousedown = function(){return false}
	}
	
	function trimIt(sValue) 
	{
        return sValue.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
	}
