function startList() {
	navRoot = document.getElementById("main");
	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", "");
  			 }
 		} // end if
  	} // end for
} // end func

function nav(href) {
	window.location = href;
}

function chkform() {
	if ($('fn').value == "") {
		alert("Please enter your name.");
		return false;
	}
	if ($('ph').value == "") {
		alert("Please enter your phone number so that we can contact you.");
		return false;
	}
	$('contactform').submit();
}

function startGallery() {
	$('title').innerHTML = title[1];
	$('photo').innerHTML = "<img src="+image[1]+" alt=\"\" class=\"galleryphoto\" />";
	$('totalmsg').innerHTML = "Photo 1 of "+total;
	$('counter').value = "1";
}

function prev() {
	var counter = $('counter').value;
	var next = parseFloat(counter) - 1;
	if (next < 1) { next = total; }
	$('counter').value = next;
	$('title').innerHTML = title[next];
	$('photo').innerHTML = "<img src="+image[next]+" alt=\"\" class=\"galleryphoto\" />";
	$('totalmsg').innerHTML = "Photo "+next+" of "+total;
}

function next() {

	var counter = $('counter').value;
	var next = parseFloat(counter) + 1;
	if (next > total) { next = 1; }
	$('counter').value = next;
	$('title').innerHTML = title[next];
	$('photo').innerHTML = "<img src="+image[next]+" alt=\"\" class=\"galleryphoto\" />";
	$('totalmsg').innerHTML = "Photo "+next+" of "+total;
}

window.onload=function() {
	Nifty("div#navcol","big");
	Nifty("h1","normal");
	startList();
	if (document.forms[0]) { document.forms[0].fn.focus(); }
	if ($('title')) { 
		startGallery(); 
	}
} // end onload func