// JavaScript Document
if (document.images)	{
var imglist = new Array('home','map','search','schedule','links','contact','search-but','search-but2');
var imgs = new Array(); var count;
	for (count=0; count<imglist.length; count++)
	{imgs[count]=new Image(); imgs[count].src="i/nav/" + imglist[count] + "-on.gif";}
      }
// Flip it on
function roll(imgName) {
	if (document.images) { document[imgName].src = "i/nav/" + imgName + "-on.gif" }
}
// Flip it off
function out(imgName) {
	if (document.images)  {	document[imgName].src = "i/nav/" + imgName + ".gif"	}
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,copyhistory=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

//****************************//

//use the following var to remember an image's original src value
//the imageRoll function will constantly update this value, allowing the imageOut function to use its current value
var imageSourceValue = '';
function imageRoll(imageObject)
{
	//store the current src value
	imageSourceValue = imageObject.src;
	//grab the directory from the src attribute
	var folderIndex = imageObject.src.lastIndexOf("/");
	var theDirectory = imageObject.src.substring(0,folderIndex+1);//returns the DIR in the form http://domain.com/folder
	//test for image file type, jpg v. gif
	var extIndex = imageObject.src.lastIndexOf(".");
	
	var theFileName = imageObject.src.substring(folderIndex+1,extIndex);//returns the filename in the form NAME
	var theFileType = imageObject.src.substring(imageObject.src.length-(imageObject.src.length-extIndex-1));//grab the extension
	
	imageObject.src=theDirectory+'/'+theFileName+'-on.'+theFileType;
}
function imageOut(imageObject)
{
	//retrieve the original image src attribute
	imageObject.src = imageSourceValue;
}
/***********************/

// Begin email checker
function enewsCheck(f) {
	
	//f is form reference
	var re = new RegExp("^[A-Za-z0-9_-]+[A-Za-z0-9_\.\-]*[A-Za-z0-9_-]+@[A-Za-z0-9_-]+[A-Za-z0-9\.-]*\\.[a-zA-Z]{2,4}$","i");
	
	if(! re.test(f.email.value)){		
			alert("Your email address is invalid.");
	}
	else if(f.zip.value == ""){alert("Please enter your zip code.");}
	else document.form1.submit();
}

/*function outgoing_links() {
	var links = document.getElementsByTagName("a");
	var urlRe = new RegExp("http:\/\/((www\.)?)([a-zA-Z0-9\\_\\-\\.]*)\.([a-zA-Z]{1,5})/");
	for(i=0;i<links.length;i++) {
		if(links[i].href.toLowerCase().indexOf("dev.landandcamps.com") == -1 && urlRe.test(links[i].href)) {
			links[i].onclick=function() {
				pageTracker._trackPageview("/outgoing/"+this.href);
			};
		}
		if(links[i].href.toLowerCase().indexOf("dev.landandcamps.com/files") != -1 && urlRe.test(links[i].href)) {
			links[i].onclick=function() {
				pageTracker._trackPageview("/file/"+this.href);
			};
		}
	}
}
*/