<!-- //start

//######################################################################################
// Author: ricocheting.com
// For: public release (freeware)
// Date: 4/24/2003 (update: 5/15/2009)
// Description: displays the amount of time until the "dateFuture" entered below.


// NOTE: the month entered must be one less than current month. ie; 0=January, 11=December
// NOTE: the hour is in 24 hour format. 0=12am, 15=3pm etc
// format: dateFuture = new Date(year,month-1,day,hour,min,sec)
// example: dateFuture = new Date(2003,03,26,14,15,00) = April 26, 2003 - 2:15:00 pm

dateFuture = new Date(2012,0,3,12,00,00);

// TESTING: comment out the line below to print out the "dateFuture" for testing purposes
//document.write(dateFuture +"<br />");


//###################################
//nothing beyond this point
function GetCount(){
	dateNow = new Date();									//grab current date
	amount = dateFuture.getTime() - dateNow.getTime();		//calc milliseconds between dates
	delete dateNow;

	// time is already past
	if(amount < 0){
		document.getElementById('countbox').innerHTML="Now!";
	}
	// date is still good
	else{
		days=0;hours=0;mins=0;secs=0;out="";

		amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs

		days=Math.floor(amount/86400);//days
		amount=amount%86400;

		hours=Math.floor(amount/3600);//hours
		amount=amount%3600;

		mins=Math.floor(amount/60);//minutes
		amount=amount%60;

		secs=Math.floor(amount);//seconds
		
		out += "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
		
		out += "<tr class=\"bordered\">";

		if(days != 0){
			out += "<td>" + days + "</td>";
			out += "<td class=\"spacer\"></td>";
		}
		if(days != 0 || hours != 0){
			out += "<td>" + hours + "</td>";
			out += "<td class=\"spacer\"></td>";
		}
		if(days != 0 || hours != 0 || mins != 0){
			out += "<td>" + mins + "</td>";
			out += "<td class=\"spacer\"></td>";
		}
		out += "<td>" + secs + "</td>";
		
		out += "</tr>";
		
		out += "<tr>";

		if(days != 0){
			out += "<td>&nbsp;day"+((days!=1)?"s":"&nbsp;")+"&nbsp;&nbsp;</td>";
			out += "<td class=\"spacer\"></td>";
		}
		if(days != 0 || hours != 0){
			out += "<td>&nbsp;hour"+((hours!=1)?"s":"&nbsp;")+"&nbsp;</td>";
			out += "<td class=\"spacer\"></td>";
		}
		if(days != 0 || hours != 0 || mins != 0){
			out += "<td>minute"+((mins!=1)?"s":"&nbsp;")+"</td>";
			out += "<td class=\"spacer\"></td>";
		}
		out += "<td>seconds</td>";
		
		out += "</tr>";
		
		out += "</table>";
		
		document.getElementById('countbox').innerHTML=out;

		setTimeout("GetCount()", 1000);
	}
}

//-->

function detectBrowser()
{
	var agt=navigator.userAgent.toLowerCase();
	/*if (agt.indexOf("opera") != -1) return 'Opera';
	if (agt.indexOf("staroffice") != -1) return 'Star Office';
	if (agt.indexOf("webtv") != -1) return 'WebTV';
	if (agt.indexOf("beonex") != -1) return 'Beonex';
	if (agt.indexOf("chimera") != -1) return 'Chimera';
	if (agt.indexOf("netpositive") != -1) return 'NetPositive';
	if (agt.indexOf("phoenix") != -1) return 'Phoenix';
	if (agt.indexOf("firefox") != -1) return 'Firefox';
	if (agt.indexOf("safari") != -1) return 'Safari';
	if (agt.indexOf("skipstone") != -1) return 'SkipStone';
	if (agt.indexOf("msie") != -1) return 'Internet Explorer';
	if (agt.indexOf("netscape") != -1) return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
	if (agt.indexOf('\/') != -1) {
	if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
	return navigator.userAgent.substr(0,agt.indexOf('\/'));}
	else return 'Netscape';} else if (agt.indexOf(' ') != -1)
	return navigator.userAgent.substr(0,agt.indexOf(' '));
	else return navigator.userAgent;*/
	
	//note: userAgent in IE7 WinXP returns: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)

	if (agt.indexOf("msie") != -1){
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
			var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
			if (ieversion>7){
				//alert("You're using IE8.x");
				document.write("");
			} else {
				//alert("n/a");
				document.write("<link rel=\"stylesheet\" href=\"styles/ie6.css\" media=\"screen\" />");
			}
		}
	} else {
		//alert("not ie");
		document.write("");
	}
}

$(document).ready(function() {
	GetCount();
	var pageName = location.href.toLowerCase();
	pageName = pageName.substring(pageName.lastIndexOf('/') + 1);
	if(pageName.indexOf("#") != -1) { 
		var pageNameReplace = pageName.substring(pageName.lastIndexOf('#')); 
		pageName = pageName.replace(pageNameReplace,""); 
	}
	
	var navRoot = document.getElementById("main-nav");
	var navLinks = navRoot.getElementsByTagName("A");
	for (i=0; i<navLinks.length; i++) {
		var navLinkHREF = navLinks[i].href.toLowerCase();
		navLinkHREF = navLinkHREF.substring(navLinkHREF.lastIndexOf('/') + 1);
		if(pageName == navLinkHREF) { 
			navLinks[i].className = "selected"; 
		}
	}
});
	
function swapQuote(whatYear){
	$('#quote').fadeOut('fast', function() {
		$('#quote').html("<img src=\"images/quotes/"+whatYear+".gif\" width=\"457\" />");
		$('#quote').fadeIn('slow', function() {
		});
	});
}// END SWAPQUOTE FUNCTION

