// JavaScript Document
var pop = null; 
function popdown() 
{ 
  if (pop && !pop.closed) pop.close(); 
} 

function popupFlash(derLink,w,h) 
{ 
  var url = derLink; 
  var args = 'width='+w+',height='+h; 
  popdown(); 
  window.open(url,'',args);
} 
window.onunload = popdown;
window.onfocus =popdown; //klaeren ob gewuenscht

function FlashVersion()
{
  if(navigator.plugins && navigator.plugins.length)		// Navigator-based browsers
  {
    for (var i=0;i<navigator.plugins.length;i++)
    {
      if (navigator.plugins[i].name.indexOf('Shockwave Flash') != -1)
	  {
	    var d, darr, majarr, maj, minarr, min;
	    d = navigator.plugins[i].description;
        darr = d.split(" ");

        majarr = darr[2].split(".");
        maj = majarr[0];
		if ( darr[3] != "" ) {
			minarr = darr[3].split("r");
		} else {
			minarr = darr[4].split("r");
		}
        min = minarr[1] > 0 ? minarr[1] : 0;
        return parseFloat(maj + "." + min);
	  }
    }
  }
  else if (window.ActiveXObject)		// IE
  {
    for (var i=15;i>=2;i--)
	{
	  try
	  {
	    var f = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
		if (f)
		{
			var v = f.GetVariable("$version");
			var varr = v.split(" ");
			var majmin = varr[1].split(",");
			return parseFloat(majmin[0]+"."+majmin[2]);
		}
	  }
	  catch(e)
	  {}
	}
  }
  else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1)
    return 4;	// WebTV 2.6 supports Flash 4
  else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1)
    return 3;	// WebTV 2.5 supports Flash 3
  else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1)
    return 2;	// older WebTV supports Flash 2

  return -1.0;	// can't detect
}

function Flash(movie, id, width, height, ver)
	{
		this.movie = movie;
		this.id = id;
		this.width = width;
		this.height = height;
		this.ver = ver ? ver : "8,0,0,0";

		this.align ="middle";

		this.attributes = new Array();
		this.params = new Object();

		this.setParam("allowScriptAccess", "always");
		this.setParam("quality", "high");
	}

	Flash.prototype.addAttribute = function(n, v)
	{
		if(v)
			this.attributes[this.attributes.length] = n + '="' + v + '"';
		else
			this.attributes[this.attributes.length] = n;
	}

	Flash.prototype.setParam = function(n, v)
	{
		this.params[n] = v;
	}

	Flash.prototype.render = function()
	{
		if(this.ver.length < 2)
			this.ver += ",0,0,0";

		var s = '<object id="' + this.id + '" width="' + this.width + '" height="' + this.height + '" align="' + this.align + '" ';
		s += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.ver + '" ';
		s += '>';
		s += '<param name="movie" value="' + this.movie + '" />';
		for(var k in this.params)
			s += '<param name="' + k + '" value="' + this.params[k] + '" />';
		s += '<embed src="' + this.movie + '" ';
		s += 'width="' + this.width + '" height="' + this.height + '" name="' + this.id + '" align="' + this.align + '" ';
		for(var k in this.params)
			s += k + '="' + this.params[k] + '" ';
		s += 'swLiveConnect="true" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />';
        s+= '</object>';
		
		document.write(s);
	}