function flash_detect(version) {
  if (navigator.plugins['Shockwave Flash']) {
    desc = navigator.plugins['Shockwave Flash'].description
    if (parseInt(desc.substring(desc.indexOf(".") - 1)) >= version) {return true}
  }
  return false
}

function detect_enable() {if (navigator.userAgent.indexOf("iCab") != -1 || navigator.userAgent.indexOf("MSIE 3") != -1) {return false} else {return true}}

function flash_enable(version) {
  if (!detect_enable()) {return false}
  if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Opera") == -1) {
    document.writeln ('<script language=VBScript\>');
    document.writeln ('Function ie_flash_detect(version)');
    document.writeln ('  On Error Resume Next');
    document.writeln ('  ie_flash_detect = False');
    document.writeln ('  ie_flash_detect = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & version))');
    document.writeln ('End Function');
    document.writeln ('</script\>');
    return ie_flash_detect(version)
  } else {
    return flash_detect(version)
  }
}

function ShowFlashWindow(flashname, width, height, title)
{
	if(self && self.screen && self.screen.width)
	{
		pos="";
		if(width>self.screen.width)
		{
			winwidth=self.screen.width-20;
			pos+=",left=0";
		}
		else
		{
			winwidth=width+17;
			pos+=",left="+((self.screen.width-width+17)/2);
		}
		if(height>self.screen.height)
		{
			winheight=self.screen.height-60;
			pos+=",top=0";
		}
		else
		{
			winheight=height;
			pos+=",top="+((self.screen.height-height)/2);
		}
			
	}
	var params='toolbar=no,height='+winheight+',width='+winwidth+',location=no,scrollbars=yes,status=no,menubar=no,resizable=yes'+pos;
	picwin=window.open("","_blank",params);
	picwin.document.write('<html><title>'+title+'</title>');
	picwin.document.write('<body marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>');
	picwin.document.write('<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="'+width+'" HEIGHT="'+height+'" id="'+flashname+'">');
	picwin.document.write('<PARAM NAME=movie VALUE="/coffee/flash/'+flashname+'.swf">');
	picwin.document.write('<PARAM NAME=quality VALUE=high>');
	picwin.document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	picwin.document.write('<EMBED src="/coffee/flash/'+flashname+'.swf" quality=high bgcolor=#FFFFFF  WIDTH="'+width+'" HEIGHT="'+height+'" NAME="'+flashname+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	picwin.document.write('</OBJECT>');
	picwin.document.write('</body></html>');
}