

	
// ::::: css rollover menu functions for home page  :::::

/* rollover function*/
	function chgImg(imgField,newImg) {
		if (document.images) {
			document[imgField].src= eval(newImg + ".src")
		}
	}
	
   if (document.layers){
      //Netscape 4 specific code
      pre = 'document.';
      post = '';
   }
   if (document.getElementById){
      //Netscape 6 specific code
      pre = 'document.getElementById("';
      post = '").style';
   }
   if (document.all){
      //IE4+ specific code
      pre = 'document.all.';
      post = '.style';
   }

// set currentLayer to the bottom (default) layer that is visible when menus are closed 
var currentLayer = 'sealbg';

   function showLayer(lyr){
      hideLayer(currentLayer);
      eval(pre + lyr + post).visibility = 'visible';
      currentLayer = lyr;
   }
   function hideLayer(lyr){
      eval(pre + lyr + post).visibility = 'hidden';
   }
   
/* preload images function */   
  	function preloadImages() {
   if (document.images) {
      for (var i = 0; i < preloadImages.arguments.length; i++) {
         (new Image()).src = preloadImages.arguments[i];
      }
   }
}



/* ******* FLASH OBJECT/EMBED SCRIPT  ******************************/
/*
 * FlashObject embed
 * http://blog.deconcept.com/2004/10/14/web-standards-compliant-javascript-flash-detect-and-embed/
 *
 * by Geoff Stearns (geoff@deconcept.com, http://www.deconcept.com/)
 *
 * v1.0.7 - 11-17-2004
 *
 * Create and write a flash movie to the page, includes detection
 *
 * Usage:
 *
 *	myFlash = new FlashObject("path/to/swf.swf", "swfid", "width", "height", flashversion, "backgroundcolor");
 *	myFlash.altTxt = "Upgrade your Flash Player!";                // optional
 *	myFlash.addParam("wmode", "transparent");                     // optional
 *	myFlash.addVariable("varname1", "varvalue");                  // optional
 *	myFlash.addVariable("varname2", getQueryParamValue("myvar")); // optional
 *	myFlash.write();
 *
 */

FlashObject = function(swf, id, w, h, ver, c) {
	this.swf = swf;
	this.id = id;
	this.width = w;
	this.height = h;
	this.version = ver || 6; // default to 6
	this.align = "middle"; // default to middle
	this.redirect = "";
	this.sq = document.location.search.split("?")[1] || "";
	this.altTxt = "Please <a href='http://www.macromedia.com/go/getflashplayer'>upgrade your Flash Player</a>.";
	this.bypassTxt = "<p>Already have Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player "+ this.version +" installed</a>.</p>";
	this.params = new Object();
	this.variables = new Object();
	if (c) this.color = this.addParam('bgcolor', c);
	this.addParam('quality', 'high'); // default to high
	this.doDetect = getQueryParamValue('detectflash');
}

FlashObject.prototype.addParam = function(name, value) {
	this.params[name] = value;
}

FlashObject.prototype.getParams = function() {
    return this.params;
}

FlashObject.prototype.getParam = function(name) {
    return this.params[name];
}

FlashObject.prototype.addVariable = function(name, value) {
	this.variables[name] = value;
}

FlashObject.prototype.getVariable = function(name) {
    return this.variables[name];
}

FlashObject.prototype.getVariables = function() {
    return this.variables;
}

FlashObject.prototype.getParamTags = function() {
    var paramTags = "";
    for (var param in this.getParams()) {
        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
    }
    if (paramTags == "") {
        paramTags = null;
    }
    return paramTags;
}

FlashObject.prototype.getHTML = function() {
    var flashHTML = "";
    if (window.ActiveXObject && navigator.userAgent.indexOf('Mac') == -1) { // PC IE
        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';
        flashHTML += '<param name="movie" value="' + this.swf + '" />';
        if (this.getParamTags() != null) {
            flashHTML += this.getParamTags();
        }
        if (this.getVariablePairs() != null) {
            flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
        }
        flashHTML += '</object>';
    }
    else { // Everyone else
        flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
        for (var param in this.getParams()) {
            flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
        }
        if (this.getVariablePairs() != null) {
            flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
        }
        flashHTML += '></embed>';
    }
    return flashHTML;	
}


FlashObject.prototype.getVariablePairs = function() {
    var variablePairs = new Array();
    for (var name in this.getVariables()) {
        variablePairs.push(name + "=" + escape(this.getVariable(name)));
    }
    if (variablePairs.length > 0) {
        return variablePairs.join("&");
    }
    else {
        return null;
    }
}

FlashObject.prototype.write = function(elementId) {
	if(detectFlash(this.version) || this.doDetect=='false') {
		if (elementId) {
			document.getElementById(elementId).innerHTML = this.getHTML();
		} else {
			document.write(this.getHTML());
		}
	} else {
		if (this.redirect != "") {
			document.location.replace(this.redirect);
		} else {
			if (elementId) {
				document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;
			} else {
				document.write(this.altTxt +""+ this.bypassTxt);
			}
		}
	}		
}

function getFlashVersion() {
	var flashversion = 0;
	if (navigator.plugins && navigator.plugins.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if(x){
			if (x.description) {
				var y = x.description;
	   			flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
	} else {
		result = false;
	    for(var i = 15; i >= 3 && result != true; i--){
   			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
   			flashversion = i;
   		}
	}
	return flashversion;
}

function detectFlash(ver) {	
	if (getFlashVersion() >= ver) {
		return true;
	} else {
		return false;
	}
}

// get value of querystring param
function getQueryParamValue(param) {
	var q = document.location.search;
	var detectIndex = q.indexOf(param);
	var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;
	if(q.length > 1 && detectIndex != -1) {
		return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
	} else {
		return "";
	}
}

/* add Array.push if needed */
if(Array.prototype.push == null){
	Array.prototype.push = function(item){
		this[this.length] = item;
		return this.length;
	}
}


/* ************END FLASH SCRIPT *****************************/


// ::::: script to load random banner images :::::
// note: set interval to a large number to effectively disable live rotation of images
// note: if random_display is set to "0", images rotate consecutively
   

var interval = 200; // delay between rotating images (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new
imageItem("images/syshome/sys01.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys02.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys03.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys04.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys05.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys06.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys07.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys08.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys09.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys10.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys11.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys12.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys13.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys14.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys15.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys16.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys17.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys18.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys19.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys20.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys21.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys22.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys23.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys24.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys25.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys26.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys27.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys28.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys29.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys30.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys31.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys32.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys33.jpg");
image_list[image_index++] = new
imageItem("images/syshome/sys34.jpg");
/*
image_list[image_index++] = new
imageItem("images/syshome/sys35.jpg");
*/
image_list[image_index++] = new
imageItem("images/syshome/sys36.jpg");




var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}