// JavaScript Document
<!-- //
var contactWin = ''; //set up popup window for emailing
var newwindow = ''; //set up popup window for other windows
var activePic=0; //set to start on cover

function contactUs() {
	var url = 'http://www.cobscook.org/contactUs.php';
	if (!contactWin.closed && contactWin.location) {
		contactWin.location.href = url;
	}
	else {
		var width='450';
		var height='260';
		contactWin=window.open(url,'emailer','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width='+width+', height='+height);
		if (!contactWin.opener) contactWin.opener = self;
	}
	if (window.focus) {contactWin.focus()}
	return false;
}
function openWindow(url,winName,size) {
	if (!newwindow.closed && newwindow.location) {
		newwindow.location.href = url;
	}
	else {
		newwindow=window.open(url,winName,'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, '+size);
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	return false;
}
function showPic() { // re-writes html for panel 1 to display new photo
	var htmlout = "<img class='imageBorder' src='" + photos[activePic].src + "' />";
	document.getElementById('panel1').innerHTML=htmlout;
}
function showNext() { //scrolls through collection of images from pre-loaded array
	if(activePic==(photos.length-1))
		activePic=0;
	else
		activePic++;
	showPic();
}
function showPrev() { //scrolls through collection of images from pre-loaded array
	if(activePic==0)
		activePic=(photos[active].length-1);
	else
		activePic--;
	showPic();
}
// -->
