// Homepage Flash-writer to avoid menus go under animation

function write_flash (file, picturefile, elemID, elemList  ) {
	arr = elemList.split( '|' );
	for( Index = 0; Index < arr.length; Index++ ) {
			e = document.getElementById( arr[ Index ] );
			if ( e != null ) {
				e.innerHTML = '';
			}
	}

	elm = document.getElementById( elemID );
	if ( elm != null ) {

		if (file.indexOf(".swf") > 0) {

			m_src = file;
			p_id = "FlashPlayer";

		} else {

//			m_src = 'http://st1.streamzilla.jet-stream.nl/grassrootscoaching/StreamZillaLoader.php?rtmpURL=rtmp://fl1.streamzilla.jet-stream.nl:80/VOD&movieName=' + file + '&width=421&height=310&autoStart=1&initVolume=75&autoHide=0&playerType=4&previewImage=http://www.grassrootscoaching.com/themes/default/img/'+picturefile;
//			p_id = 'StreamZillaPlayer';
			m_src = "flv/main_new.swf";
			p_id = "VideoPlayer";

		}

		m_width = 421;
		m_height = 330;

	    elm.innerHTML =
		'<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="' + m_width + '" height="' + m_height + '" id="' + p_id + '" align="middle">' +
		'<param name="allowScriptAccess" value="sameDomain" />' +
		'<param name="FlashVars" value="flv_url=' + file + '" />' +
		'<param name="movie" value="' + m_src + '" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />' +
		'<param name="bgcolor" value="#000000" /> \n' +
		'<param name="quality" value="high" /> \n' +
		'<param name="wmode" value="opaque" /> \n' +
		'<param name="settings" value="hide" /> \n' +
		'<param name="allowFullScreen" value="true" /> \n' +
		'<embed src="' + m_src + '" quality="high" bgcolor="#000000" width="' + m_width + '" height="' + m_height + '" FlashVars="flv_url=' + file + '" name="' + p_id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" wmode="opaque" settings="hide" allowFullScreen="true" />' +
		'</object>';

/*	    elm.innerHTML = 
	    '<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="' + m_width + '" height="' + m_height + '" id="' + p_id + '"> ' +
                  '<param name="FlashVars" value="flv_url=' + file + '" />';
		  '<param name="movie" value="' + m_src + '" /> \n' +
		  '<param name="bgcolor" value="#000000" /> \n' +
		  '<param name="quality" value="high" /> \n' +
		  '<param name="wmode" value="opaque" /> \n' +
		  '<param name="settings" value="hide" /> \n' +
		  '<param name="allowFullScreen" value="true" /> \n' +
		  '<embed type="application/x-shockwave-flash" FlashVars="flv_url=' + file + '" pluginspage="http://www.macromedia.com/go/getflashplayer" bgcolor="#000000" width="' + m_width + '" height="' + m_height + '" name="' + p_id + '" src="' + m_src + '" quality="high" wmode="opaque" settings="hide" allowFullScreen="true" /> ' +
		  '</object>\n ';*/

	}
}
