// Check the browser
function browserSniffer() {

	this.browserVersion = parseInt(navigator.appVersion);
	this.browserPlatform = navigator.platform;
	this.browserName = navigator.appName;

	this.isOpera = (this.browserName.indexOf('Opera') > -1) ? true : false;
	this.isNavigator = (this.browserName.indexOf('Netscape') > -1) ? true : false;
	this.isExplorer = (this.browserName.indexOf('Explorer') > -1) ? true : false;
	
	this.isMac = (this.browserPlatform.indexOf('Mac') > -1) ? true : false;
	
	this.isFour = (this.browserVersion == 4) ? true : false;
	
	this.isIE3 = ((this.browserVersion == 3) && (this.isExplorer)) ? true : false;
	this.isNS4 = ((this.browserVersion == 4) && (this.isNavigator)) ? true : false;
	this.isNS6 = ((this.browserVersion == 5) && (this.isNavigator)) ? true : false;
}




// Switch an item's display property
function ShowHideItem(strItemID,strDisplay) {
	var coll = document;
	try{
		var obj = coll.getElementById(strItemID);
		obj.style.display=strDisplay;
	}
	catch(e){}
}



// Pass multiple IDs to toggle display, as well as type of item
function ShowHideMultiple(strItemID,strDisplay,strType) {
	// Determine the browser
  	var sniffer = new browserSniffer();

	// Create arrays of each comma-separated list of items
	var ItemArray = strItemID.split(/,/)
	var DisplayArray = strDisplay.split(/,/)
	var TypeArray = strType.split(/,/)

	ItemCount = ItemArray.length

	for (var i=0; i < ItemCount; i++ ) { 
		var strDisplay = DisplayArray[i]
		if (strDisplay=='block') {
			// If it is Mozilla, use appropriate styles based on type passed in
			if (sniffer.isNavigator) {
				if (TypeArray[i]=='tr') {
					strDisplay = 'table-row'
				} else if (TypeArray[i]=='td') {
					strDisplay = 'table-cell'
				} else if (TypeArray[i]=='li') {
					strDisplay = 'list-item'
				} else if (TypeArray[i]=='table') {
					strDisplay = 'table'
				} else {}
			} else {}
		} else {}
		// Now run the proper toggle function
		ShowHideItem(ItemArray[i],strDisplay);
	}
}
