function changeOpacity(ele, opacity) {
	//An undefined var for faster and cleaner comparison
	var undefined;
	
	//Change the opacity in mainstream browsers
	ele.style.opacity = opacity;
	ele.style.filter = "alpha(opacity=" + (opacity * 100) + ")";
	
	//The following isn\'t supported by IE, so...
	if (ele.style.setProperty !== undefined) {
		ele.style.setProperty("-moz-opacity", opacity, "");
		ele.style.setProperty("-khtml-opacity", opacity, "");
	}
}

function add_event(ele, event_type, event) {
	if (window.addEventListener) {
		ele.addEventListener(event_type, event, false);
	}
	else if (window.attachEvent) {
		ele.attachEvent('on' + event_type, event);
	}
	else {
		ele['on' + event_type] = event;
	}
}

function highlight(id, colorString) {
	if (colorString !== null) {
		document.getElementById(id).style.backgroundColor = colorString;
	}
}

function unHighlight(id, colorString) { 
	if (colorString !== null) {
		document.getElementById(id).style.backgroundColor = colorString;
	}
}

function checkBrowser() {
	//This uses the navigator object and feature detection to check for the browser type.
	if (window.attachEvent) {
		//It is either IE or Opera, check the useragent string for opera.
		if (navigator.userAgent.indexOf('Opera') != -1) {
			return 2;
		}
		else {
			//It's not opera, thus it's IE, which get's its own class.
			return 1;
		}
	}
	else if (window.addEventListener) {
		//Class 2 browsers are typically more standards complient
		return 2;
	}
	else {
		//Class 3 browsers are old...
		return 3;
	}
	
	//If we reach this point, something went horribly wrong...
	return false;
}