/*
	config.js ver.1.5
	update: 2003.8.24
*/

// ////////////////////////////////////
//  getUA
// ////////////////////////////////////

function getUA() {
	var usrAgt = navigator.userAgent;
	var appNam = navigator.appName;
	var appVer = navigator.appVersion;
	
	this._dom = document.getElementById;
	this._all = document.all;
	
	// Browsers
	this.sfr = this._dom && usrAgt.indexOf('AppleWebKit') != -1;			// Safari (OmniWeb 4.5+)
	this.moz = this._dom && usrAgt.indexOf('Gecko/') != -1					// Mozilla (Netscape)
	this.op  = usrAgt.indexOf('Opera') != -1 && this._dom;					// Opera
	this.ie  = usrAgt.indexOf('MSIE') != -1 && this._all && !this.op;		// IE
	this.nn4 = appNam.indexOf('Netscape') != -1 && 
				usrAgt.indexOf('Mozilla/4') != -1 && !this.op;				// Netscape 4
	
	// Browser Version
	this.brwsVer = (this.ie) ? parseInt(appVer.split('MSIE ')[1]) : 
				(this.op) ? parseInt(usrAgt.split('Opera ')[1]) : parseInt(appVer);
	this.stdVer = this.brwsVer > 4;
	
	// Platform
	this.mac = usrAgt.indexOf('Mac') != -1;
	this.win = usrAgt.indexOf('Windows') != -1;
	this.otrOS = !this.mac && !this.win;
	
	this.macIE = this.mac && this.ie;
	
	// CSS
	this.cssMac = '_mac.css';
	this.cssWinOp = '_winOpera.css';
	
	if (this.mac && this.stdVer) this.css = this.cssMac;
	if (this.win && this.op && this.stdVer) this.css = this.cssWinOp;
}


// createLinkElement
function createLinkElement(cssDir, cssFile) {
	linkHref = cssDir + cssFile;
	linkRel = 'stylesheet';
	linkType = 'text/css';
	
	if (document.documentElement && ua.stdVer && !ua.macIE) {
		tagLink = document.createElement('link');
		tagLink.rel = linkRel;
		tagLink.type = linkType;
		tagLink.href = linkHref;
		document.getElementsByTagName('head')[0].appendChild(tagLink);
	} else {
		document.write('<link rel=\"' + linkRel + '\" type=\"' + linkType + '\" href=\"' + linkHref + '\">');
	}
}


// appendCSS
function appendCSS(cssDir) {
	if (ua.css) {
		createLinkElement(cssDir, ua.css);
	}
}

var ua = new getUA();

// CSS dropdown menu for IE
startList = function() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById('navigationItems');
		for (i = 0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName == 'LI') {
				node.onmouseover = function() {
					this.className += ' over';
				}
				node.onmouseout = function() {
					this.className=this.className.replace(' over', '');
				}
			}
		}
	}
}
window.onload = startList;