function ThickBox(id, css, opacity) {
	this.id		= id 	|| "thickBox";
	this.css 	= css 	|| "";
	this.opacity = opacity || 70;
	this.isOpen = false;
		
	this.parent = document.getElementsByTagName("body")[0];
	this.node = {};
	
	this._ThickBox();
}
ThickBox.prototype = {
	
	/**
	 * REQ_CSS:
	 * Contains the CSS that makes a thickbox a thickbox.
	 * Can be overwritten with CSS passed to the object on instantiation (this.css).
	 */
	"REQ_CSS_MOZ": "background-color: #000; display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; z-index: 1001;",
	
	// position fixed is broken in IE, so we'll be doing things a little differently.
	"REQ_CSS_IE": "background-color: #000; display: none; position: absolute; z-index: 1001;",
	
	_ThickBox: function() {
		
		this.setIsIE();
		this.setOpacity(this.opacity);
		
		this.node = document.createElement("div");
		this.parent.appendChild(this.node);
		this.setAttributes();
		
		this.open();
	},
	
	open: function() {
		this.node.style.display = "block";
		this.isOpen = true;
	},
	
	close: function() {
		this.node.style.display = "block";
		this.isOpen = false;
	},
	
	remove: function() {
		this.parent.removeChild(this.node);
	},
	
	setIsIE: function() {
		try { window.attachEvent(); this.isIE = true; }
		catch(e) { this.isIE = false; }
	},
	
	setOpacity: function(opacity) { // adds the appropriate opacity (ie/moz) to this.css
		if(this.isIE == true) this.css += "filter: alpha(opacity=" + opacity + ");";
		else this.css += "opacity: ." + opacity + ";";
	},
	
	setAttributes: function() {
		if(this.isIE == true) {
			
			this.node.id = this.id;
			this.node.style.cssText = this.REQ_CSS_IE + this.css;
			
			this.node.style.top = "0px";
			this.node.style.left = "0px";
			this.node.style.width = document.body.scrollWidth + "px";
			this.node.style.height = document.body.scrollHeight + "px";
		}
		else {
			this.node.setAttribute("id", this.id);
			this.node.setAttribute("style", this.REQ_CSS_MOZ + this.css);			
		}
	}
	
};