/**
 * Work around for Microsoft's security "feature" that prevents the flash player activeX
 * control from working until the user accepts a message.  
 * 
 * See: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp
 */
function writeSwf(swfUrl, width, height, flashVars)
{
	// set proto to existing protocol variable, or "http" if protocol is 
	// not set.  it is assumed the protocol variable is set outside the 
	// scope of this script file.
	var proto = "http";
	
	var flashVarsString = "";
	
	// build query string from array provided
	if(flashVars)
	{
		for(i=0; i<flashVars.length; i++)
		{
			flashVarsString += flashVars[i] + "&";
		}
	}	
	
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("codebase='" + proto + "://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'  ");
	document.write("width='" + width + "'  ");
	document.write("height='" + height + "'  ");
	document.write("align='middle'> ");
	document.write("<param name='allowScriptAccess' value='always' /> ");
	document.write("<param name='movie' value='" + swfUrl + "' /> ");
	document.write("<param name='quality' value='high' /> ");
	document.write("<param name='scale' value='noscale' /> ");
	document.write("<param name='wmode' value='transparent' /> ");
	document.write("<param name='salign' value='lt' /> ");
	document.write("<param name='bgcolor' value='#ffffff' /> ");
	document.write("<param name='FlashVars' value='" + flashVarsString + "' />");
	document.write("<embed src='" + swfUrl + "'  ");
	document.write("	quality='high'  ");
	document.write("    scale='noscale'  ");
	document.write("    wmode='transparent'  ");
	document.write("	salign='lt'  ");
	document.write("	bgcolor='#ffffff'  ");
	document.write("	width='" + width + "'  ");
	document.write("	height='" + height + "'  ");
	document.write("	align='middle'  ");
	document.write("	allowScriptAccess='always'  ");
	document.write("	swLiveConnect='true'  ");
	document.write("	type='application/x-shockwave-flash'  ");
	document.write("	pluginspage='" + proto + "://www.macromedia.com/go/getflashplayer'  ");
	document.write("	flashVars='" + flashVarsString + "'/>");
	document.write("</object> ");
}


function Querystring(qs) 
{ 
	// optionally pass a querystring to parse
	this.params = new Object()
	this.get=Querystring_get
	
	if (qs == null)
		qs=location.search.substring(1,location.search.length)

	if (qs.length == 0) return

	// Turn <plus> back to <space>
	// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ')
	var args = qs.split('&') // parse out name/value pairs separated via &
	
	// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name
		
		this.params[name] = value
	}
}

function Querystring_get(key, default_) {
	// This silly looking line changes UNDEFINED to NULL
	if (default_ == null) default_ = null;
	
	var value=this.params[key]
	if (value==null) value=default_;
	
	return value
}
