// JavaScript Document

//toggel visibility on and off whith the style display element set to none or block...
function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }


// Page loading   --needs id element of "prepage" in the document, stlye any way that fits
function waitPreloadPage() { //Document Object Model
if (document.getElementById){
document.getElementById('prepage').style.display='none';
	
	} else {
		
		if (document.layers) { //NS4
		document.prepage.display = 'none';
			} else { //IE4
		document.all.prepage.style.display = 'none';
				}
	}
}

// Show Disclaimer before viewing the Budget Docs
function site_exit1()
{
var mes1 = confirm("You are now exiting the Village of Wellington's website and entering at http://www.facebook.com/WellingtonFL.\n\nThis is not a Village of Wellington website and the Village is not responsible for the content or subject matter. "); 

	if (mes1) {

	return true;
	
	} else {
	
	return false;
	
	}
}


// Show Disclaimer before viewing the Budget Docs
function site_exit2()
{
var mes2 = confirm("You are now exiting the Village of Wellington's website and entering at http://twitter.com/wellingtonfl.\n\nThis is not a Village of Wellington website and the Village is not responsible for the content or subject matter. "); 

	if (mes2) {

	return true;
	
	} else {
	
	return false;
	
	}
}

/*
// Show Disclaimer before viewing the Budget Docs
function show_dis()
{
var dis = confirm("DISCLAIMER:\n\nVillage of Wellington 2009/2010 Budget\n\nPlease note that the annual budget information you are accessing is proposed and has not yet been approved by the Village Council. Any and all associated numbers, percentages, statements, plans, or other information is deemed in draft and is not official. The proposed budget shows the Village\’s plan to invest in the future of our great Village with Capital Improvement Projects aimed at expanding and strengthening the Village\’s various infrastructure systems. Also, please note that while the Village council may elect to use the legally allowed \“roll-back\” millage rate, the Village is budgeting in a manner that will lower taxes for all Wellington property owners.\n\nThank you for your interest in the budgeting process."); 

	if (dis) {

	return true;
	
	} else {
	
	return false;
	
	}
}
*/


/***********************************************
* ProHTML Ticker script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var tickspeed=5000 //ticker speed in miliseconds (2000=2 seconds)
var enablesubject=0 //enable scroller subject? Set to 0 to hide

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontent{display:none;}\n')
document.write('</style>\n')
}

var selectedDiv=0
var totalDivs=0

function contractall(){
var inc=0
while (document.getElementById("dropmsg"+inc)){
document.getElementById("dropmsg"+inc).style.display="none"
inc++
}
}

function expandone(){
var selectedDivObj=document.getElementById("dropmsg"+selectedDiv)
contractall()
document.getElementById("dropcontentsubject").innerHTML=selectedDivObj.getAttribute("subject")
selectedDivObj.style.display="block"
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
setTimeout("expandone()",tickspeed)
}

function startscroller(){
while (document.getElementById("dropmsg"+totalDivs)!=null)
totalDivs++
expandone()
if (!enablesubject)
document.getElementById("dropcontentsubject").style.display="none"
}

if (window.addEventListener)
window.addEventListener("load", startscroller, false)
else if (window.attachEvent)
window.attachEvent("onload", startscroller)




//POP up Window for the Contact Us
/****************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
This script is free to use as long as this info is left in
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
***************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}        




// Pop up window Auto Center
/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}




