//platform and browser check
browser = new BrowserCheck();
function BrowserCheck() 
{
	var b = navigator.appName
	// convert all characters to lowercase to simplify testing
    var agt = navigator.userAgent.toLowerCase()
	
	// get platform
	this.win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) )
	this.mac = (agt.indexOf("mac")!=-1)
	// get browser
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.is_major = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.is_major>=4)
	this.ns4 = (this.b=="ns" && this.is_major==4)
	this.ns5 = (this.b=="ns" && this.is_major==5)
	this.ie = (this.b=="ie" && this.is_major>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.is_major = 5
	this.min = (this.ns || this.ie)
}


//open new browser window
var newWin = null;	
function createNewWindow(strURL)
{	
    closeNewWindow(); 
    newWin = window.open(strURL,"","toolbar=yes,scrollbars=yes,resizable=yes,height=600,width=800,left=10,top=10");
}

function closeNewWindow()
{
    if(newWin != null)
    {
        newWin.close();
    }
}

//preLoad images
if (document.images) {
	subOn = new Image(13,11)
	subOn.src = "/images/m_uparrow_on.gif"
	subOff = new Image(13,11)
	subOff.src = "/images/m_uparrow_off.gif"

	sub15On = new Image(13,11)
	sub15On.src = "/images/m_uparrow_on.gif"
	sub15Off = new Image(13,11)
	sub15Off.src = "/images/m_uparrow_off.gif"

	m0_On = new Image(90,26)
	m0_On.src = "/images/asp_on.gif"
	m0_Off = new Image(90,26)
	m0_Off.src = "/images/asp_off.gif"

	m1_On = new Image(90,26)
	m1_On.src = "/images/url_on.gif"
	m1_Off = new Image(90,26)
	m1_Off.src = "/images/url_off.gif"

	m2_On = new Image(90,26)
	m2_On.src = "/images/contact_on.gif"
	m2_Off = new Image(90,26)
	m2_Off.src = "/images/contact_off.gif"

	m3_On = new Image(90,26)
	m3_On.src = "/images/home_on.gif"
	m3_Off = new Image(90,26)
	m3_Off.src = "/images/home_off.gif"

	m4_On = new Image(90,26)
	m4_On.src = "/images/nav_main_on.gif"
	m4_Off = new Image(90,26)
	m4_Off.src = "/images/nav_main_off.gif"

	m5_On = new Image(90,26)
	m5_On.src = "/images/nav_main_on.gif"
	m5_Off = new Image(90,26)
	m5_Off.src = "/images/nav_main_off.gif"
	}

function menuOver() {
	this.isOn = true
	this.showMenu(true)
	this.document.images[(this.document.images.length -1)].src = this.hOn.src
	}

function menuOut() {
	this.isOn = false
	this.showMenu(false)
	this.document.images[(this.document.images.length -1)].src = this.hOff.src
}

// Rollover Functions
//which = image name, what = true or false
	function doRO(which,what) {
	//alert(which + ' ' + what)
	//theLayer = which.split("_")
	//where = theLayer[0]
	eval('document.images["' + which + '"].src =  ' + what + '.src') ;
	} 

// Show-Hide Menus
//where x=image name and t=true and f=false
function showMenu(x,tf) {
	if(document.readyState == "complete"){
		//alert(x + ' ' + tf)
		curNav = (x + "_head")
		curPix = (tf) ? (x + "_On") : (x + "_Off");
		doRO(curNav,curPix);
		theLayer = eval("document.all['" + x + "']")
		theLayer.style.visibility = (tf) ? "visible" : "hidden";
		//theLayer.style.clip = (tf) ? "rect(0,180,150,0)" : "rect(77,150,150,35)";
		}
	}

// Show-Hide Drop Down Menus
function dropMenu(x,tf) {
	if(document.readyState == "complete"){
		curNav = ("menus2_" + x + "_head")
		curPix = (tf) ? (x + "_On") : (x + "_Off");
		doRO(curNav,curPix)
		theLayer = eval("document.all['" + x + "']")
		theLayer.style.visibility = (tf) ? "visible" : "hidden";
		}
	}
	
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images ) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

//random quotes for navbar.asp
myQuotes = new Array();
myQuotes[0] = "'In this world of extremes, we can only love too little'<BR> -Rich Cannarella";
myQuotes[1] = "'To love for the sake of being loved is human, but<BR> to love for the sake of loving is angelic'<BR> -Alphonse de Lemartine" ;
myQuotes[2] = "'How we spend our days is, of course, how we spend our lives'<BR> -Annie Dillard" 
myQuotes[3] = "'Laziness is nothing more than the habit of resting before you get tired'<BR> -Jules Renard"		
myQuotes[4] = "'To hide the key to your heart is to risk forgetting where you placed it'<BR> -Timothy P. Childers" ;
myQuotes[5] = "'Intense love does not measure, it just gives'<BR> -Mother Teresa";
myQuotes[6] = "'Life is too important to be taken seriously'<BR> -Oscar Wilde";

function displayQuote()
{
	myIndex = Math.round(Math.random() * 6);
	document.write(myQuotes[myIndex]); 
}