//	A simple image gallery.
//	You'll need a placeholder image with the id "placeholder".
//	You'll also need an element with the id "desc" to hold the descriptive text.
//	Feel free to alter this as you see fit.
//	All I ask is that you drop me a line to let me know where you use it.
//	Email me: jeremy at adactio.com

function showPic (whichpic) { 
	if (document.getElementById) { 
		document.getElementById('placeholder').src = whichpic.href; 
		if (whichpic.title) { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
		} else { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		} 
		return false; 
	} else { 
		return true; 
	} 
}

// End Image Gallery

function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

function changeImages() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}

var preloadFlag = false;
function preloadImages() {
  if (document.images) {
    dcw_over = newImage("http://www.ncpa.org/images/dcw-over.gif");
    ssiw_over = newImage("http://www.ncpa.org/images/ssiw-over.gif");
    wew_over = newImage("http://www.ncpa.org/images/wew-over.gif");
    preloadFlag = true;
  }
}

function see_figure(imgURL,imgWidth,imgHeight) { 
  var pageHeight = imgHeight + 16;
  features = 'scrollbars=no,status=no,toolbar=no,menubar=no,location=no,resizable=no,width=' + imgWidth + ',height=' + pageHeight;  
  theURL = 'http://www.ncpa.org/cgi-bin/pop_up.pl?image_url=' + imgURL + '&image_width=' + imgWidth + '&image_height=' + imgHeight;
  window.open(theURL,'',features);
}

function ENewsletterPro_JoinForm_Validator(theForm)
{
if (theForm.Email.value == "")  {
	alert("Please enter a value for the \"Email Address\" field.");
   theForm.Email.focus();
	if (document.getElementById('Email')) {
		var email = document.getElementById('Email');
		email.style.backgroundColor = 'yellow';
	}
   return (false);
}
if (theForm.Email.value.length < 7){
	alert("Please enter at least 7 characters in the \"Email Address\" field.");
   theForm.Email.focus();
	if (document.getElementById('Email')) {
		var email = document.getElementById('Email');
		email.style.backgroundColor = 'yellow';
	}
   return (false);
}
if (theForm.Email.value.length > 255){
	alert("Please enter at most 255 characters in the \"Email Address\" field.");
   theForm.Email.focus();
	if (document.getElementById('Email')) {
		var email = document.getElementById('Email');
		email.style.backgroundColor = 'yellow';
	}
   return (false);
}
if (document.getElementById('name')) {
	var name = document.getElementById('name');
	if (name.value == "") {
		alert("Please enter your name.");
		name.focus();
		name.style.backgroundColor = 'yellow';
		return (false);
	}
}
if (document.getElementById('fname')) {
	var first_name = document.getElementById('fname');
	if (first_name.value == "") {
		alert("Please enter your first name.");
		first_name.focus();
		first_name.style.backgroundColor = 'yellow';
		return (false);
	}
}
if (document.getElementById('lname')) {
	var first_name = document.getElementById('lname');
	if (first_name.value == "") {
		alert("Please enter your last name.");
		first_name.focus();
		first_name.style.backgroundColor = 'yellow';
		return (false);
	}
}
return (true);
}