var swfFile = 'http://www.ipexview.com/swf/ipexplay.swf';
var lightColor = "0x88acb8";
var backColor = "0x5a8999";
var frontColor = "0x000000";
var bgColor = "#FFFFFF"
var logo = "http://www.ipexview.com/images/ipex_mark_01.png"
var videosPath = "http://media.ipexview.com/video/";
var thumbPath = "http://media.ipexview.com/thumbnail/";

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, playerWidth, playerHeight) {
	
if (arguments.length!=4)
{
playerWidth = "561";
playerHeight = "417";
}
	
	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 = "";
	bodyElement = "<object width=\"" + playerWidth + "\" height=\"" + playerHeight + "\"";
	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=\""+ swfFile + "\" />";
	bodyElement += "<param name=\"bgcolor\" value=\"" + bgColor + "\" />";
	bodyElement += "<param name=\"majorversion\" value=\"7\" />";
	bodyElement += "<param name=\"build\" value=\"0\" />";
	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=" + videosPath + one + two + three + file + ".flv" +  "&enablejs=true&type=flv&displaywidth=" + playerWidth + "&displayheight=" + Number(parseInt(playerHeight)-19) + "&lightcolor=" + lightColor + "&backcolor=" + backColor +"&frontcolor=" + frontColor + "&callback=urchin&overstretch=false&logo=" + logo + "&bufferlength=5&autostart=false&image="+thumbPath+"big_"+file+".jpg\" />";
	bodyElement += "<embed src=\""+ swfFile + "\" width=\"" + playerWidth + "\" height=\"" + playerHeight + "\" 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=" + videosPath + one + two + three + file + ".flv" + "&enablejs=true&type=flv&displaywidth=" + playerWidth + "&displayheight=" + Number(parseInt(playerHeight)-19) + "&lightcolor=" + lightColor +"&backcolor=" + backColor +"&frontcolor=" + frontColor +"&callback=urchin&overstretch=false&logo=" + logo + "&bufferlength=5&autostart=false&image="+thumbPath+"big_"+file+".jpg\"/>";
	bodyElement += "</object>";
	document.write(bodyElement);
}