
if (!itdr) var itdr = new Object();
if (!itdr.classes) itdr.classes = new Object();
if (!itdr.classes.PhotoProof) itdr.classes.PhotoProof = new function () {
	// private members
	// descide what to do with the query
	var basepath = "";
	var query = window.location.search;
	var name = "";
	var useHistory = true;
	var flashvars = {};
	var params = {};
	var attributes = { id:"photoproof" };
	// deetermine the nature of the url structure
	if (query!="") {
		if (query.indexOf("client/")!=-1) { // classic url structure, reform to max
			var bits = query.split("/");
			name = bits[1];
			window.location = "../proof/#name=" + name + "&state=&index=";
		} else { // max structure figure out if we're using fullscreen
			name = swfobject.getQueryParamValue("n");
			if (name!="") useHistory = false;
		}
	}
	// fullscreen only in non-history mostly because of firefox
	if (useHistory==false) {
		flashvars.directory = "client/" + name;
		params.allowfullscreen = "true";
	} else thetainteractive.utilities.History.SWFID("photoproof");
	// maximize the browser
	window.moveTo(0,0);
	window.resizeTo(screen.availWidth, screen.availHeight);
	if (document.layers||document.getElementById) {
		window.outerHeight = screen.availHeight;
		window.outerWidth = screen.availWidth;
	}
	// public methods
	this.start = function (admin) {
		if (admin) {
			basepath += "../";
			flashvars.admin = "true";
			params.base = basepath;
		}
		swfobject.embedSWF(basepath + "assets/photoproof.swf", "appSpace", "100%", "100%", "9.0.28", basepath + "../common/swf/expressinstall.swf", flashvars, params, attributes);
	}
	this.setTitle = function (str) {
		document.title = str;
	}
}

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

