function generateFullScreenButton(text) {
    if (window.ActiveXObject) {
        document.write("<INPUT type=\"button\" class=\"button\" value=\"" + text + "\" name=\"FSBUTTON\" onclick=\"if (document.player.playState == 3) document.player.fullScreen = true;\" />");
    }
}

function generateFlashPlayer(file, filePath) {
	generateEmbedFlashPlayer(file, '480', '368')
}

function generateEmbedFlashPlayer(file)
{
	generateEmbedFlashPlayer(file, '480', '368')
}

function generateEmbedFlashPlayer(file, width, height) {
var filePath = "http://media.alternativechannel.tv/video/";
var thumbPath = "http://www.alternativechannel.tv/communication-durable/images/thumbnails/"
var swfPath = "http://www.alternativechannel.tv/alternat-docs/swf/achannelplay.swf"
var watermarkPath = "http://www.alternativechannel.tv/alternat-docs/images/commons/achannel_mark_01.png"
var three = file.substring(file.length-1)+"/";
var two = file.substring(file.length-2,file.length-1)+"/";
var one = file.substring(file.length-3,file.length-2)+"/";
var bodyElement = "";

var lightColor="0xE98024";
var backColor="0xd2d0d1";
var frontColor="0x000000";

if (arguments.length!=3)
{
width='480';
height='368';
}
	bodyElement = "<object width=\""+width+"\" height=\""+Number(parseInt(height)+20)+"\"";
	bodyElement += "classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"";
	bodyElement += "codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\">";
	bodyElement += "<param name=\"movie\" value=\""+swfPath+"\" />";
	bodyElement += "<param name=\"bgcolor\" value=\"#FFFFFF\" />";
	bodyElement += "<param name=\"majorversion\" value=\"7\" />";
	bodyElement += "<param name=\"build\" value=\"0\" />";
	bodyElement += "<param name=\"WMODE\" value=\"transparent\" />";
	bodyElement += "<param name=\"allowfullscreen\" value=\"true\" />";
	bodyElement += "<param name=\"overstretch\" value=\"false\">";
	bodyElement += "<param name=\"menu\" value=\"false\" />";
	bodyElement += "<param name=\"image\" value=\""+thumbPath+"big_"+file+".jpg\" />";

	bodyElement += "<param name=\"flashvars\" value=\"file=" + filePath + one + two + three + file + ".flv" + "&enablejs=true&type=flv&displaywidth="+width+"&displayheight="+height+"&lightcolor=0xE98024&backcolor=0xd2d0d1&frontcolor=0x000000&logo="+ watermarkPath +"&bufferlength=5&callback=urchin&overstretch=false&autostart=false&image="+thumbPath+"big_"+file+".jpg\" />";

	bodyElement += "<embed wmode=\"transparent\" src=\"" + swfPath + "\" width=\""+width+"\" height=\""+Number(parseInt(height)+20)+"\" bgcolor=\"#FFFFFF\" majorversion=\"7\" build=\"0\" allowfullscreen=\"true\" menu=\"false\"";
	bodyElement += "type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"";

	bodyElement += "flashvars=\"file=" + filePath + one + two + three + file + ".flv" + "&enablejs=true&type=flv&displaywidth="+width+"&displayheight="+height+"&lightcolor=" + lightColor +"&backcolor=" + backColor + "&overstrech=false&frontcolor=" + frontColor + "&logo=" + watermarkPath + "&bufferlength=5&callback=urchin&overstretch=false&autostart=false&image=" + thumbPath + "big_"+file+".jpg\" />";

	bodyElement += "</object>";
	document.write(bodyElement);
}
