// site.com js

function showdatemodified () {
	var modifieddate = document.lastModified;
	window.status = modifieddate;
}

/* rollOvers */
function init()
{
	if (!document.getElementById) return
	var imgOriginSrc;
	var imgTemp = new Array();
	var imgarr = document.getElementsByTagName('img');
	var onSrc = "";
	var offSrc = "";
	var curPage = location.href.substring(location.href.lastIndexOf("/")+1,location.href.lastIndexOf("."));
	for (var i = 0; i < imgarr.length; i++) {
		curImage = imgarr[i].getAttribute('src');
		curImage = curImage.substring(imgarr[i].getAttribute('src').lastIndexOf("nav_")+4,imgarr[i].getAttribute('src').lastIndexOf("_off.gif"));
		if (imgarr[i].getAttribute('hsrc'))
		{
			if (curPage == curImage) {
				imgarr[i].setAttribute('src',imgarr[i].getAttribute('hsrc')+"_on.gif")
			} else {
				imgarr[i].onmouseover = function() {
					this.setAttribute('src',this.getAttribute('hsrc')+"_on.gif")
				}
				imgarr[i].onmouseout = function() {
					this.setAttribute('src',this.getAttribute('hsrc')+"_off.gif")
				} 
			}
		}
	}
}
onload=init;

/* preLoad image */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/* for image swaps (rollOvers affecting secondary images): use this style in the HTML page
<a href="" onMouseOver="document.MyImage.src='image2.gif';" onMouseOut="document.MyImage.src='image1.gif';">
<img src="image.gif" name="MyImage" width="" height="" border="0">
</a>
*/

/*
pop-up window code: Author: Eric King
http://redrival.com/eak/index.shtml
*/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

/* 
pop-up window usage:
<a href="page.htm" onclick="NewWindow(this.href,'main','800','450','no','center');return false" onfocus="this.blur()">LINK</a>
*/

/* MM jump menus */
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

// open new page from jump menus
function there(dropdown) {
//	var windowprops = "location=yes,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes,status=yes";
	var URL = dropdown.options[dropdown.selectedIndex].value;
      if(URL!="") {
           // window.open(URL,"new",windowprops);
           window.open(URL,"new", "");
	  }
}



/* rollOvers on eifsmart.shtml */
JS_enabled = false;
b_name = navigator.appName;
b_ver = parseInt(navigator.appVersion);
if ((b_name == "Netscape" && b_ver >= 3) || 
    (b_name == "Microsoft Internet Explorer" && b_ver >= 4))
	JS_enabled = true;
var load = new Array();         
function rollOver (imgName, fileName, homeFile) {
	if (JS_enabled) {
		document.images[imgName].src =  "images/" + fileName + ".gif";
		document.images["home"].src = "images/" + homeFile + ".gif";
	}
}



// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
//
// Coded by Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
// If want to use this code, feel free to do so, but please leave this message intact.
//
// --- Version Date 8-15-02 --------------------------------------------------------------------------------------------------------------
//
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

var w3c = document.getElementById ? true : false;
var iex = document.all ? true : false;
var ns4 = document.layers ? true : false;

function fixNetscape(){
	if(origWidth != window.innerWidth || origHeight != window.innerHeight){
		window.location.reload();
	}	
}
if(ns4){
	origWidth = window.innerWidth;
	origHeight = window.innerHeight;
	window.onresize = fixNetscape;
}
function newImage(src){
	img = new Image();
	img.src = src;
	return img;
}
function imageSwap(img,obj,div){
	if(ns4 && div != null){
		document.layers[div].document.images[img].src = obj.src;
	}else{
		document.images[img].src = obj.src;
	}
}
function getStyle(name, nest){
	nest = nest ? 'document.'+nest+'.' : '';
	return w3c ? document.getElementById(name).style : iex ? document.all[name].style : ns4 ? eval(nest+'document.'+name) : false;
}

/*** This whole menu section commented out 1/12/2012 by Dan.  
This does not seem to be used but the definition in inline calles to 
createMenu were causing net errors (404) for img_out.gif and img_over.gif


Menus = new Object();
var curMenu = null;

MakeMenu = function(name,left,top,rollimg,rollout,rollover,rolldiv){
	this.name = name;
	this.left = left;
	this.top = top;
	this.timer = null;
	this.rollimg = rollimg;
	this.rollout = newImage(rollout);
	this.rollover = newImage(rollover);
	this.rolldiv = (rolldiv != null) ? rolldiv : null;
	this.obj = name+'Object';
	eval(this.obj+'=this');
}
MakeMenu.prototype.show = function(){
	clearTimeout(this.timer);
	getStyle(this.name).visibility = 'visible';
	imageSwap(this.rollimg,this.rollover,this.rolldiv);
	curMenu = this.name;
}
MakeMenu.prototype.hide = function(){
	this.timer = setTimeout(this.obj+'.hideIt()',500);
}
MakeMenu.prototype.hideIt = function(){
	getStyle(this.name).visibility = 'hidden';
	imageSwap(this.rollimg,this.rollout,this.rolldiv);
}
MakeMenu.prototype.startMenu = function(){
	var html;
	if(ns4){
		html = '<layer name="'+this.name+'" left="'+this.left+'" top="'+this.top+'" z-index="1000" visibility="hidden" ';
	}else{
		html = '<div id="'+this.name+'" style="position:absolute; left:'+this.left+'px; top:'+this.top+'px; z-index:1000; visibility:hidden" ';
	}
	html += 'onMouseOver="Menus.'+this.name+'.show()" onMouseOut="Menus.'+this.name+'.hide()">';
	return html;
}
hideCur = function(){
	if(curMenu != null){
		Menus[curMenu].hideIt();
		curMenu = null;
	}
}
endMenu = function(){
	 return ns4 ? '<\/layer>' : '<\/div>';
}

createMenu = function(name,left,top,rollimg,rollout,rollover,rolldiv){
	Menus[name] = new MakeMenu(name,left,top,rollimg,rollout,rollover,rolldiv);
}

// object name | left position | top position | rollover image name | normal image src | rollover image src | rollover div name (optional)

createMenu('submenu1', 20,  41, 'img_1', 'images/img_out.gif', 'images/img_over.gif');
createMenu('submenu2', 120, 41, 'img_2', 'images/img_out.gif', 'images/img_over.gif');
createMenu('submenu3', 220, 41, 'img_3', 'images/img_out.gif', 'images/img_over.gif');

******/


// image popup

// JK Pop up image viewer script- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com)
// for free JavaScript tutorials and scripts
// This notice must stay intact for use

var popbackground="#9E9E9E" //specify backcolor or background image for pop window
var windowtitle="Image Window"  //pop window title

function detectexist(obj){
return (typeof obj !="undefined")
}

function jkpopimage(imgpath, popwidth, popheight, textdescription){

function getpos(){
leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
if (window.opera){
leftpos-=screenLeft
toppos-=screenTop
}
}

getpos()
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,left='+leftpos+',top='+toppos
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
if (typeof jkpopwin=="undefined" || jkpopwin.closed)
jkpopwin=window.open("","",winattributes)
else{
//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
//jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth, popheight+30)
}
jkpopwin.document.open()
jkpopwin.document.write('<html><title>'+windowtitle+'</title><body '+bodyattribute+'><img src="'+imgpath+'" style="margin-bottom: 0.5em"><br>'+textdescription+'</body></html>')
jkpopwin.document.close()
jkpopwin.focus()
}



