// Rollover  v2.0.1
// documentation: http://www.dithered.com/javascript/rollover/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// make sure images end with _off and _on - no jscript inside image tags!


function isDefined(property) {
  return (typeof property != 'undefined');
}

var rolloverInitialized = false;
function rolloverInit() {
   if (!rolloverInitialized && isDefined(document.images)) {
      
      // get all images (including all <input type="image">s)
      // use getElementsByTagName() if supported
      var images = new Array();
      if (isDefined(document.getElementsByTagName)) {
         images = document.getElementsByTagName('img');
         var inputs = document.getElementsByTagName('input');
         for (var i = 0; i < inputs.length; i++) {
            if (inputs[i].type == 'image') {
               images[images.length] = inputs[i];
            }
         }
      }
      
      // otherwise, use document.images and document.forms collections
      // remove if not supporting IE4, Opera 4-5
      else {
         images = document.images;
         inputs = new Array();
         for (var formIndex = 0; formIndex < document.forms.length; formIndex++) {
            for (var elementIndex = 0; elementIndex < document.forms.elements.length; elementIndex++) {
               if (isDefined(document.forms.elements[i].src)) {
                  inputs[inputs.length] = document.forms.elements[i];
               }
            }
         }
      }
      
      // get all images with '_off.' in src value
      for (var i = 0; i < images.length; i++) {
         if (images[i].src.indexOf('_off.') != -1) {
            var image = images[i];
            
            // store the off state filename in a property of the image object
            image.offImage = new Image();
            image.offImage.src = image.src;
            
            // store the on state filename in a property of the image object
            // (also preloads the on state image)
            image.onImage = new Image();
            image.onImage.imageElement = image;
            
            // add onmouseover and onmouseout event handlers once the on state image has loaded
            // Safari's onload is screwed up for off-screen images; temporary fix
            if (navigator.userAgent.toLowerCase().indexOf('safari') != - 1) {
               image.onmouseover = function() {
                  this.src = this.onImage.src;
               };
               image.onmouseout = function() {
                  this.src = this.offImage.src;
               };
            }
            else {
               image.onImage.onload = function() {
                  this.imageElement.onmouseover = function() {
                     this.src = this.onImage.src;
                  };
                  this.imageElement.onmouseout = function() {
                     this.src = this.offImage.src;
                  };
               };
            }
            
            // set src of on state image after defining onload event handler
            // so cached images (that load instantly in IE) will trigger onload
            image.onImage.src = image.src.replace(/_off\./, '_on.');
         }
      }
   }
   rolloverInitialized = true;
}

// call rolloverInit when document finishes loading
if (isDefined(window.addEventListener)) {
   window.addEventListener('load', rolloverInit, false);
}
else if (isDefined(window.attachEvent)) {
   window.attachEvent('onload', rolloverInit);
}


<!--
<!-- BEGIN JAVASCRIPT FOR POPUP WINDOW -->
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

<!-- END JAVASCRIPT FOR POPUP WINDOW -->
//-->


<!--
<!-- BEGIN DATE -->

var showDate_monthFull = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
var showDate_monthShort = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
var showDate_weekdayFull = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
var showDate_weekdayShort = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var today = new Date();

function showDate(string) {	
	if (string.indexOf('_Weekday_') != -1) string = showDateReplace(string, '_Weekday_', 'showDate_weekdayFull', 'getDay');
	if (string.indexOf('_weekday_') != -1) string = showDateReplace(string, '_weekday_', 'showDate_weekdayFull', 'getDay');
	if (string.indexOf('_WEEKDAY_') != -1) string = showDateReplace(string, '_WEEKDAY_', 'showDate_weekdayFull', 'getDay');
	if (string.indexOf('_Wdy_') != -1) string = showDateReplace(string, '_Wdy_', 'showDate_weekdayShort', 'getDay');
	if (string.indexOf('_wdy_') != -1) string = showDateReplace(string, '_wdy_', 'showDate_weekdayShort', 'getDay');
	if (string.indexOf('_WDY_') != -1) string = showDateReplace(string, '_WDY_', 'showDate_weekdayShort', 'getDay');
	
	if (string.indexOf('_DD_') != -1) {
		var pos = string.indexOf('_DD_');
		var day = parseInt(today.getDate());
		if (day.toString.length == 1) day = '0' + day;
		string = string.substring(0, pos) + day + string.substring(pos + 4);
	}
	if (string.indexOf('_D_') != -1) {
		var pos = string.indexOf('_D_');
		string = string.substring(0, pos) + parseInt(today.getDate()) + string.substring(pos + 3);
	}

	if (string.indexOf('_YYYY_') != -1) {
		var pos = string.indexOf('_YYYY_');
		var year = today.getYear();
		if (year < 1000) year += 1900;
		string = string.substring(0, pos) + year + string.substring(pos + 6);
	}
	if (string.indexOf('_YY_') != -1) {
		var pos = string.indexOf('_YY_');
		var year = today.getYear();
		if (year > 99) year = year.toString().substring(year.toString().length - 2);
		string = string.substring(0, pos) + year + string.substring(pos + 4);
	}

	if (string.indexOf('_Month_') != -1) string = showDateReplace(string, '_Month_', 'showDate_monthFull', 'getMonth');
	if (string.indexOf('_month_') != -1) string = showDateReplace(string, '_month_', 'showDate_monthFull', 'getMonth');
	if (string.indexOf('_MONTH_') != -1) string = showDateReplace(string, '_MONTH_', 'showDate_monthFull', 'getMonth');
	if (string.indexOf('_Mon_') != -1) string = showDateReplace(string, '_Mon_', 'showDate_monthShort', 'getMonth');
	if (string.indexOf('_mon_') != -1) string = showDateReplace(string, '_mon_', 'showDate_monthShort', 'getMonth');
	if (string.indexOf('_MON_') != -1) string = showDateReplace(string, '_MON_', 'showDate_monthShort', 'getMonth');
	if (string.indexOf('_MM_') != -1) {
		var pos = string.indexOf('_MM_');
		var month = parseInt(today.getMonth() + 1);
		if (month.toString.length == 1) month = '0' + month;
		string = string.substring(0, pos) + month + string.substring(pos + 4);
	}
	if (string.indexOf('_M_') != -1) {
		var pos = string.indexOf('_M_');
		string = string.substring(0, pos) + parseInt(today.getMonth() + 1) + string.substring(pos + 3);
	}

	document.write(string);
}

function showDateReplace(string, replace, array, dateFunction) {
	var pos = string.indexOf(replace);
	var insert = eval(array + '[today.' + dateFunction + '()]');
	if (replace == replace.toLowerCase) insert = insert.toLowerCase();
	else if (replace == replace.toUpperCase) insert = insert.toUpperCase();
 	return (string.substring(0, pos) + insert + string.substring(pos + replace.length));
}
<!-- END DATE -->
//-->
