//<!--
// Date Format YYYY,MM,DD
// -1 to Months, +1 to Days, Year Stays the Same.


var electionDate = new Date(2006,10,8);     // 7th November 2006 | Election Day

var forumDate = new Date(2006,10,6);	// 28th October 2006 | Community Election Forum

function daysTill(laterdate) {

// Election Day Messages:
	if (laterdate == electionDate) {	
		var messageTxt = "&nbsp;&nbsp;days until Election Tuesday, Nov. 7, 2006";	// COUNT DOWN MESSAGE
		var tomorrowMessage = "&nbsp;&nbsp;day until Election Tuesday, Nov. 7, 2006";	// IT'S TOMORROW MESSAGE
		var todayMessage = "Vote Today!";	// IT'S TODAY MESSAGE
		var passedMessage = "I Hope You Voted!";	// IT HAS PASSED MESSAGE
	}
	
// Election Forum Messages:
	else if (laterdate == forumDate) {		
		var messageTxt = "&nbsp;&nbsp;days until the<br>2006 Election Forum<br>Saturday, Nov. 4, 2006";	// COUNT DOWN MESSAGE
		var tomorrowMessage = "&nbsp;&nbsp;day until the<br>2006 Election Forum<br>Saturday, Oct. 28, 2006";	// IT'S TOMORROW MESSAGE
		var todayMessage = "<center>2006 Community<br>Election Forum<br>Today at 7:00 p.m.</center>";	// IT'S TODAY MESSAGE
		var passedMessage = "<center><span style='font-size:12px;'>Make Your Vote Count<br><span style='font-size:18px;'>Stay Informed!</span></span></center>";	// IT HAS PASSED MESSAGE
	}
	
// THE WORKS -- DON'T TOUCH!
	var dateToday = new Date;  // today's date
    var difference = laterdate.getTime() - dateToday.getTime();
	var daysDifference = Math.floor(difference/1000/60/60/24);
    difference -= daysDifference*1000*60*60*24
	
	if (daysDifference > 7) {	// STILL COUNTING DOWN
		document.write("<div style='padding-right:50px;'><div style='position:relative;float:left;width:30px;color:#FFFFFF;background-color:#6175BC;font-size:18px;text-align:center;padding-right:2px;padding-left:2px;line-height:18px;'>" + daysDifference + "</div>" + messageTxt + "</div>");
	}
	if  (daysDifference < 7) {	// LESS THAN A WEEK OR TODAY
		if (daysDifference > 1) {	// THIS WEEK!
			document.write("<div style='padding-right:50px;'><div style='position:relative;float:left;width:30px;color:#FFFFFF;background-color:#CC0000;font-size:18px;text-align:center;padding-right:2px;padding-left:2px;line-height:18px;'>" + daysDifference + "</div>" + messageTxt + "</div>");
		}
		if (daysDifference == 1) {	// TOMORROW!
			document.write("<div style='padding-right:50px;'><div style='position:relative;float:left;width:30px;color:#FFFFFF;background-color:#CC0000;font-size:18px;text-align:center;padding-right:2px;padding-left:2px;line-height:18px;'>" + daysDifference + "</div>" + tomorrowMessage + "</div>");
		}
		else if (daysDifference == 0) {	// IT'S TODAY!
			document.write("<div style='color:#CC0000;font-size:20px;padding-right:50px;'>" + todayMessage + "</div>");
		}
		else if (daysDifference < 0) {	// IT'S PASSED
			if (daysDifference > -7) {
				document.write("<div style='padding-right:50px;'>" + passedMessage + "</div>");
			}
		}
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->