// this is the code for the home nav rollover
if (document.images) {
  about_on = new Image();
  about_on.src = "/img/nav/about_on.gif";
  about_off = new Image();
  about_off.src = "/img/nav/about_off.gif";
  events_on = new Image();
  events_on.src = "/img/nav/events_on.gif";
  events_off = new Image();
  events_off.src = "/img/nav/events_off.gif";
  news_on = new Image();
  news_on.src = "/img/nav/news_on.gif";
  news_off = new Image();
  news_off.src = "/img/nav/news_off.gif";
  research_on = new Image();
  research_on.src = "/img/nav/research_on.gif";
  research_off = new Image();
  research_off.src = "/img/nav/research_off.gif";
  lib_on = new Image();
  lib_on.src = "/img/nav/library_on.gif";
  lib_off = new Image();
  lib_off.src = "/img/nav/library_off.gif";
  help_on = new Image();
  help_on.src = "/img/nav/help_on.gif";
  help_off = new Image();
  help_off.src = "/img/nav/help_off.gif";
  where_on = new Image();
  where_on.src = "/img/nav/where_on.gif";
  where_off = new Image();
  where_off.src = "/img/nav/where_off.gif";
  test_on = new Image();
  test_on.src = "/img/nav/test_on.gif";
  test_off = new Image();
  test_off.src = "/img/nav/test_off.gif";
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

// Drop and Go
function go1(){
if (document.csdropgo.select1.options[document.csdropgo.select1.selectedIndex].value != "none") {
location = document.csdropgo.select1.options[document.csdropgo.select1.selectedIndex].value
		}
	}

// Y2K READY-USE GetFullYear
// DAY Names Javascript is funny Starts the numbering with Zero this array translates to 0...6 to the days of the week
// REMEMBER Arrays have to be written all on ONE(1) line to work

function whatday(){
//var stampdays = new Array( "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 
// Month Names - Guess what this array does. 0..11 to the system clock month
var stampmonths = new Array( "January","February","March","April","May","June","July","August","September","October","November","December");
// GRABS the Date info from your System clock when your Browser reads  enters the page.
var thedate = new Date(); 
//Gets the Translated Arrays written to the webpage for viewing. Remember you can use this for other things, too
document.write(stampmonths[ thedate.getMonth()] + " " + thedate.getDate() + ", " +   thedate.getFullYear()); 
}

// Form validator for FriendMail
function checkFields() {
  missinginfo = "";
  if ((document.friendmail.to_email.value == "") || 
  (document.friendmail.to_email.value.indexOf('@') == -1) || 
  (document.friendmail.to_email.value.indexOf('.') == -1)) {
  missinginfo += "\n     -  To Email Address";
}
  if ((document.friendmail.from_email.value == "") || 
  (document.friendmail.from_email.value.indexOf('@') == -1) || 
  (document.friendmail.from_email.value.indexOf('.') == -1)) {
  missinginfo += "\n     -  From Email Address";
}
  if (missinginfo != "") {
  missinginfo ="_____________________________\n" +
  "You failed to correctly fill in your:\n" +
  missinginfo + "\n_____________________________" +
  "\nPlease re-enter and submit again!";
  alert(missinginfo);
  return false;
}
  else return true;
}

// URL Encode
function strEncode(str){ return escape(str) }

// gets rid of the name@address
function subscribesubmit() {    		
    if(navigator.appName == "Netscape" && navigator.appVersion.charAt(0)=="4"){		
		if(trim(document.subscribe.subscribe_email.value) == "name@address.com"){
			document.subscribe.subscribe_email.value = "";
		}
        var subscribeURL = 'scripts/email.asp?subscribe_email='+escape(document.subscribe.subscribe_email.value);
    	gotoUrl(subscribeURL);        
    	return false;        
    }	
    if(navigator.appName == "Microsoft Internet Explorer" && document.all != null){
        if(trim(document.all.subscribe.subscribe_email.value) == "name@address.com"){			
			document.all.subscribe.subscribe_email.value = "";
		}		
        var subscribeURL = 'scripts/email.asp?subscribe_email='+escape(document.subscribe.subscribe_email.value);        
    	gotoUrl(subscribeURL);
    	return false;        	
    }        
}

function newsval() {
      if (document.newsletter.subscribe_address.value == "name@address.com"){
      missinginfo += "\n     -  Or remove the default";
    }
      if (document.newsletter.subscribe_address.value == ""){
      missinginfo += "\n     -  Email Address";
    }

      if (missinginfo != "") {
      missinginfo ="_____________________________\n" +
      "You failed to correctly fill in your:\n" +
      missinginfo + "\n_____________________________" +
      "\nPlease re-enter and submit again!";
      alert(missinginfo);
      return false;
    }
      else return true;
}

function newspop() {
window.open('/scripts/newsletter.asp?type=newsletter','newsletter','width=375,height=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes')
}
function newspop2() {
newswin=window.open('/scripts/newsletter.asp?type=newsletter','newsletter','width=400,height=500,top=50,left=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes')
newswin.focus();
}

var docTitleURL = "<a href=\"/scripts/mail.asp?type=email&pgtitle=" + strEncode(document.title) + "\" onClick=\"window.open('scripts/mail.asp?type=email&pgtitle=" + strEncode(document.title) + "','friendmail','width=375,height=425,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes')\" target=\"friendmail\">Email this page to a friend</a>"

function printpop() {
window.open('about:blank','print','width=650,height=525,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes');
}
function thanks() {
opener.location.href='/help/donations.asp?type=thanks';return false
window.focus()
}
function copyData(from,to) {
to.value = from.value;
}
