function getFlashVersion(){
	b = navigator.userAgent.toLowerCase();
	if ( (b.indexOf('msie') != -1) && (b.indexOf('win') != -1) && (b.indexOf('opera') == -1) ) {
		document.writeln('<script language="VBscript">');
		document.writeln('Function detectActiveXControl(activeXControlName)');
		document.writeln('  on error resume next');
		document.writeln('  detectActiveXControl = False');
		document.writeln('  detectActiveXControl = IsObject(CreateObject(activeXControlName))');
		document.writeln('End Function');
		document.writeln('</scr' + 'ipt>');
	}
	var installedVersion = 0;
	if ( (b.indexOf('msie') != -1) && (b.indexOf('win') != -1) && (b.indexOf('opera') == -1) ) {
		for (var i=3; i<10; i++){
			if(detectActiveXControl("ShockwaveFlash.ShockwaveFlash."+i) == true) installedVersion = i;
		}
	} else {
		if (navigator.plugins["Shockwave Flash"]) {
			var pluginDesc = navigator.plugins["Shockwave Flash"].description;
			installedVersion = parseInt( pluginDesc.charAt( pluginDesc.indexOf(".")-1 ) );
		}
		if(b.indexOf("webtv") != -1) installedVersion = 3;  
	}
	return installedVersion;
}

function FreeAreaStream(performer_name, stream_key, has_sinulator,border_color)
{
	flashInst = getFlashVersion();
	if(flashInst >= 6){
	  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" WIDTH="120" HEIGHT="90" ALIGN="" id="free_area_stream_102">');
	  document.write('<PARAM NAME=movie VALUE="http://files.private.camz.com/flash_clients/free_area_stream_102.swf?performer_name='+performer_name+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'">');
	  document.write('<PARAM NAME=quality VALUE=high>');
	  document.write('<PARAM NAME=performer_name VALUE='+performer_name+'>');
	  document.write('<PARAM NAME=stream_key VALUE='+stream_key+'>');
	  document.write('<PARAM NAME=has_sinulator VALUE='+has_sinulator+'>');
	  document.write('<PARAM NAME=border_color VALUE='+border_color+'>');
	  document.write('<param name="menu" value="false">');
	  document.write('<EMBED src="http://files.private.camz.com/flash_clients/free_area_stream_102.swf?performer_name='+performer_name+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'" quality=high WIDTH="120" HEIGHT="90" ALIGN="" TYPE="application/x-shockwave-flash" NAME="free_area_stream_102" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	  document.write('</OBJECT>');	
	}
	else{
		document.write('<center>');
		document.write('<table border="0" width="120" height="90"><tr><td valign="middle" align="center" height="90"><font face="arial" size="1" color="#ffffff"><i>Free Flash Player required to display this page correctly</i></font><br>');
		document.write('<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="/flash_clients/get_flash_player.gif" border="0"></a>');
		document.write('</td></tr></table></center>');
	}
}

function FreeAreaStreamNew(performer_name, pthumb, stream_key, has_sinulator,border_color)
{
	flashInst = getFlashVersion();
	if(flashInst >= 6){
	  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" WIDTH="122" HEIGHT="92" ALIGN="" id="free_area_stream_102">');
	  document.write('<PARAM NAME=movie VALUE="http://files.private.camz.com/flash_clients/free_area_stream_103.swf?performer_name='+performer_name+'&pthumb='+pthumb+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'">');
	  document.write('<PARAM NAME=quality VALUE=high>');
	  document.write('<PARAM NAME=performer_name VALUE='+performer_name+'>');
	  document.write('<PARAM NAME=stream_key VALUE='+stream_key+'>');
	  document.write('<PARAM NAME=has_sinulator VALUE='+has_sinulator+'>');
	  document.write('<PARAM NAME=border_color VALUE='+border_color+'>');
	  document.write('<PARAM NAME=pthumb VALUE='+pthumb+'>');
	  document.write('<param name="menu" value="false">');
	  document.write('<EMBED src="http://files.private.camz.com/flash_clients/free_area_stream_103.swf?performer_name='+performer_name+'&pthumb='+pthumb+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'" quality=high WIDTH="122" HEIGHT="92" ALIGN="" TYPE="application/x-shockwave-flash" NAME="free_area_stream_102" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></EMBED>');
	  document.write('</OBJECT>');	
	}
	else{
		document.write('<center>');
		document.write('<table border="0" width="120" height="90"><tr><td valign="middle" align="center" height="90"><font face="arial" size="1" color="#ffffff"><i>Free Flash Player required to display this page correctly</i></font><br>');
		document.write('<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="/flash_clients/get_flash_player.gif" border="0"></a>');
		document.write('</td></tr></table></center>');
	}
}

function FreeAreaStreamXML(performer_name, pthumb, stream_key, has_sinulator,border_color, aid)
{
	flashInst = getFlashVersion();
	if(flashInst >= 6){
	  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" WIDTH="122" HEIGHT="92" ALIGN="" id="free_area_stream_xml">');
	  document.write('<PARAM NAME=movie VALUE="http://files.private.camz.com/flash_clients/free_area_stream_xml.swf?performer_name='+performer_name+'&pthumb='+pthumb+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'&aid='+aid+'">');
	  document.write('<PARAM NAME=quality VALUE=high>');
	  document.write('<PARAM NAME=performer_name VALUE='+performer_name+'>');
	  document.write('<PARAM NAME=stream_key VALUE='+stream_key+'>');
	  document.write('<PARAM NAME=has_sinulator VALUE='+has_sinulator+'>');
	  document.write('<PARAM NAME=border_color VALUE='+border_color+'>');
	  document.write('<PARAM NAME=pthumb VALUE='+pthumb+'>');
	  document.write('<PARAM NAME=aid VALUE='+aid+'>');
	  document.write('<param name="menu" value="false">');
	  document.write('<EMBED src="http://files.private.camz.com/flash_clients/free_area_stream_xml.swf?performer_name='+performer_name+'&pthumb='+pthumb+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'&aid='+aid+'" quality=high WIDTH="122" HEIGHT="92" ALIGN="" TYPE="application/x-shockwave-flash" NAME="free_area_stream_xml" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	  document.write('</OBJECT>');	
	}
	else{
		document.write('<center>');
		document.write('<table border="0" width="120" height="90"><tr><td valign="middle" align="center" height="90"><font face="arial" size="1" color="#ffffff"><i>Free Flash Player required to display this page correctly</i></font><br>');
		document.write('<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="/flash_clients/get_flash_player.gif" border="0"></a>');
		document.write('</td></tr></table></center>');
	}
}

function FreeAreaStreamXMLtrans(performer_name, pthumb, stream_key, has_sinulator,border_color, aid)
{
	flashInst = getFlashVersion();
	if(flashInst >= 6){
	  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" WIDTH="122" HEIGHT="92" ALIGN="" id="free_area_stream_xml">');
 document.write('<PARAM NAME=movie VALUE="http://files.private.camz.com/flash_clients/free_area_stream_xml.swf?performer_name='+performer_name+'&pthumb='+pthumb+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'&aid='+aid+'&wmode=transparent">');
 document.write('<PARAM NAME=quality VALUE=high>');
 document.write('<PARAM NAME=performer_name VALUE='+performer_name+'>');
 document.write('<PARAM NAME=stream_key VALUE='+stream_key+'>');
 document.write('<PARAM NAME=has_sinulator VALUE='+has_sinulator+'>');
 document.write('<PARAM NAME=border_color VALUE='+border_color+'>');
 document.write('<PARAM NAME=pthumb VALUE='+pthumb+'>');
 document.write('<PARAM NAME=aid VALUE='+aid+'>');
 document.write('<PARAM NAME=wmode VALUE=transparent>');
 document.write('<param name="menu" value="false">');
 document.write('<EMBED src="http://files.private.camz.com/flash_clients/free_area_stream_xml.swf?performer_name='+performer_name+'&pthumb='+pthumb+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'&aid='+aid+'&wmode=transparent" quality=high WIDTH="122" HEIGHT="92" ALIGN="" WMODE="transparent" TYPE="application/x-shockwave-flash" NAME="free_area_stream_xml" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
 document.write('</OBJECT>');	
	}
	else{
		document.write('<center>');
		document.write('<table border="0" width="120" height="90"><tr><td valign="middle" align="center" height="90"><font face="arial" size="1" color="#ffffff"><i>Free Flash Player required to display this page correctly</i></font><br>');
		document.write('<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="/flash_clients/get_flash_player.gif" border="0"></a>');
		document.write('</td></tr></table></center>');
	}
}

function FreeAreaStream2(performer_name, stream_key, has_sinulator,border_color)
{
	flashInst = getFlashVersion();
	if(flashInst >= 6){
	  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" WIDTH="122" HEIGHT="92" ALIGN="" id="free_area_stream_102">');
	  document.write('<PARAM NAME=movie VALUE="http://files.private.camz.com/flash_clients/free_area_stream_102.swf?performer_name='+performer_name+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'">');
	  document.write('<PARAM NAME=quality VALUE=high>');
	  document.write('<PARAM NAME=performer_name VALUE='+performer_name+'>');
	  document.write('<PARAM NAME=stream_key VALUE='+stream_key+'>');
	  document.write('<PARAM NAME=has_sinulator VALUE='+has_sinulator+'>');
	  document.write('<PARAM NAME=border_color VALUE='+border_color+'>');
	  document.write('<param name="menu" value="false">');
	  document.write('<EMBED src="http://files.private.camz.com/flash_clients/free_area_stream_102.swf?performer_name='+performer_name+'&stream_key='+stream_key+'&has_sinulator='+has_sinulator+'&border_color='+border_color+'" quality=high WIDTH="122" HEIGHT="92" ALIGN="" TYPE="application/x-shockwave-flash" NAME="free_area_stream_102" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	  document.write('</OBJECT>');	
	}
	else{
		document.write('<center>');
		document.write('<table border="0" width="120" height="90"><tr><td valign="middle" align="center" height="90"><font face="arial" size="1" color="#ffffff"><i>Free Flash Player required to display this page correctly</i></font><br>');
		document.write('<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="/flash_clients/get_flash_player.gif" border="0"></a>');
		document.write('</td></tr></table></center>');
	}
}

function LobbyAreaStream(performer_name, session_id, has_sinulator)
{
	  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" WIDTH="120" HEIGHT="90" ALIGN="" id="preview_stream_102">');
	  document.write('<PARAM NAME=movie VALUE="http://files.private.camz.com/flash_clients/preview_stream_102.swf?performer_name='+performer_name+'&sessionID='+session_id+'&has_sinulator='+has_sinulator+'">');
	  document.write('<PARAM NAME=quality VALUE=high>');
	  document.write('<PARAM NAME=performer_name VALUE='+performer_name+'>');
	  document.write('<PARAM NAME=sessionID VALUE='+session_id+'>');
	  document.write('<PARAM NAME=has_sinulator VALUE='+has_sinulator+'>');
	  document.write('<param name="menu" value="false">');
	  document.write('<PARAM NAME=bgcolor VALUE=#000000>');
	  document.write('<EMBED src="http://files.private.camz.com/flash_clients/preview_stream_102.swf?performer_name='+performer_name+'&sessionID='+session_id+'&has_sinulator='+has_sinulator+'" quality=high menu=false bgcolor=#000000 WIDTH="120" HEIGHT="90" ALIGN="" TYPE="application/x-shockwave-flash" NAME="preview_stream_102" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	  document.write('</OBJECT>');	
}

function MemberChat(performer_name,session_id)
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" WIDTH="760" HEIGHT="598" ALIGN=""  id="member_403">');
	document.write('<PARAM NAME=movie VALUE="http://files.private.camz.com/flash_clients/member_403.swf?performer_name='+performer_name+'&sessionID='+session_id+'">');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=sessionID VALUE='+session_id+'>');
	document.write('<PARAM NAME=performer_name VALUE='+performer_name+'>');
	document.write('<param name="menu" value="false">');
	document.write('<EMBED src="http://files.private.camz.com/flash_clients/member_403.swf?performer_name='+performer_name+'&sessionID='+session_id+'" quality=high WIDTH="760" HEIGHT="598" ALIGN="" TYPE="application/x-shockwave-flash" NAME="member_403" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
}
