var flashVer=0;
vbFlash6=false,vbFlash7=false; vbFlash8=false; vbFlash9=false; vbFlash10=false; vbFlash11=false; vbFlash12=false;
if(navigator.plugins["Shockwave Flash"]){
	flashVer=parseInt(navigator.plugins["Shockwave Flash"].description.substr(16));
} else {
	document.write('<scr'+'ipt language=VBScript>\n');
	document.write('on error resume next\n');
	document.write('vbFlash6=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');	
	document.write('vbFlash7=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))\n');	
	document.write('vbFlash8=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
	document.write('vbFlash9=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
	document.write('vbFlash10=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10")))\n');
	document.write('vbFlash11=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11")))\n');
	document.write('vbFlash12=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12")))\n');
	document.write('</scr'+'ipt>\n');
	flashVer=(vbFlash6)?6:flashVer;
	flashVer=(vbFlash7)?7:flashVer;
	flashVer=(vbFlash8)?8:flashVer;
	flashVer=(vbFlash9)?9:flashVer;
	flashVer=(vbFlash10)?10:flashVer;
	flashVer=(vbFlash11)?11:flashVer;
	flashVer=(vbFlash12)?12:flashVer;
}

function FlashTag(src, width, height, version, groep, soort, info,full) {
	this.src = src;
	this.width = width;
    	this.height = height;
    	this.version = version;
	this.id = 'flashfloater';
	this.flashVars = null;
    	this.flashVarsStr = null;
    	this.genericParam = new Object();
    	this.genericParam['menu'] = 'false';
    	this.genericParam['scale'] = 'noscale';
    	this.genericParam['quality'] = 'high';
	if (full == '' || full == undefined) { full = false; } else { this.genericParam['allowFullScreen'] = 'true'; }
	this.addFlashVar('typert', groep);
	this.addFlashVar('melding', soort);
	this.addFlashVar('info', info);
	this.genericParam['wmode'] = 'transparent';
	this.addFlashVar('ID', 'flashfloater');
	this.genericParam['allowScriptAccess'] = 'always';
	this.ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
}

FlashTag.prototype.setSource = function(src) { this.src = src; }
FlashTag.prototype.setWidth = function(w) { this.width = width; }
FlashTag.prototype.setHeight = function(h) { this.h = height; }
FlashTag.prototype.setVersion = function(v) { this.version = v; }
FlashTag.prototype.setId = function(id) { this.id = id; }
FlashTag.prototype.setBgcolor = function(bgc) { if (bgc.charAt(0) != '#') { bgc = '#' + bgc; } this.genericParam['bgcolor'] = bgc; }
FlashTag.prototype.addFlashVars = function(fvs) { this.flashVarsStr = fvs; }
FlashTag.prototype.addFlashVar = function(n, v) { if (this.flashVars == null) { this.flashVars = new Object(); } this.flashVars[n] = unescape(v); }
FlashTag.prototype.removeFlashVar = function(n) { if (this.flashVars != null) { this.flashVars[n] = undefined; } }
FlashTag.prototype.setSwliveconnect = function(swlc) { this.genericParam['swliveconnect'] = swlc; }
FlashTag.prototype.setPlay = function(p) { this.genericParam['play'] = p; }
FlashTag.prototype.setLoop = function(l) { this.genericParam['loop'] = l; }
FlashTag.prototype.setMenu = function(m) { this.genericParam['menu'] = m; }
FlashTag.prototype.setQuality = function(q) { if (q != 'low' && q != 'high' && q != 'autolow' && q != 'autohigh' && q != 'best') { alert('Supported values are "low", "high", "autolow", "autohigh", and "best".'); } this.genericParam['quality'] = q; }
FlashTag.prototype.setScale = function(sc) { if (sc != 'showall' && sc != 'noborder' && sc != 'exactfit') { alert('Supported values are "showall", "noborder", and "exactfit".'); } this.genericParam['scale'] = sc; }
FlashTag.prototype.setAlign= function(a) { if (a != 'l' && a != 't' && a != 'r' && a != 'b') { alert('Supported values are "l", "t", "r" and "b".'); } this.genericParam['align'] = a; }
FlashTag.prototype.setSalign= function(sa) { if (sa != 'l' && sa != 't' && sa != 'r' && sa != 'b' && sa != 'tl' && sa != 'tr' && sa != 'bl' && sa != 'br') { alert('Supported values are "l", "t", "r", "b", "tl", "tr", "bl" and "br".'); } this.genericParam['salign'] = sa; }
FlashTag.prototype.setWmode = function(wm) { if (wm != 'window' && wm != 'opaque' && wm != 'transparent') { alert('Supported values are "window", "opaque", and "transparent".'); } this.genericParam['wmode'] = wm; }
FlashTag.prototype.setBase = function(base) { this.genericParam['base'] = base; }

FlashTag.prototype.toString = function()
{
    var flashTag = new String();
    if (this.ie)
    {
        flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        if (this.id != null)
        {
            flashTag += 'id="'+this.id+'" ';
        }
        flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'">';
        flashTag += '<param name="movie" value="'+this.src+'"/>';

        for (var n in this.genericParam)
        {
            if (this.genericParam[n] != undefined && this.genericParam[n] != null)
            {
                flashTag += '<param name="'+n+'" value="'+this.genericParam[n]+'"/>';
            }
        }

        if (this.flashVars != null)
        {
            var fv = this.getFlashVarsAsString();
            if (fv.length > 0)
            {
                flashTag += '<param name="flashvars" value="'+fv+'"/>';
            }
        }
        flashTag += '</object>';
    } else {
        flashTag += '<embed src="'+this.src+'"';
        flashTag += ' width="'+this.width+'"';
        flashTag += ' height="'+this.height+'"';
        flashTag += ' type="application/x-shockwave-flash"';
        if (this.id != null) {
            flashTag += ' name="'+this.id+'" id="'+this.id+'"';
        }

        for (var n in this.genericParam) {
            if (this.genericParam[n] != undefined && this.genericParam[n] != null) {
                flashTag += (' '+n+'="'+this.genericParam[n]+'"');
            }
        }

        if (this.flashVars != null) {
            var fv = this.getFlashVarsAsString();
            if (fv.length > 0) {
                flashTag += ' flashvars="'+fv+'"';
            }
        }
        flashTag += ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
        flashTag += '</embed>';
    }
    return flashTag;

}

FlashTag.prototype.write = function(doc) { doc.write(this.toString()); }

FlashTag.prototype.getFlashVarsAsString = function()
{
    var qs = new String();
    for (var n in this.flashVars) {
        if (this.flashVars[n] != undefined && this.flashVars[n] != null) {
            qs += (escape(n)+'='+escape(this.flashVars[n])+'&');
        }
    }

    if (this.flashVarsStr != null) {
        return qs + this.flashVarsStr;
    }

    return qs.substring(0, qs.length-1);
}

var start = 0;

function show_video(divID,code,mode) {
	flashvideoDiv = document.getElementById(divID);
	if(flashVer >= 6){ 
		if (mode == 'small') {
			var tag = new FlashTag('/Film/FLV/videoplayer.swf'+'?v=<? print($v); ?>','510','306', '6,0,0,0','','',code,true);
		} else {
			var tag = new FlashTag('/Film/FLV/videoplayer.swf'+'?v=<? print($v); ?>','640','380', '6,0,0,0','','',code,true);
		}
		flashvideoDiv.innerHTML = tag;
	} else { flashvideoDiv.innerHTML = noflash_object; }
}
