if (document.images)
   {
   	 nav1on= new Image(77,42);
     nav1on.src="images/nav-home-over.gif";  
     nav1off= new Image(77,42);
     nav1off.src="images/nav-home.gif";
	 
	 nav2on= new Image(86,42);
     nav2on.src="images/nav-about-over.gif";  
     nav2off= new Image(86,42);
     nav2off.src="images/nav-about.gif";
	 
	 nav3on= new Image(79,42);
     nav3on.src="images/nav-program-over.gif";  
     nav3off= new Image(79,42);
     nav3off.src="images/nav-program.gif";
	 
	 nav4on= new Image(71,42);
     nav4on.src="images/nav-events-over.gif";  
     nav4off= new Image(71,42);
     nav4off.src="images/nav-events.gif";
	 
	 nav5on= new Image(74,42);
     nav5on.src="images/nav-support-over.gif";  
     nav5off= new Image(74,42);
     nav5off.src="images/nav-support.gif";
	 
	 nav6on= new Image(103,42);
     nav6on.src="images/nav-contact-over.gif";  
     nav6off= new Image(103,42);
     nav6off.src="images/nav-contact.gif";
	 
	 nav7on= new Image(94,42);
     nav7on.src="images/nav-bethune-II-over.gif";  
     nav7off= new Image(94,42);
     nav7off.src="images/nav-bethune-II.gif";
	 
	 nav8on= new Image(80,42);
     nav8on.src="images/nav-bethune-over.gif";  
     nav8off= new Image(80,42);
     nav8off.src="images/nav-bethune.gif";
	 
	 subnav1on= new Image(171,35);
     subnav1on.src="images/sub-nav-about-over.png";  
     subnav1off= new Image(171,35);
     subnav1off.src="images/sub-nav-about.png";
	 
	 subnav2on= new Image(140,35);
     subnav2on.src="images/sub-nav-mission-over.png";  
     subnav2off= new Image(140,35);
     subnav2off.src="images/sub-nav-mission.png";
	 
	 subnav3on= new Image(53,43);
     subnav3on.src="images/sub-nav-past-over.png";  
     subnav3off= new Image(53,43);
     subnav3off.src="images/sub-nav-past.png";
	 
	 subnav4on= new Image(58,43);
     subnav4on.src="images/sub-nav-present-over.png";  
     subnav4off= new Image(58,43);
     subnav4off.src="images/sub-nav-present.png";
	 
	 subnav5on= new Image(52,43);
     subnav5on.src="images/sub-nav-future-over.png";  
     subnav5off= new Image(52,43);
     subnav5off.src="images/sub-nav-future.png";
	 
	 subnav6on= new Image(61,43);
     subnav6on.src="images/sub-nav-videos-over.png";  
     subnav6off= new Image(61,43);
     subnav6off.src="images/sub-nav-videos.png";
	 
	 subnav7on= new Image(113,45);
     subnav7on.src="images/sub-nav-students-over.png";  
     subnav7off= new Image(113,45);
     subnav7off.src="images/sub-nav-students.png";
	 
	 subnav8on= new Image(93,45);
     subnav8on.src="images/sub-nav-stories-over.png";  
     subnav8off= new Image(93,45);
     subnav8off.src="images/sub-nav-stories.png";
	 
	 subnav9on= new Image(73,45);
     subnav9on.src="images/sub-nav-p-videos-over.png";  
     subnav9off= new Image(73,45);
     subnav9off.src="images/sub-nav-p-videos.png";
	 
	 subnav10on= new Image(69,48);
     subnav10on.src="images/sub-nav-grants-over.png";  
     subnav10off= new Image(69,48);
     subnav10off.src="images/sub-nav-grants.png";
	 
	 subnav11on= new Image(137,48);
     subnav11on.src="images/sub-nav-corporate-over.png";  
     subnav11off= new Image(137,48);
     subnav11off.src="images/sub-nav-corporate.png";
	 
	 subnav12on= new Image(81,48);
     subnav12on.src="images/sub-nav-individual-over.png";  
     subnav12off= new Image(81,48);
     subnav12off.src="images/sub-nav-individual.png";
	 
	 subnav13on= new Image(97,48);
     subnav13on.src="images/sub-nav-swan-over.png";  
     subnav13off= new Image(97,48);
     subnav13off.src="images/sub-nav-swan.png";
	 
	 subnav14on= new Image(71,48);
     subnav14on.src="images/sub-nav-donate-over.png";  
     subnav14off= new Image(71,48);
     subnav14off.src="images/sub-nav-donate.png";
	 
	 subnav15on= new Image(82,35);
     subnav15on.src="images/sub-nav-history-over.png";  
     subnav15off= new Image(82,35);
     subnav15off.src="images/sub-nav-history.png";
	 
	 subnav16on= new Image(72,35);
     subnav16on.src="images/sub-nav-mission2-over.png";  
     subnav16off= new Image(72,35);
     subnav16off.src="images/sub-nav-mission2.png";
	 
	 subnav17on= new Image(61,35);
     subnav17on.src="images/sub-nav-board-over.png";  
     subnav17off= new Image(61,35);
     subnav17off.src="images/sub-nav-board.png";
	 
	 subnav18on= new Image(77,35);
     subnav18on.src="images/sub-nav-program-over.png";  
     subnav18off= new Image(77,35);
     subnav18off.src="images/sub-nav-program.png";
	 
	 subnav19on= new Image(104,35);
     subnav19on.src="images/sub-nav-bios-over.png";  
     subnav19off= new Image(104,35);
     subnav19off.src="images/sub-nav-bios.png";
	 
	 subnav20on= new Image(98,35);
     subnav20on.src="images/sub-nav-instructors-over.png";  
     subnav20off= new Image(98,35);
     subnav20off.src="images/sub-nav-instructors.png";
	 
	 subnav21on= new Image(125,35);
     subnav21on.src="images/sub-nav-activities-over.png";  
     subnav21off= new Image(125,35);
     subnav21off.src="images/sub-nav-activities.png";
	 
	 subnav22on= new Image(217,35);
     subnav22on.src="images/sub-nav-performances-over.png";  
     subnav22off= new Image(217,35);
     subnav22off.src="images/sub-nav-performances.png";
	 
	 subnav23on= new Image(144,35);
     subnav23on.src="images/sub-nav-events-over.png";  
     subnav23off= new Image(144,35);
     subnav23off.src="images/sub-nav-events.png";
	 
	 subnav24on= new Image(119,35);
     subnav24on.src="images/sub-nav-releases-over.png";  
     subnav24off= new Image(119,35);
     subnav24off.src="images/sub-nav-releases.png";
	 
	 subnav25on= new Image(98,35);
     subnav25on.src="images/sub-nav-newsletters-over.png";  
     subnav25off= new Image(98,35);
     subnav25off.src="images/sub-nav-newsletters.png";
	 
	 subnav26on= new Image(101,35);
     subnav26on.src="images/sub-nav-quotes-over.png";  
     subnav26off= new Image(101,35);
     subnav26off.src="images/sub-nav-quotes.png";
	 
	 subnav27on= new Image(164,35);
     subnav27on.src="images/sub-nav-supporters-over.png";  
     subnav27off= new Image(164,35);
     subnav27off.src="images/sub-nav-supporters.png";
	 
	 subnav28on= new Image(133,35);
     subnav28on.src="images/sub-nav-support-over.png";  
     subnav28off= new Image(133,35);
     subnav28off.src="images/sub-nav-support.png";
	 
	 subnav29on= new Image(103,35);
     subnav29on.src="images/sub-nav-donate-form-over.png";  
     subnav29off= new Image(103,35);
     subnav29off.src="images/sub-nav-donate-form.png";
	 
   }
   
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function lightup(imgName)
 {
   if (document.images)
    {
      imgOn=eval(imgName + "on.src");
      document[imgName].src= imgOn;
    }
 }

function turnoff(imgName)
 {
   if (document.images)
    {
      imgOff=eval(imgName + "off.src");
      document[imgName].src= imgOff;
    }
 }
 
 function hideLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "hidden";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "hidden";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "hidden";
}

}

function showLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "visible";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "visible";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "visible";
}

}

function handleClick(whichClick,theLayer) {

if (whichClick == "hide it") {
// then the user wants to hide the layer
hideLayer(theLayer);

}
else if (whichClick == "show it") {
// then the user wants to show the layer
showLayer(theLayer);
}

}


function putMessage(error_message){
        alert(error_message);
        return false;   
}

function checkEmail(email){
        var email_string = email.value; 
        var at_position = email_string.indexOf('@'); 
        var dot_position = email_string.indexOf('.', at_position); 
        var extension = email_string.substring(dot_position+1,email_string.length); 
        
        if(at_position<0){
                return false; 
        } else if (dot_position<0){
                return false; 
        } else if (extension.length<=0){
                return false; 
        } 
        return true; 
}

function hasValue(obj, obj_type){
    if (obj_type == "TEXT" || obj_type == "PASSWORD"){
        if (obj.value.length == 0) 
                return false;
        else 
                return true;
    } else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX") {
                if (obj.checked)
                        return true;
                else
                return false;   
        } else if (obj_type == "RADIO" || obj_type == "CHECKBOX") {
                for (i=0; i < obj.length; i++){
                        if (obj[i].checked)
                                return true;
                }
                return false;   
        } else  if (obj_type == "SELECT") {
                if (obj.selectedIndex == 0)
                        return false;
                else
                        return true;
        }
}

function hasValue2(obj1, obj2, obj3, obj4, obj5, obj6){
        var flag = 0;
        for (i=1; i < 7; i++){
                if (obj[i].checked)
                        flag = i;
                }
        if (flag == 0)
                return false;
        else
                return true;
}

function  checkFormContact(this_form){
    if  (!hasValue(this_form.firstname, "TEXT" )) {
                if  (!putMessage("Please enter your first name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.lastname, "TEXT" )) {
                if  (!putMessage("Please enter your last name")){
                        return false; 
                }
        }
	if  (!hasValue(this_form.zip, "TEXT" )) {
                if  (!putMessage("Please enter your zip")){
                        return false; 
                }
        }
    if  (!hasValue(this_form.email, "TEXT" )) {
                if  (!putMessage("Please enter your email address")){
                        return false; 
                }
        } else {
                if (!checkEmail(this_form.email)){
                        if  (!putMessage("Please enter valid email address")){
                                return false; 
                        }
                }
        }
		
	
        
        return true;    
}

function  checkFormJoin(this_form){
    if  (!hasValue(this_form.name, "TEXT" )) {
                if  (!putMessage("Please enter your name")){
                        return false; 
                }
        }
    if  (!hasValue(this_form.email, "TEXT" )) {
                if  (!putMessage("Please enter your email address")){
                        return false; 
                }
        } else {
                if (!checkEmail(this_form.email)){
                        if  (!putMessage("Please enter valid email address")){
                                return false; 
                        }
                }
        }
        
        return true;    
}
