// javascript function library for carolwhiteart.com//// changegallery(newgallery)// 		Update gallery color backgrounds to reflect current library.//		Display current gallery images in porfoliobox container.////		arguments:	newgallery - string (1-5) for gallery to display//		globals:	curgallery - string (1-5) for current gallery displayed//		returns:	nothing//function changegallery(newgallery) {			for (i=1; i<6; i++) {	// update color backgrounds of gallery images						var galleryid = 'gallery' + i;			var galleryelement = document.getElementById(galleryid);						if (i == newgallery) {							galleryelement.className = 'thisgallery';			}			else {				galleryelement.className = 'notthisgallery';			}		}		var portboxelement = document.getElementById('portfoliobox');	// replace the html for the new gallery		var portboxhtml = '';		}//// Show and hide elements//function showBubble(whichBubble) {	if (document.getElementById(whichBubble)) {				document.getElementById(whichBubble).style.display = 'block';	}}function hideBubble(whichBubble) {	if (document.getElementById(whichBubble)) {				document.getElementById(whichBubble).style.display = 'none';	}}// display appropriate fields based on dropdown menu choice//		uses showBubble and hideBubble to turn field off and onfunction showfields(choices) {	whichfields = choices.options[choices.selectedIndex].value;	if ((whichfields == 0) || (whichfields == "")) {			hideBubble('subscriberdata');	}	else {			showBubble('subscriberdata');	}}// select option to jump to new pagefunction jumpPage(newLoc) {	newPage = newLoc.options[newLoc.selectedIndex].value;	if (newPage != "") {		window.location = newPage;	}}//////// Useful js for coming features// show photo album function showphotos(album) {	var albumurl = album.options[album.selectedIndex].value;	if (albumurl != "") {		newwindow(albumurl,'photoalbum','width=900, height=600,resizable=1, scrollbars=1, statusbar=0');	}}// open a new windowfunction newwindow(windowurl, windowname, windowparams) {	var nwindow = window.open(windowurl, windowname, windowparams);}function checkPartForm (theForm) {	var why = "";    why += checkEmail(theForm.parishioner.value); //should be .email.     if (why != "") {       alert(why);       return false;    }return true;}//new versionfunction checkSender(theform) {	return checkEmail(theform.sender.value);}function checkEmail (strng) {	var okay=false;	if ((strng == "") || (strng == "Enter your email address here.")) {	   alert("You didn't enter an email address.");	}	else {		var emailFilter=/^.+@.+\..{2,3}$/;		if (!(emailFilter.test(strng))) { 		   alert("Please enter a valid email address.");		}		else {	//test email for illegal characters		   var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/			if (strng.match(illegalChars)) {			  alert("The email address contains illegal characters.");		   }		   else {			   okay = true;		   }		}	}	return okay;    }