// ------------------------------------- FLASH CODE ----------------------------
function FlashCode(obj){

	obj.vars = (obj.vars)? obj.vars: "";
	obj.wmode = (obj.wmode)? obj.wmode: "opaque";
	obj.scale = (obj.scale)? obj.scale: "showall";
	obj.allowScriptAccess = (obj.allowScriptAccess)? obj.allowScriptAccess: "sameDomain";

	var str = '<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="'+obj.width+'" height="'+obj.height+'" align="middle">'+
	'<param name="allowScriptAccess" value="'+obj.allowScriptAccess+'" />'+
	'<param name="movie" value="'+obj.src+'" />'+
	'<param name="quality" value="high" />'+
	'<param name="wmode" value="'+obj.wmode+'" />'+
	'<param name="scale" value="'+obj.scale+'" />'+
	'<param name="flashvars" value="'+obj.vars+'" />'+
	'<embed src="'+obj.src+'" quality="high" '+
	'wmode="'+obj.wmode+'" '+
	'width="'+obj.width+'" height="'+obj.height+'" align="middle" '+
	'allowScriptAccess="'+obj.allowScriptAccess+'" '+
	'scale="'+obj.scale+'" '+
	'flashvars="'+obj.vars+'" '+
	'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
	'</object>';

return str;
}
// -----------------------------------------------------------------------------










// ----------------------------------------- FLASH IN BROWSER ------------------
function Flash(param){

	document.write( FlashCode(param) );
}
// -----------------------------------------------------------------------------





var IE = navigator.appName.indexOf("Microsoft") != -1;
var OPERA = navigator.appName.indexOf("Opera") != -1;






// ---------------------------------------   VIDEOFLASH PLAYER  ----------------

var pl_swf = "/flash/player.swf";
var pl_id = "player_id";
var pl_width = "420px";
var pl_height = "420px";

var div1 = '<div style="visibility:visible; width:'+pl_width+'; height:'+pl_height+'; margin:0; padding:0">\n';
var div2 = '<div id="'+pl_id+'" style="position:absolute; width:'+pl_width+'; height:'+pl_height+'; margin:0; padding:0">\n';


function Player(flv){

	document.write(div1 + div2 + '</div></div>');
	
	document.getElementById(pl_id).innerHTML = FlashCode({
		src: pl_swf,
		width:'100%',
		height:'100%',
		scale:'noscale',
		vars:'file='+flv,
		wmode: "transparent"
	});

}





// ---------------------------------- FULL SCREEN ------------------------------
var check_zoom = false;
var Element = null;
var Win;

function toggleZoom(){

	if(Element == null) {
		Element = document.getElementById(pl_id);
		Win = document.getElementsByTagName('body').item(0);
	}

	if(check_zoom) Unzoom();
	else Zoom();
	check_zoom = !check_zoom;

}

function Zoom(){
	scroll(0,0)
	var win_width, win_height;

	if(IE || OPERA){
		Win.style.height = "100%";
		Win.style.width = "100%";
		Win.style.overflow = "hidden";
		
		win_width = document.body.clientWidth;
        	win_height = document.body.clientHeight;
	} else {
                win_width = window.innerWidth;
        	win_height = window.innerHeight;
	}
	
	Win.style.visibility = "hidden";
        
        Element.style.width = win_width+"px";
	Element.style.height = win_height+"px";
        Element.style.zIndex = "777";
        Element.style.left = "0";
        Element.style.top = "0";
}

function Unzoom(){
 	if(IE || OPERA){
		Win.style.overflow = "auto";
		Win.style.height = "";
		Win.style.width = "";
	}
	Win.style.visibility = "visible";
	
	Element.style.width = "420px";
	Element.style.height = "420px";
        Element.style.zIndex = "";
        Element.style.left = "";
        Element.style.top = "";
}

window.onresize = Resize;
function Resize(){
        if(!check_zoom) return;

        scroll(0,0);
        var win_width, win_height;
        
        if(IE || OPERA){
                win_width = document.body.clientWidth;
         	win_height = document.body.clientHeight;
        } else {
        	win_width = window.innerWidth;
        	win_height = window.innerHeight;
        }
        
	Element.style.width = win_width+"px";
	Element.style.height = win_height+"px";
}




//------------------------------------------------------------------------------
