// JavaScript Document

function switchHero(id) {
	$('hero_' + activeHero).toggle();
	$('hero_' + id).toggle();
	activeHero = id;
}

startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
  node = navRoot.childNodes[i];
  if (node.nodeName=="LI") {
  node.onmouseover=function() {
  this.className+=" over";
    }
  node.onmouseout=function() {
  this.className=this.className.replace
      (" over", "");
   }
   }
  }
 }
}
window.onload=startList;

// open centered windows
function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

Date.prototype.getMonthName = function() {
   return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][this.getMonth()]; 
}

function timestamp() {
	var timestamp = new Date();
	var month = timestamp.getMonthName();
	var hours;
	var mins;
	var time;
	hours = timestamp.getHours();
	if (hours >= 12) {
		time = " PM";
	}
	else {
		time = " AM";
	}
	if (hours > 12) {
		hours -= 12;
	}
	if (hours == 0) {
		hours = 12;
	}
	mins = timestamp.getMinutes();
	if (mins < 10) {
		mins = "0" + mins;
	}	
	/*document.write(hours + ":" + mins + time+" &nbsp;");*/
	document.write(timestamp.getDate()+" "+month+", "+timestamp.getFullYear());
}

// country select dropdown for dealers
var prevCountry = "";
function toggle_country(theCountry) {
	if (prevCountry != "") {
		Element.toggle(prevCountry);
	}
	Element.toggle(theCountry);
	prevCountry = theCountry;
}
