var orginFlash = {init:false,isFullScreen:false,position:"",top:"",left:"",width:"",height:""},videoContainer;
	function $E(ID){
		if(typeof(ID)=="string"){
			if(ID.substring(0,1)=="#")return document.getElementById(ID.substring(1));
		}
	}
	function writeFlash(videofile,vskin,vid,width,height,version,vsrc,vtitle,videoContainer,videoBgimg,vtitleColor,id,vtype,videoPreimg,videoAutoPlay,endCallBack){
		var so = new SWFObject(videofile,vid,width,height,version, "#000");
		so.addParam("quality", "high");
		so.addParam("swLiveConnect", "true");
		so.addParam("menu", "false");
		so.addParam("allowScriptAccess", "sameDomain");
		so.addParam("scale", "Exactfit");
		so.addParam("allowFullScreen", "true");
		//so.addParam("wmode", "transparent");
		so.addVariable("src",vsrc);
		so.addVariable("vtitle",vtitle);
		so.addVariable("sskin",vskin);
		so.addVariable("videoBgimg",videoBgimg);
		//videoBgimg, can't be undefined, send value or empty  ,or bg is black while resize stage
		//just a single player in page have no skin error in FF
		so.addVariable("videoPreimg",videoPreimg);
		so.addVariable("vtitleColor",vtitleColor)//0xFF0000
		so.addVariable("id",id);//for show related video ,sec_id or member id
		so.addVariable("vtype",vtype);//for video type 'tv','user'
		so.addVariable("videoAutoPlay",videoAutoPlay);
		so.addVariable("endCallBack",endCallBack);
		so.write(videoContainer);
		videoContainer = videoContainer;
	}
	function getScreenSize(){
		var w = 0;
		var h = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			w = window.innerWidth;
			h = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
		return {width:w,height:h};
	}
	function fullScreen(){
		if(!orginFlash.init){			
			orginFlash.position = $E(videoContainer).style.position; //"flashcontent"
			orginFlash.top = $E(videoContainer).style.top;
			orginFlash.left = $E(videoContainer).style.left;
			orginFlash.width = $E(videoContainer).style.width;
			orginFlash.height = $E(videoContainer).style.height;
		}
		orginFlash.init = true;
		orginFlash.isFullScreen = true;
		var screenSize = getScreenSize();
		try{
			$E(videoContainer).style.position = "absolute";
			$E(videoContainer).style.top = "0px";
			$E(videoContainer).style.left = "0px";
			$E(videoContainer).style.width = screenSize.width +"px";
			$E(videoContainer).style.height = screenSize.height +"px";
			document.body.style.overflow="hidden";
			window.scrollTo(0,0);
		}catch(e){
		}
	}
	function normal(){
		if(orginFlash.init){
			orginFlash.isFullScreen = false;
			try{
				$E(videoContainer).style.position = orginFlash.position;
				$E(videoContainer).style.top = orginFlash.top;
				$E(videoContainer).style.left = orginFlash.left;
				$E(videoContainer).style.width = orginFlash.width;
				$E(videoContainer).style.height = orginFlash.height;
				//document.body.style.overflow="auto";
			}catch(e){				
			}
		}
	}
	function reSize(){
		if(orginFlash.isFullScreen){
			fullScreen();
		}
	}
	window.onresize = reSize;
