
// -----------------------------------------------------------------------------
// Flash Object

var Flash = new Object();
Flash.hasVersion = function (versionRequired) {
	if (navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		var description = navigator.plugins['Shockwave Flash'].description;
		var version = parseInt(description.split(' ')[2].split('.')[0]);
		return version >= versionRequired;
	}
	if (navigator.appVersion.indexOf ("Windows") != -1 && window.execScript) {
		this.hasVersionResult = null;
		execScript ('on error resume next: Flash.hasVersionResult=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + versionRequired + '"))','VBScript');
		return this.hasVersionResult;
	}
	return false;
}

// -----------------------------------------------------------------------------
// Flashtag Class

Flashtag = function (version, movie, width, height) {
	this.version = version;
	this.movie = movie;
	this.width = width;
	this.height = height;
	this.props = new Array();
	this.vars = new Array();
}
Flashtag.prototype.addProperty = function (name, value) {
	this.props[name] = value;
}
Flashtag.prototype.addVariable = function (name, value) {
	this.vars[name] = value;
}
Flashtag.prototype.getTag = function(){
	var fvars = "";
	for (var i in this.vars) fvars += i + "=" + escape (this.vars[i]) + "&"; 
	this.addProperty ("FlashVars", fvars);
	var tag = '<object';
	tag += ' width="' + this.width + '"';
	tag += ' height="' + this.height + '"';
	tag += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	tag += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.version + ',0,0,0">';
	tag += '<param name="movie" value="' + this.movie + "?" + fvars + '" />';
	for (var i in this.props) tag += '<param name="' + i + '" value="' + this.props[i] + '" />';
	tag += '<embed src="' + this.movie + "?" + fvars + '"';
	tag += ' type="application/x-shockwave-flash"';
	tag += ' pluginspage="http://www.macromedia.com/go/getflashplayer"';
	tag += ' width="' + this.width + '"';
	tag += ' height="' + this.height + '"';
	for (var i in this.props) tag += ' ' + i + '="' + this.props[i] + '"';
	tag += '><\/embed>';
	tag += '<\/object>';
	return tag;
}

// -----------------------------------------------------------------------------
// WindowLauncher Object

var WindowLauncher = new Object();

WindowLauncher.open = function (url, width, height, toolbar, scroll, center) {
	var name = new Date();
	name = name.getTime();
	name = name.toString();
	toolbar = toolbar ? 'yes' : 'no';
	scroll = scroll ? 'yes' : 'no';
	var features = 'toolbar='+toolbar+',menubar='+toolbar+',location='+toolbar+',status='+toolbar+',scrollbars='+scroll+',resizable='+scroll;
	if (width) features += ',width='+width;
	if (height) features += ',height='+height;
	if (center) {
		var x = 0, y = 0;
		if (width && window.screen.availWidth) {
			x = Math.round ((window.screen.availWidth-parseInt (width)) / 2);
			features += ',screenX='+x+',left='+x;
		}
		if (height && window.screen.availHeight) {
			y = Math.round ((window.screen.availHeight-parseInt (height)) / 2);
			features += ',screenY='+y+',top='+y;
		}
	}
	openWindowReference = window.open (url, name, features);
	if (openWindowReference != null && !openWindowReference.closed) {
		openWindowReference.focus();
	}
}
WindowLauncher.openCenter = function (url, width, height) {
	this.open (url, width, height, false, false, true);
}
WindowLauncher.openCenterChrome = function (url, width, height) {
	this.open (url, width, height, true, false, true);
}
WindowLauncher.openCenterScroll = function (url, width, height) {
	this.open (url, width, height, false, true, true);
}
WindowLauncher.openCenterChromeScroll = function (url, width, height) {
	this.open (url, width, height, true, true, true);
}

// -----------------------------------------------------------------------------
// Request Object

var Request = new Object();

(function(){
	if (location.search.length > 0) {
		var s = location.search.substring(1).split('&');
		for (var i = 0; i < s.length; i++) {
			s[i] = s[i].split ('=');
			Request[s[i][0]] = unescape (s[i][1]);
		}
	}
})();

// -----------------------------------------------------------------------------

