function IFrameWidget(src, id, leftPos, topPos, frameBorder, scrolling, css) {
	
	this.id				= id 			|| "iframeWidget";
	this.leftPos 		= leftPos		|| "center";
	this.topPos 		= topPos		|| "center";
	this.frameBorder	= frameBorder 	|| "0";
	this.scrolling 		= scrolling 	|| "no";
	this.css 			= css 			|| "";
	
	this.isOpen = false;
	this.encounteredError = false;
	
	this.src = src;
		
	this.node = {};
	this.nodeDocument = {};
	this.parent = document.getElementsByTagName("body")[0];
	
	this.setIsIE();
}
IFrameWidget.prototype = {
	
	"REQ_CSS_MOZ": "position: fixed; visibility: hidden; border: 0px; z-index: 1001;",
	
	"REQ_CSS_IE": "position: absolute; visibility: hidden; border: 0px; z-index: 1001;",
	
	create: function() {
		this.node = document.createElement("iframe");
		this.setAttributes();
		this.parent.appendChild(this.node);
			
		this.setLeftPos(this.leftPos);
		this.setTopPos(this.topPos);
	},
	
	remove: function() {
		this.parent.removeChild(this.node);
	},
	
	open: function() {
		this.node.style.visibility = "visible";
		this.isOpen = true;
	},
	
	close: function() {
		this.node.style.visibility = "hidden";
		this.isOpen = false;
	},
	
	centerHorizontally: function() {
		leftPos = (this.parent.clientWidth/2) - (this.node.clientWidth/2);
		this.node.style.left = (leftPos > 0) ? (this.parent.clientWidth/2) - (this.node.clientWidth/2) : 0;
	},
	
	centerVertically: function() {
		h = (typeof window.innerHeight != 'undefined') ? window.innerHeight : this.parent.document.body.clientHeight;
		topPos = (h/2) - (this.node.offsetHeight/2);
		if (this.isIE == true) {
			this.node.style.top = this.parent.document.body.scrollTop + topPos / 2;
		}
		else {
			this.node.style.top = (topPos > 0) ? topPos + "px" : 0 + "px";
		}
	},
	
	setLeftPos: function(leftPos) {
		if(typeof(leftPos) == "number") this.node.style.left = leftPos + "px";
		else this.leftPos = this.centerHorizontally();
	},
	
	setTopPos: function(topPos) {
		if(typeof(topPos) == "number") this.node.style.top = topPos + "px";
		else this.topPos = this.centerVertically();
	},
	
	setIsIE: function() {
		try { window.attachEvent(); this.isIE = true; }
		catch(e) { this.isIE = false; }
	},
	
	setAttributes: function() {
		
		if(this.isIE == true) this.node.style.cssText = this.REQ_CSS_IE + this.css;	
		else this.node.setAttribute("style", this.REQ_CSS_MOZ + this.css);
		
		this.node.setAttribute("id", this.id);
		this.node.setAttribute("name", this.id);
		this.node.setAttribute("frameBorder", this.frameBorder);
		this.node.setAttribute("scrolling", this.scrolling);	
		this.node.setAttribute("src", this.src);
	}
	
};