function SuperFrame(fObj){
	var oThis = this;
	this.Increment = .2;
	this.isIE = (navigator.appMinorVersion != undefined);
	this.Ref = (typeof(fObj) != "string")? fObj : document.getElementById(fObj);
	this.onLoad = function(ref){};	
	this.FFHOffset = 0;
	this.OnResize = function(){};
		
	//Add OnLoad Event
	this.AttachEvent(this.Ref,"load",function(e){
		//Find the Correct Reference for the Element
		var elm = (e.srcElement)? e.srcElement : e.target;
		if(!elm) elm = this;
		
		var body = (oThis.isIE)? elm.contentWindow.document.body : elm.contentDocument.body;
		//Clear out any resize process currently running.
		if(elm.timer) clearInterval(elm.timer);

		//Get the height of the iframe content;	
		var h = (oThis.isIE)? body.scrollHeight : body.offsetHeight + oThis.FFHOffset;
		
		//Run Resize Process
		elm.timer = setInterval(function(){oThis.ResizeProcess(elm,h);},30);
		oThis.onLoad(body);
		
		/*
		body.onresize = function(){
			if(body.timer) clearInterval(body.timer);
			var h = (oThis.isIE)? body.scrollHeight : body.offsetHeight + oThis.FFHOffset;
			body.timer = setInterval(function(){oThis.ResizeProcess(elm,h);},30)
		}//func
		*/
	});

	return this;
}//obj


SuperFrame.prototype.GetBodyHeight = function(){
	var body = (this.isIE)? this.Ref.contentWindow.document.body : this.Ref.contentDocument.body;
	var h = (this.isIE)? body.scrollHeight : body.offsetHeight + this.FFHOffset;
	return h;
}//func


SuperFrame.prototype.Load = function(url){
	this.Ref.src = url;
}//func

SuperFrame.prototype.RefreshSize = function(){
	if(this.Ref.timer) clearInterval(this.Ref.timer);
	var toH = this.GetBodyHeight();
	var oThis = this;
	this.Ref.timer = setInterval(function(){oThis.ResizeProcess(oThis.Ref,toH);},30);
}//func


SuperFrame.prototype.ResizeProcess = function(o,toH){	
	var h = parseInt(o.style.height); //Get current height	
	var inc = Math.ceil(Math.abs(toH - h) * this.Increment); //Get absolute distance increment
	var dir = (h > toH)? -1:1; //Are we going up or down.
	
	h += dir * inc; //Add increment to current height based on direction
	h = (dir == 1)? Math.min(h,toH):Math.max(h,toH); //Check to increment Or go to end height
	o.style.height = h + "px";
	
	//At the end, Disable Thread.
	if(h == toH){
		clearInterval(o.timer);
	}//if
}//func


/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CrossBrowser Event Handling
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; */
SuperFrame.prototype.CancelEvent = function(e){
	if(e == undefined) e = window.event;
	
	if(e.stopPropagation) e.stopPropagation();
	if(e.preventDefault) e.preventDefault();
	
	e.cancelBubble = true;
	e.cancel = true;
	e.returnValue = false;
  
	return false;
}//event


SuperFrame.prototype.AttachEvent = function(obj, evName, func){
	if(obj.addEventListener) obj.addEventListener(evName, func, false);
	else if(obj.attachEvent) obj.attachEvent("on" + evName, func);
}//func


SuperFrame.prototype.DetachEvent = function(obj, evName, func){
	if(obj.addEventListener) obj.removeEventListener(evName, func, false);
	else if(obj.attachEvent) obj.detachEvent("on" + evName, func);
}//func