var scrollCounter = 0;
var scrollDelay = 45;
var scrollText = '';

var i = 0;

while (i ++ < 140) scrollText = " " + scrollText;


function Scroller(message)
{
	var scrollText = message;

	window.status = scrollText.substring(scrollCounter++, scrollText.length);
	if (scrollCounter == scrollText.length)  scrollCounter = 0;
	
	var newFun = "Scroller(\"" + message + "\")";

	setTimeout(newFun, scrollDelay);
}

function newwindow(theFile,width,height) 
{ 
window.open(theFile,'opi','toolbar=no,width=' + width + ',height=' + height + ',directories=no,status=no,scrollbars=yes,resize=no,menubar=no'); 
} 

function openFullWindow(theFile) 
{ 
window.open(theFile,'newwin','toolbar=yes,width=700,height=600,directories=yes,status=yes,scrollbars=yes,resize=yes,menubar=yes'); 
} 

function getUrl() 
{
	alert(parent.mainFrame.location);
}

function setPlaceholder(thisForm,page) 
{
	with (thisForm) 
	{
	
		PageNumber.value = page;
	
		submit();
	}
}


var checkflag = "false";

function check(field) 
{
	if (checkflag == "false") 
	{
		for (i = 0; i < field.length; i++) 
		{
			field[i].checked = true;
		}
		
		checkflag = "true";
		
		return "Uncheck All"; 
	}
	else 
	{
		for (i = 0; i < field.length; i++) 
		{
			field[i].checked = false; 
		}
		
		checkflag = "false";
		
		return "Check All"; 
	}
}

function checkEditorForm()
{
	if(confirm("Click OK to remove this page from the website"))
	{
		document.editorForm.deleteTrigger.value = true;
		document.editorForm.submit();
	}
}

function sendSearchLocation()
{
	
	if(document.searchMe.searchType[1].checked)
	{
		document.searchMe.action = 'sitesearch.cfm';
	}
	
	return true;
}


//This function adds a bookmark to the favorites of the IE browser
function addBookmark(bookmarkurl,bookmarktitle){
	if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

//This will refresh the advanced search screen to populate counties
function loadCounties()
{
	document.advancedsearchform.action = 'advancedsearch.cfm';
	document.advancedsearchform.submit();
}