
	
// BrowserCheck Object
// provides most commonly needed browser checking variables
	
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
	var p = navigator.platform
	//if (p=="MacPPC") this.p = "mac"
	//else this.p = p
}
	
// automatically create the "is" object
is = new BrowserCheck()
	
// determine relevant browser attributes
browser = (document.images) ? 1 : 0;

// preload function
function preLoad(imageName, imageLength, imagePath) {
	if (document.images) {
		if (imagePath == null) {
			imagePath = "img/";
		}
		if (imageLength == null) {
			eval(imageName + " = new Image()");
			eval(imageName + ".src = \"" + imagePath + imageName + ".gif\"");
		} else {
			for (var i=0; i < imageLength; i++) {
				eval(imageName + "_0" + i + " = new Image()");
				eval(imageName + "_0" + i + ".src = \"" + imagePath + imageName + "_0" + i + ".gif\"");
				// unComment to confirm image preloads
				// alert("Loaded: " + imagePath + imageName + "_0" + i)
			}
		}
	}
}
	                                                                                  
/*                      ... highlight function...                 */
	        
	        
function trilight(imageName,imageFile,imgHdr)
{
	if (browser == 1) 
    {
	    document.images[imageName].src = eval(imageFile + ".src");
	    if(imgHdr != null)
	    {
	        document.docHdr.src = eval(imgHdr + ".src");
	    }
	}
}
	
function highlight(imageName,imageFile){
	if (browser == 1) {
		document.images[imageName].src = eval(imageFile + ".src");
	}
}
	
/*		... openWindow function ...		*/
		
function openWindow(url,style) {
	if (style != null) { 
		style = 'menubar=1,toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1';
		windowName = 'viewSite';
	} else { 
		style = 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,dependent=0,width=350,height=400';
		windowName = 'popUp';
	}
	popupWin = window.open(url, windowName, style);
	setTimeout('popupWin.focus()',500);
	if (windowName == 'viewSite') { self.close(); }
}

function OpenConnection(url,style) {
	if (style != null) { 
		style = 'menubar=1,toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1';
		windowName = 'viewSite';
	} else { 
		style = 'menubar=1,toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1,dependent=0,width=600,height=400';
		windowName = 'popUp';
	}
	popupWin = window.open(url, windowName, style);
	setTimeout('popupWin.focus()',500);
	if (windowName == 'viewSite') { self.close(); }
}

	
function submitSearch(sDepth)
{   
    if(document.searchForm.Terms.value != '')
    {
        document.searchForm.action = sDepth+"search/search.pl"
        document.searchForm.submit()
        //alert('Sorry this feature is not functioning.')
    }
}

function MenuOnChange (oSelect)
{
   if (oSelect.selectedIndex > 1)
   {
        window.top.location.href = oSelect.options[oSelect.selectedIndex].value;
   }
   else
   {
        oSelect.selectedIndex = 0
   }
}

var sDate = null;

// Array of day names
//var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
// Array of month Names
var sDate = null;
var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var now = new Date();
sDate = monthNames[now.getMonth()] + " " + now.getDate() +", "+ now.getFullYear();

// preLoad portfolio elements (icon & header)
preLoad('b_lg_00',2,'img/');
preLoad('b_lg_01',2,'img/');
preLoad('b_lg_02',2,'img/');
preLoad('b_lg_03',2,'img/');
preLoad('close',2,'img/');
preLoad('b_sm_00',2,'img/');
preLoad('b_sm_01',2,'img/');
preLoad('b_sm_02',2,'img/');
preLoad('t_lg_00',2,'img/');
preLoad('t_lg_01',2,'img/');
preLoad('t_lg_02',2,'img/');
preLoad('t_sm_00',2,'img/');
preLoad('t_sm_01',2,'img/');
preLoad('t_sm_02',2,'img/');