//JMCS JavaScript functions
//RMc 13/11/06

//opens a new window 
function newWindow(page) {
	window.open(page,"newWin","width=600,height=600,scrollbars=yes");
}

//-------------next and previous functions for slideshow-------------------

	function processPrevious() {
		if (document.images && thisPic > 0) {
			thisPic--;
			document.getElementById('slide').src=allPix[thisPic];
			document.getElementById('caption').innerHTML = allCaptions[thisPic];
			if (thisPic == 0) {
				document.getElementById('previous').style.display = 'none';
				document.getElementById('next').style.display = 'inline';
			}
			else {
				document.getElementById('previous').style.display = 'inline';
				document.getElementById('next').style.display = 'inline';
			}
		}
	}

	function processNext() {
		if (document.images && thisPic < imgCt) {
			thisPic++;
			document.getElementById('slide').src=allPix[thisPic];
			document.getElementById('caption').innerHTML = allCaptions[thisPic];
			if (thisPic == imgCt) {
				document.getElementById('next').style.display = 'none';
				document.getElementById('previous').style.display = 'inline';
			}
			else {
				document.getElementById('previous').style.display = 'inline';
				document.getElementById('next').style.display = 'inline';
			}
		}
	}
//---------------------------end slideshow functions-------------------------------

//email address cloaking

function contactUs(Dom, User){
  return("mail"+"to:"+User+"@"+Dom.replace(/%23/g,"."));
}

//gallery pix display

function photo_open(link, width, height) {
	var photoWindow = window.open(link,"photo", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width= '+width+',height='+height);
}