
if (!itdr) var itdr = new Object();
if (!itdr.classes) itdr.classes = new Object();
if (!itdr.classes.FlashHeader) itdr.classes.FlashHeader = new function () {
	/* private members
		*/
	var _use = false;
	var _hidden = new Array();
	var basePath = "/darkroom/";
	var swfPath = "blog/swf/header.swf";
	var version = "9.0.28";
	var wmode;
	var color;
	var flashvars = {
		homeuri: "/"
	};
	var params = {};
	var width = "100%";
	var height = "100%";
	var inited = false;
	/* private functions
		*/
	function init () {
		/* if its not in use, dont bother
			*/
		if (_use==false) return;
		/* only do this once
			*/
		if (inited) return;
		inited = true;
		/* try and embed the swf
			*/
		if (swfobject.hasFlashPlayerVersion(version)) {
			// the flashvars object
			var flashvars_str = "";
			for (var prop in flashvars) flashvars_str += "&" + prop + "=" + escape(flashvars[prop]);
			// the params
			params.allowscriptaccess = "always";
			params.menu = "false";
			params.flashvars = flashvars_str;
			if (color!=undefined) params.bgcolor = color;
			if (wmode!=undefined) params.wmode = wmode;
			// the attributes
			var attributes = {
				data: basePath + swfPath,
				width: width,
				height: height
			};
			var success = swfobject.createSWF(attributes, params, "header-swf");
			/* if it's successful, turn off any hidden objects
				*/
			if (success) {
				for (var i=0; i<_hidden.length; ++i) {
					var element = document.getElementById(_hidden[i]);
					if (element) element.style.display = "none";
				}
			}
		}
		/* either way, turn the header back on
			*/
		var headerswf = document.getElementById("header-swf");
		headerswf.style.display = "block";
	};
	/* public methods
		*/
	this.use = function (bool) {
		_use = bool;
	};
	this.setStageColor = function (str) {
		color = str;
	};
	this.setHomeURI = function (str) {
		flashvars.homeuri = str;
	};
	this.setTransparency = function (bool) { // a little backwards compatibility
		if (bool) wmode = "transparent";
	};
	this.setWmode = function (str) {
		wmode = str;
	};
	this.setFlashVersion = function (ver) {
		version = ver;
	};
	this.setSwfPath = function (path) {
		swfPath = path;
	};
	this.setBasePath = function (path) {
		basePath = path;
	};
	this.setSize = function (w, h) {
		width = w;
		height = h;
	};
	this.setVar = function (name, value) {
		flashvars[name] = value;
	};
	this.hideObject = function (id) {
		_hidden.push(id);
	};
	/* constructor
		*/
	swfobject.createCSS("#header-swf", "display:none"); // make sure and hide the container first
	itdr.func.DOMLoad(init);
};

// a little backwards compatibility
if (!thetainteractive) var thetainteractive = itdr;
if (!intothedarkroom) var intothedarkroom = itdr;