// JavaScript Document
/**
 * Object z1BStream
 * Create: 23/05/07
 *
 */
function z1BStream(id, url) {
	if (!id) {
		return;
	}
	this.id = id;
	var bid = "__isoftek_bStream__", pe = _d.gid_(bid), iff, bs;
	if (!pe) {
		if (is.ie) {
			_d.body.insertAdjacentHTML("afterBegin", "<span id=\"" + bid + "\" style=\"display:none;\"></span>");
			pe = _d.gid_(bid);
		} else {
			pe = _d.ce_("div");
			pe.id = bid;
			with (pe.style) {
				position = "absolute";
				overflow = "hidden";
				left = top = width = height = "1px";
				visibility = "hidden";
			}
			_d.body.appendChild(pe);
		}
	}
	if (!_d.__bStreams) {
		_d.__bStreams = new Object();
	}
	bs = _d.__bStreams;
	if (bs[id]) {
		bs[id].destroy();
	}
	bs[id] = this;
	if (is.ie) {
		pe.insertAdjacentHTML("beforeEnd", "<iframe name=\"" + id + "\" ownerID=\"" + id + "\" style=\"position:absolute;overflow:hidden;visibility:hidden;top:0;width:0;height:0;left:0;\" onload=\"var o=_d.__bStreams[this.ownerID];if(o&&o.onload)o.onload();\"></iframe>");
		this.container = _w.frames[id];
	} else {
		iff = _d.ce_("IFRAME");
		iff.id = iff.name = iff.ownerID = id;
		with (iff.style) {
			position = "absolute";
			overflow = "hidden";
			left = top = width = height = "0px";
			visibility = "hidden";
		}
		iff.onload = function () {
			var o = bs[this.ownerID];
			if (o && o.onload) {
				o.onload();
			}
		};
		pe.appendChild(iff);
		this.container = iff;
	}
	if (url) {
		this.setURL(url);
	}
}
var p = z1BStream.prototype;
p.destroy = function () {
	var i, e = _d.gid_(this.id);
	try {
		if (e) {
			if (is.ie) {
				e.removeNode(true);
			} else {
				e.parentNode.removeChild(e);
			}
		}
		_d.__bStreams[this.id] = null;
		delete _d.__bStreams[this.id];
	}
	catch (e) {
	}
	for (i in this) {
		this[i] = null;
	}
};
p.reload = function () {
	var w = this.getWindow();
	if (w && w.location) {
		w.location.reload();
	}
};
p.getDocument = function () {
	try {
		return is.ns ? this.container.contentDocument : this.container.document;
	}
	catch (e) {
		return null;
	}
};
p.getWindow = function () {
	try {
		return is.ie ? this.container.window : this.container.contentWindow;
	}
	catch (e) {
		return null;
	}
};
p.getURL = function () {
	try {
		return is.ie ? this.container.document.location.href : this.container.src;
	}
	catch (e) {
		return this.url;
	}
};
p.setURL = function (url) {
	this._setURL(url);
};
p._setURL = function (url) {
	if (url) {
		this.url = url;
	}
	if (this.url) {
		try {
			var c = this.container;
			switch (is.b) {
			  case "ie":
				c.document.location.replace(this.url);
				break;
			  case "ns":
				c.src = this.url;
				break;
			  default:
				c.src = "";
				c.src = this.url;
			}
		}
		catch (e) {
		}
	}
};
p.post = function (f) {
	f.target = this.id;
	f.submit();
};
//z1API.incFCount("Server Processing Stream");

