	function getQueryString(strParaName) {
		var strQS=location.search.substring(1,location.search.length);
		var strArgs = "";
		var strName = "";
		var strValue = "";
		var strTemp = "";

		if (strQS!="") {
			strArgs = strQS.split('&');

			for (var i=0;i<strArgs.length;i++)
			{
				var pair = strArgs[i].split('=');
				
				// Fix broken unescaping
				strTemp = unescape(pair[0]).split('+');
				strName = strTemp.join(' ');
				
				strTemp = unescape(pair[1]).split('+');
				strValue = strTemp.join(' ');
				
				if (strParaName==strName) return strValue;
			}

		}
		return -1;
	}

	function openWin(intWidth, intHeight, strFilePath) {
		var objWin = window.open("popup.html?w="+intWidth+"&h="+intHeight+"&filepath="+strFilePath, "popup", "height="+(intHeight+60)+",width="+(intWidth+20)+",scrollbars=0,menubar=0");
	}

	function composeMPG(intWidth, intHeight, strFilePath) {
		return '<EMBED SRC="' +strFilePath+ '" WIDTH='+intWidth+' HEIGHT='+intHeight+'>';
	}

	function composeASF(strFilePath) {
		var strCode = "<OBJECT id='mediaPlayer' width='372' height='325' " + 
		" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' " + 
		" codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'" + 
		" standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>" + 
		" <param name='fileName' value='" + strFilePath + "'>" + 
		" <param name='animationatStart' value='true'>" + 
		" <param name='transparentatStart' value='true'>" + 
		" <param name='autoStart' value='true'>" + 
		" <param name='showControls' value='true'>" + 
		" <param name='loop' value='false'>" + 
		" <EMBED type='application/x-mplayer2'" + 
		" pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'" + 
		" id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' " + 
		" bgcolor='darkblue' showcontrols='true' showtracker='-1' " + 
		" showdisplay='0' showstatusbar='-1' videoborder3d='-1' width='372'= height='325'" + 
		" src='" + strFilePath + "' autostart='true' designtimesp='5311' loop='true'>" + 
		" </EMBED>" + 
		" </OBJECT>";
		return strCode;
	}

	function composeASF1(intWidth, intHeight, strFilePath) {

		var strCode = "<OBJECT id='mediaPlayer' width='" +intWidth+ "' height='" +intHeight+ "' " + 
		" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' " + 
		" codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'" + 
		" standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>" + 
		" <param name='fileName' value='" + strFilePath + "'>" + 
		" <param name='animationatStart' value='true'>" + 
		" <param name='transparentatStart' value='true'>" + 
		" <param name='autoStart' value='true'>" + 
		" <param name='showControls' value='true'>" + 
		" <param name='loop' value='false'>" + 
		" <EMBED type='application/x-mplayer2'" + 
		" pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'" + 
		" id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' " + 
		" bgcolor='darkblue' showcontrols='true' showtracker='-1' " + 
		" showdisplay='0' showstatusbar='-1' videoborder3d='-1' width='"+intWidth+"= height='" +intHeight+ "'" + 
		" src='" + strFilePath + "' autostart='true' designtimesp='5311' loop='true'>" + 
		" </EMBED>" + 
		" </OBJECT>";
		return strCode;
	}

	function composeSWF(intWidth, intHeight, strFilePath) {

		var strCode = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" + 
		" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'" + 
		" width='" +intWidth+ "' height='" +intHeight+ "'>" + 
		" <param name='movie' value='" +strFilePath+ "'>" + 
		" <param name='quality' value='high'>" + 
		" <param name='bgcolor' value='#FFFFFF'>" + 
		" <param name='loop' value='true'>" + 
		" <EMBED src='" +strFilePath+ "' quality='high' bgcolor='#FFFFFF' width='" +intWidth+ "'" + 
		" height='" +intHeight+ "' loop='true' type='application/x-shockwave-flash'" + 
		" pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>" + 
		" </EMBED>" + 
		" </OBJECT>";

		return strCode;
	}

	function composeMOV(intWidth, intHeight, strFilePath) {
		var strCode = "<OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='" +intWidth+ "'" +
		"height='" +intHeight+ "' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>" +
		"<param name='src' value='" +strFilePath+ "'>" +
		"<param name='autoplay' value='true'>" +
		"<param name='controller' value='true'>" +
		"<param name='loop' value='true'>" +
		"<EMBED src='" +strFilePath+ "' width='" +intWidth+ "' height='" +intHeight+ "' autoplay='true' " +
		"controller='true' loop='true' pluginspage='http://www.apple.com/quicktime/download/'>" +
		"</EMBED>" +
		"</OBJECT>";

			return strCode;
	}