function changeClass(o,c){
	o.className = c;
}

function setFlash(sFlash, sObject, iWidth, iHeight)
{
	var oFlash = new FlashObject(sFlash, sFlash, iWidth, iHeight, 6);
	oFlash.addParam("menu", false);
	oFlash.addParam("loop", false);
	oFlash.write(sObject);
	return false;
}

function setVideo(url)
{
	setFlash(url, "videoHolder", 351, 259);
}

function setWinVideo(urlString,showController)
{
	if(showController){
		sCont = '<param name="ShowControls" value="1" />';
		sCont2 = ' ShowControls="1" ';
	}
	else{
		sCont = '<param name="ShowControls" value="0" />';
		sCont2 = ' ShowControls="0" ';
	}
	var objectDefinition = 
		'<OBJECT CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="351" height="259" align="middle">' +
			'<PARAM NAME="URL" VALUE="' + urlString + '" />' +
			'<PARAM NAME="SendPlayStateChangeEvents" VALUE="True" />' +
			'<PARAM NAME="AutoStart" VALUE="true" />' +
			sCont +
			'<PARAM name="PlayCount" value="9999" />' +
			'<embed type="application/x-mplayer2" src="' + urlString + '"' + sCont2 + 'AutoStart="true" width="351" height="259" align="middle" bgcolor="black" pluginspage="http://www.microsoft.com/Windows//MediaPlayer/" playcount="9999">' +
		   ' </embed>' +
		'</OBJECT>';
	document.write(objectDefinition);
}

function setQTVideo(url,showController)
{	
	if(showController){
		sCont = '<param name="controller" value="true" />';
		sCont2 = ' controller="true" ';
	}
	else{
		sCont = '<param name="controller" value="false" />';
		sCont2 = ' controller="false" ';
	}
	var objectDefinition = 
		'<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab##version=6,0,2,0" width="351" height="259" align="middle">' +
			'<PARAM NAME="src" VALUE="' + url + '" />' +
			'<PARAM NAME="Autoplay" VALUE="true" />' +
			sCont +
			'<PARAM name="scale" value="tofit" />' +
			'<embed src="' + url + '"' + sCont2 + 'autoplay="true" width="351" height="259" align="middle" bgcolor="black" pluginspage="http://www.apple.com/quicktime/download/" scale="tofit">' +
		   	'</embed>' +
		'</OBJECT>';
	document.write(objectDefinition);
}

function getQueryStringValues(xparam)
{
    xparam = xparam.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+xparam+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null )
       return "";  
    else
       return results[1];
}

function setWinVideo2(showController)
{
	if(showController){
		sCont = '<param name="ShowControls" value="1" />';
		sCont2 = ' ShowControls="1" ';
	}
	else{
		sCont = '<param name="ShowControls" value="0" />';
		sCont2 = ' ShowControls="0" ';
	}
	var urlString = getQueryStringValues("talk");
	var objectDefinition = 
		'<OBJECT CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="351" height="259" align="middle">' +
			'<PARAM NAME="URL" VALUE="' + urlString + '" />' +
			'<PARAM NAME="SendPlayStateChangeEvents" VALUE="True" />' +
			'<PARAM NAME="AutoStart" VALUE="true" />' +
			sCont +
			'<PARAM name="PlayCount" value="9999" />' +
			'<embed type="application/x-mplayer2" src="' + urlString + '"' + sCont2 + 'AutoStart="true" width="351" height="259" align="middle" bgcolor="black" playcount="9999">' +
		   ' </embed>' +
		'</OBJECT>';
	document.write(objectDefinition);
}