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=800,height=600,directories=yes,status=yes,scrollbars=yes,resizable=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 uncheck(field) 
{
		for (i = 0; i < field.length; i++) 
		{
			field[i].checked = false; 
		}
		
		checkflag = "false";
		
		return "Uncheck 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();
}

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
	if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) //if scroller hasn't reached the end of its height
	cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px" //move scroller upwards
	else //else, reset to original position
	cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(marquee1){
	document.getElementById("preview_blog").innerHTML = "<h3><a  style='color:maroon; text-decoration:none' href='http://blogs.bullrealty.com/'>Latest Blog Posts</a></h3><div id='marqueecontainer' onMouseover='copyspeed=pausespeed' onMouseout='copyspeed=marqueespeed'><div id='vmarquee'>"+marquee1+"</div></div>";

	cross_marquee=document.getElementById("vmarquee")
	cross_marquee.style.top=0
	marqueeheight=document.getElementById("marqueecontainer").offsetHeight
	actualheight=cross_marquee.offsetHeight //height of marquee content (much of which is hidden from view)
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
		cross_marquee.style.height=marqueeheight+"px"
		cross_marquee.style.overflow="scroll"
		return
	}	
	setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}
