// JavaScript Document

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", "");
   }
   }
  }
 }
}

function startList1() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav1");
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", "");
   }
   }
  }
 }
}

//for Barrons page

function show(n)
	{
	if (document.getElementById)
		{
		var text0 = document.getElementById("t0");
		var text1 = document.getElementById("t1");
		var text2 = document.getElementById("t2");
		var text3 = document.getElementById("t3");
		var text4 = document.getElementById("t4");
		var text5 = document.getElementById("t5");
		var text6 = document.getElementById("t6");
		var text7 = document.getElementById("t7");

		
		for(i=0;i<=7;i++) // hide all text boxes
			{
			eval("text"+i).style.visibility = "hidden";
			}
			// then show the one we want
		eval("text"+n).style.visibility = "visible";
		}
	else
		{
		return false;
		}
	}


function pageName(URLpathName)
{
	var urlpath = URLpathName.toString();
	urlLastSlash = URLpathName.lastIndexOf('/');
	pageName = URLpathName.substring(urlLastSlash+1);

	return pageName;
	//alert(pageName);
}

function lc(URLpathName1)
{
	var urlpath1 = URLpathName1.toString();
	urlLastSlash1 = URLpathName1.lastIndexOf('/');
	
	urlLocation = URLpathName1.search('camping');
	lc = URLpathName1.substring(urlLocation, urlLastSlash1+1);
	
	return lc;	
	//alert(lc);
}

function checkForm() {
	if(document.contactusForm.name.value == "")
	{
		document.getElementById('name').style.border = "3px solid #cc0000";
	}
	else if (document.contactusForm.email.value == "")
	{
		document.getElementById('email').style.border = "3px solid #cc0000";
	}
	else if(document.contactusForm.email.value.indexOf('@') < 0) {
		document.getElementById('email').style.border = "3px solid #cc0000";
	}
	else if (document.contactusForm.comments.value == "")
	{
		document.getElementById('comments').style.border = "3px solid #cc0000";
	}

	else
	{
		document.contactusForm.submit();	
	}
}