
document.writeln( "<div id=\"player-layout\">\
<iframe id=\"player-iframe\" style=\"position: absolute; visibility: hidden;\" src=\""+catcher_url+"\" framespacing=\"0\" frameborder=\"no\" scrolling=\"no\" allowtransparency=\"true\" width=\""+player_width+"\" height=\""+player_height+"\"></iframe>\
<a id=\"player-link\" style=\"position: absolute; visibility: hidden; \" href=\""+player_link+"\" target=\"blank\"><img style=\"outline: 0;\" border=\"0\" src=\""+shim_url+"\" width=\""+player_width+"\" height=\""+player_height+"\"  /></a>\
<div id=\"player\" style=\"position: absolute;\"></div></div>" );
var player, pl_dom;

var flashvars = {
	file: flv_url, 
	image: thumb_url, 
	autostart: "true",
	width: player_width,
	height: player_height, 
	bufferlength: 5,
	stretching: "exactfit",
	backcolor: "FFFFFF",
	frontcolor: "7C7181",
	lightcolor: "666666",
	screencolor: "FFFFFF",
	controlbar: "none"
}
var params = {
	allowfullscreen:"false", 
	allowscriptaccess:"always",
	wmode: "opaque"
}
var attributes = {
	id:"player-flv",  
	name:"player-flv"
}
function stopPlayer() {
	player.sendEvent("STOP");
	if( document.getElementById("player-link") ){
		pl_dom = document.getElementById("player-link");
		pl_dom.style.visibility="visible";
		pl_dom.onclick = function() {
			if( navigator.userAgent.indexOf("Firefox") != -1 ) {
				exit_win = window.open(this.href, "_blank", "toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1,copyhistory=1,menuBar=1" );
				
			} else if( document.getElementById && document.all ) {
				window.open( this.href, "_blank", "toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1,copyhistory=1,menuBar=1" );
			
			}
			window.setTimeout( "removeLink()", 500 );
			return false;
		}
	}
}
function stateListener(obj) { //IDLE, BUFFERING, PLAYING, PAUSED, COMPLETED
	currentState = obj.newstate; 
	previousState = obj.oldstate; 
	if ( currentState == "COMPLETED" ) {
		if( document.getElementById( "player-iframe" ) ) {
			document.getElementById( "player-iframe" ).style.visibility="visible";
		}
	}
}
function removeLink() {
	pl_dom.parentNode.removeChild(pl_dom);
	player.sendEvent("PLAY");
}
function playerReady(thePlayer) {
	player = document.getElementById(thePlayer.id);
	player.addModelListener("STATE", "stateListener");
	window.setTimeout( "stopPlayer()", play_time * 1000 );
}
swfobject.embedSWF( swf_url, "player", player_width, player_height, "9.0.115", false, flashvars, params, attributes);
