﻿	// create function for random home images - include <body onLoad="showDiv()">	
		var random = Math.random() ;
		var MsgNum = Math.round(random*3)+1;  //change number according to total images
		var subs_array = new Array('sub1','sub2', 'sub3', 'sub4');
		
//called onLoad to display a different image on refresh
	function showDiv(){
		var thisSub = 'sub'+ MsgNum
		document.getElementById(thisSub).style.display = "";
	}	

//---------------------------------------

	//create copyright year function
	    function currentYear(){
		var today = new Date();
		var thisYear = today.getFullYear();
		document.write(thisYear);
	}

//--------------------------------------

	//function for daily date
		function writeDate(){
		var today = new Date();
        var month = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
        var monthName = month[today.getMonth()];
        document.write( monthName +" " + today.getDate() +", " + today.getFullYear());
	}
	
//--------------------------------------	
	
	//function for drop panels - insert vars into the page head
	//The script has been modified to swap the plus and minus image as the divs are being
	//hidden or displayed
		function displaySubs(the_sub, img){	
	//if the div 'the_sub' is visible hide it and change the image to plus
	//then exit the function
		if (document.getElementById(the_sub).style.display==""){
		var imgString = document.getElementById(img).src ;
		document.getElementById(img).src =imgString.replace('minus.gif','plus.gif');
		document.getElementById(the_sub).style.display = "none";return
	
 	 }
	//the_sub is not visible but we want to make sure that no others are visible 
	//loop through all divs and hide them; set all images to plus
	  	for (i=0;i<subs_array.length;i++){
  
		var my_sub = document.getElementById(subs_array[i]);
		var my_img = img_array[i];
		imgString = document.getElementById(img_array[i]).src;
		document.getElementById(img_array[i]).src = imgString.replace('minus.gif','plus.gif');
		my_sub.style.display = "none";
		}
	
//display the requested div; set the image to a minus
	  	document.getElementById(the_sub).style.display = "";
	  	imgString = document.getElementById(img).src ;
		document.getElementById(img).src =imgString.replace('plus.gif','minus.gif');
		
}
  
  function swapImage(img){
	var imgString = img.src;
	
	if(imgString.substring(imgString.length - 9) == '/plus.gif'){
		img.src = imgString.replace('plus.gif','minus.gif')
		}
	else{
		img.src = imgString.replace('minus.gif','plus.gif')
		}
	
}

//opens windows, this funtion is used a lot with legacy code
	function MM_openBrWindow(theURL,winName,features) { //v2.0
  	window.open(theURL,winName,features);
}

