//Netscape CSS
function bName() {
	// return 2 for Navigator
		if (navigator.appName == "Netscape")
			return 2;
	// return 0 for other browsers
		return 0;
	}
	
var platform = 0;
var nameCode = bName();
var bVer = parseFloat(navigator.appVersion);

if (navigator.userAgent.indexOf("Win") != -1) platform = 2;
else platform = 0;

if (platform == 2) {
	if ((nameCode == 2) && (bVer <= 5)) {
		document.write ('<link rel="stylesheet" href="/stylesheets/defaultNSPC.css">');
		}
} 


// The Super Class of all NavObject //
function NavObject (label, href) {
	this.label = label;
	this.href = href;
}
	function NavObject_write () {
		document.write ('<a href="' + this.href + '">' + this.label + '</a>')
	}
	function NavObject_writeCurrent () {
		document.write ('<a href="' + this.href + '">' + this.label + '</a>')
	}
	function NavObject_writeOption () {
		return ('<option value="' + this.href + '">' + this.label + '</option>');
	}
new NavObject (0,0);
NavObject.prototype.write = NavObject_write;
NavObject.prototype.writeCurrent = NavObject_writeCurrent;
NavObject.prototype.writeOption = NavObject_writeOption;



// Site Special NavObject
function SiteSpecial (label, href) {
	this.label = label;
	this.href = href;
}
	function SiteSpecial_write (currentLabel) {
		document.write ('<tr><td width="2" background="/images/l/special/lt.gif"><img src="/images/l/special/lt.gif" width="2" height="3" border="0"></td><td width="96" background="/images/l/special/t.gif"><img src="/images/l/special/t.gif" width="96" height="3" border="0"></td><td width="2" background="/images/l/special/rt.gif"><img src="/images/l/special/rt.gif" width="2" height="3" border="0"></td></tr><tr><td background="/images/l/special/l.gif"><img src="/images/l/special/l.gif" width="2" height="18" border="0"></td><td bgcolor="#666600"><table cellpadding="2" cellspacing="0" border="0" width="100%"><tr><td class="siteSpecial"><a href="' + this.href + '">' + this.label + '</a></td></tr></table></td><td background="/images/l/special/r.gif"><img src="/images/l/special/r.gif" width="2" height="18" border="0"></td></tr><tr><td background="/images/l/special/lb.gif"><img src="/images/l/special/lb.gif" width="2" height="3" border="0"></td><td background="/images/l/special/b.gif"><img src="/images/l/special/b.gif" width="96" height="3" border="0"></td><td background="/images/l/special/rb.gif"><img src="/images/l/special/rb.gif" width="2" height="3" border="0"></td></tr>');
	}
SiteSpecial.prototype = new NavObject (0,0);
SiteSpecial.prototype.write = SiteSpecial_write;



// Business Resources NavObject
function BizRez (label, href) {
	this.label = label;
	this.href = href;
}
	function BizRez_write () {
		document.write ('<tr><td colspan="3"><img src="/images/leftnav/top.gif" width="130" height="4"></td></tr><tr><td><img src="/images/global/spacer.gif" width="1" height="1"></td><td><a href="/cgi-bin/portal.pl?id=' + this.href + '" class="leftNav">' + this.label + '</a></td><td><img src="/images/global/spacer.gif" width="1" height="1"></td></tr><tr><td colspan="3"><img src="/images/global/spacer.gif" width="130" height="3"></td></tr>');
	}
BizRez.prototype = new NavObject (0,0);
BizRez.prototype.write = BizRez_write;



// Magazine Red Button NavObject
function MagRed (label, href) {
	this.label = label;
	this.href = href;
}
	function MagRed_write (currentLabel) {
		if (currentLabel == this.label) {
			if (this.label == 'Back To Crain\'s Front Page') {
				return '';
			}
		}
		else {
			document.write ('<tr><td width="2" background="/mag/images/redbutton/lt.gif"><img src="/mag/images/redbutton/lt.gif" width="7" height="2" border="0"></td><td width="96" background="/mag/images/redbutton/t.gif"><img src="/mag/images/redbutton/t.gif" width="106" height="2" border="0"></td><td width="2" background="/mag/images/redbutton/rt.gif"><img src="/mag/images/redbutton/rt.gif" width="7" height="2" border="0"></td></tr><tr><td background="/mag/images/redbutton/l.gif"><img src="/mag/images/redbutton/l.gif" width="7" height="18" border="0"></td><td bgcolor="#b70303"><table cellpadding="3" cellspacing="0" border="0" width="100%"><tr><td class="redButton"><a href="' + this.href + '">' + this.label + '.</a></td></tr></table></td><td background="/mag/images/redbutton/r.gif"><img src="/mag/images/redbutton/r.gif" width="7" height="18" border="0"></td></tr><tr><td background="/mag/images/redbutton/lb.gif"><img src="/mag/images/redbutton/lb.gif" width="7" height="2" border="0"></td><td background="/mag/images/redbutton/b.gif"><img src="/mag/images/redbutton/b.gif" width="106" height="2" border="0"></td><td background="/mag/images/redbutton/rb.gif"><img src="/mag/images/redbutton/rb.gif" width="7" height="2" border="0"></td></tr>');
		}
	}
MagRed.prototype = new NavObject (0,0);
MagRed.prototype.write = MagRed_write;


//Internal Nav Object
function InternalNavItem (label, value) {
	this.label = label;
	this.value = value;
}
	function InternalNavItem_write (selectionName, selectionIndexNum) {
		selectionName.options[selectionIndexNum] = new Option (this.label, this.value);
	}

new InternalNavItem (0,0);
InternalNavItem.prototype.write = InternalNavItem_write;



function InternalNav (name) {
	this.name = name;
	this.InternalNavArray = [];
}
	function InternalNav_write (selectionName) {
		for (var i = 0; i < this.InternalNavArray.length; i++) {
			this.InternalNavArray[i].write (selectionName, i);
		}
	}
	function InternalNav_addItem (intnavItem) {
		this.InternalNavArray[this.InternalNavArray.length] = intnavItem;
	}
	function InternalNav_addItemArray (intnavItemArray) {
		for (var i = 0; i < intnavItemArray.length; i++) {
			this.addItem (intnavItemArray[i]);
		}
	}
new InternalNav (0);
InternalNav.prototype.write = InternalNav_write;
InternalNav.prototype.addItem = InternalNav_addItem;
InternalNav.prototype.addItemArray = InternalNav_addItemArray;



function InternalNavGet (thisSelection) {
	if (thisSelection.options[thisSelection.selectedIndex].value != "") {
		window.location.href = thisSelection.options[thisSelection.selectedIndex].value;
	}
}





// Function to drawEveryNavObject from an array
function drawAllNavObjects (navArray, currentLabel) {
	if (currentLabel == null) {
		currentLabel = '';
	}
	for (i=0; i < navArray.length; i++) {
		navArray[i].write (currentLabel);
	}
}

// Function to drawDropDownMenu from an array
function sortNavObject (a, b) {
	var aL = a.label.toLowerCase();
	var bL = b.label.toLowerCase();
	
	if (aL > bL) {
		return 1;
	}
	else if (aL == bL) {
		return 0;
	}
	else {
		return -1;
	}
}
function drawDropDownMenu (navArray, width, fontsize) {
	navArray.sort (sortNavObject);
	for (i=0; i < navArray.length; i++) {
        var labelText = navArray[i].label;

//        if (labelText.length > 18) {
//            labelText = labelText.substr (0,17) + "...";
//        }

		document.alphaSite.elements[0].options[i+1] = new Option (labelText, navArray[i].href);
	}
}




