function WriteApplet(appletCode, appletHelpfile, appletArchive, appletWidth, appletHeight, cherryCasinoAppletCodeBase, appletPort, appletDisableAudio, appletGameName, appletSessionId, appletCoinValue, notInstalled)
{

    /*QUICK fix remove multiboxbj,lrmultiboxbj,hrmultiboxbj,Craps games. Ordered by Jarl Moden 2009-12-04*/
    /*
    if (helpfile.indexOf('craps') > 0 || helpfile.indexOf('multiboxbj') > 0) {
        return false;
    }
    */
	document.writeln('<APPLET id="gameApplet" code="' + appletCode + '" helpfile="' + appletHelpfile + '" archive="' + appletArchive + '" width="' + appletWidth + '" height="' + appletHeight + '" codebase="' + cherryCasinoAppletCodeBase + '">');
	document.writeln('<PARAM NAME="port" VALUE="' + appletPort + '"/>');
	document.writeln('<PARAM NAME="disableaudio" VALUE="' + appletDisableAudio + '"/>');
	document.writeln('<PARAM NAME="gamename" VALUE="' + appletGameName + '"/>');
	document.writeln('<PARAM NAME="casinoServlet" VALUE="/servlet/CasinoServlet/"/>');
	if (appletSessionId!="")
		document.writeln('<PARAM NAME="SessId" VALUE="' + appletSessionId + '" />');
	if (appletCoinValue!="")
		document.writeln('<PARAM NAME="coinValue" VALUE="' + appletCoinValue + '0" />');
	document.writeln('<!-- java information when java not installed -->');
	document.writeln(notInstalled);
	document.writeln('</APPLET>');
	
}

function WriteFlashGame(base, width, height, helpfile, vars, src, scheme, baseUrl, sessionId, audio, resourceUrl)
{
	if (sessionId!='')
		sessionId = 'sessid=' + sessionId + '&';
    /*QUICK fix remove all blackjackmini games. There are 3 types of blackjackmini games ordered by Daniel Eskola*/
/*QUICK fix remove multiboxbj,lrmultiboxbj,hrmultiboxbj,Craps games. Ordered by Jarl Moden 2009-12-04*/
/*|| helpfile.indexOf('multiboxbj') > 0*/
if (helpfile.indexOf('blackjackmini') > 0) {
        return false;
    }
	document.writeln('<OBJECT ');
	document.writeln('classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
	document.writeln('codebase="' + scheme + '://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,42,34" ');
	document.writeln('WIDTH="' + width + '" ');
	document.writeln('HEIGHT="' + height + '" ');
	document.writeln('ALIGN="">');
	document.writeln('<PARAM NAME=movie VALUE="' + resourceUrl + src + '">');
	document.writeln('<PARAM NAME=quality VALUE=high>');
	document.writeln('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	document.writeln('<PARAM NAME=FlashVars VALUE="server=' + baseUrl + '/&' + sessionId + vars + '&disableAudio=' + audio + '">');	
	document.writeln('<PARAM NAME="SCALE" VALUE="exactfit">');
	document.writeln('<PARAM NAME="BASE" value="' + base + '">');
	document.writeln('<PARAM NAME="AllowScriptAccess" value="always">');
	document.writeln('<PARAM NAME="wmode" value="transparent">');
	document.writeln('<EMBED ');
	document.writeln('src="' + resourceUrl + src + '" ');
	document.writeln('quality=high ');
	document.writeln('bgcolor=#FFFFFF ');
	document.writeln('WIDTH="' + width + '" ');
	document.writeln('HEIGHT="' + height + '" ');
	document.writeln('ALIGN="" ');
	document.writeln('SCALE="exactfit" ');
	document.writeln('TYPE="application/x-shockwave-flash"  ');
	document.writeln('PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" ');
	document.writeln('BASE="' + base + '" ');
	document.writeln('AllowScriptAccess="always" ');
	document.writeln('wmode="transparent" ');
	document.writeln('FlashVars="server=' + baseUrl + '/&' + sessionId + vars + '&disableAudio=' + audio + '">');
	document.writeln('</EMBED>');
	document.writeln('</OBJECT>');
}
function WriteFlashGameFullscreen(base, helpfile, vars, src, scheme, baseUrl, sessionId, audio, resourceUrl) {
    if (sessionId != '')
        sessionId = 'sessid=' + sessionId + '&';
    /*QUICK fix remove all blackjackmini games. There are 3 types of blackjackmini games ordered by Daniel Eskola*/
    /*QUICK fix remove multiboxbj,lrmultiboxbj,hrmultiboxbj,Craps games. Ordered by Jarl Moden 2009-12-04*/
    /*|| helpfile.indexOf('multiboxbj') > 0*/
    if (helpfile.indexOf('blackjackmini') > 0) {
        return false;
    }
    document.writeln('<OBJECT ');
    document.writeln('classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
    document.writeln('codebase="' + scheme + '://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,42,34" ');
    document.writeln('WIDTH=100%');
    document.writeln('HEIGHT=100%');
    document.writeln('ALIGN="">');
    document.writeln('<PARAM NAME=movie VALUE="' + resourceUrl + src + '">');
    document.writeln('<PARAM NAME=quality VALUE=high>');
    document.writeln('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
    document.writeln('<PARAM NAME=FlashVars VALUE="server=' + baseUrl + '/&' + sessionId + vars + '&disableAudio=' + audio + '&fullscreen=true">');
    document.writeln('<PARAM NAME="SCALE" VALUE="exactfit">');
    document.writeln('<PARAM NAME="BASE" value="' + base + '">');
    document.writeln('<PARAM NAME="AllowScriptAccess" value="always">');
    document.writeln('<PARAM NAME="AllowFullScreen" value="true">');
    document.writeln('<PARAM NAME="wmode" value="transparent">');
    document.writeln('<EMBED ');
    document.writeln('src="' + resourceUrl + src + '" ');
    document.writeln('quality=high ');
    document.writeln('bgcolor=#FFFFFF ');
    document.writeln('WIDTH=100%');
    document.writeln('HEIGHT=100%');
    document.writeln('ALIGN="" ');
    document.writeln('SCALE="exactfit" ');
    document.writeln('TYPE="application/x-shockwave-flash"  ');
    document.writeln('PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" ');
    document.writeln('BASE="' + base + '" ');
    document.writeln('AllowScriptAccess="always" ');
    document.writeln('AllowFullScreen="true" ');
    document.writeln('wmode="transparent" ');
    document.writeln('FlashVars="server=' + baseUrl + '/&' + sessionId + vars + '&disableAudio=' + audio + '&fullscreen=true">');
    document.writeln('</EMBED>');
    document.writeln('</OBJECT>');
}