var DigitsCount=4;
var HTMLVariables='';

function MakeSWFDigits(GlobalHost){
	var Digits=new Array();
	var SWFVariables='DigitsCount='+DigitsCount;
	for(i=0;i<DigitsCount;i++){
		Digits[i]=Math.round(Math.random()*9);
		if(Digits[i]>9)Digits[i]=9;
		SWFVariables+='&Digit'+i+'='+Digits[i];
		HTMLVariables+=Digits[i];
	}
	
	SWFContent=''

	SWFContent+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="400" height="56" id="digits" align="middle">';
	SWFContent+='<param name="allowScriptAccess" value="sameDomain" />';
	SWFContent+='<param name="movie" value="'+GlobalHost+'movies/digits.swf" />';
	SWFContent+='<param name="quality" value="high" />';
	SWFContent+='<param name="wmode" value="transparent" />';
	SWFContent+='<param name="bgcolor" value="#999999" />';
	SWFContent+='<param name="FlashVars" value="'+SWFVariables+'" />';
	SWFContent+='<embed src="'+GlobalHost+'movies/digits.swf" FlashVars="'+SWFVariables+'" quality="high" wmode="transparent" bgcolor="#999999" width="400" height="56" name="digits" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	SWFContent+='</object>';

	document.post_message.hidden_digits.value=HTMLVariables;
	document.getElementById('swf_digits').innerHTML=SWFContent;
}

function MakeSWFMenu(Host,MoviePath){

	SWFContent='';

	SWFContent+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="665" height="120" id="MENU" align="middle">';
	SWFContent+='<param name="allowScriptAccess" value="sameDomain" />';
	SWFContent+='<param name="FlashVars" value="Host='+Host+'" />';
	SWFContent+='<param name="movie" value="'+Host+MoviePath+'" />';
	SWFContent+='<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />';
	SWFContent+='<embed src="'+Host+MoviePath+'" flashvars="Host='+Host+'" quality="high" bgcolor="#ffffff" width="665" height="120" name="MENU" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	SWFContent+='</object>';

	document.getElementById('swf_menu').innerHTML=SWFContent;
}