 /**
  * @author www.23sg.net/Jincheng
  * @version v1.5.0
  * Date:2007-10-15
  */
if(typeof(_23sg)!="object"){var _23sg={}}_23sg.$=function(objId){if(!objId){throw new Error("_23sg.$(String objId)no parameter")}if(document.getElementById){return eval('document.getElementById("'+objId+'")')}else if(document.layers){return eval("document.layers['"+objId+"']")}else{return eval('document.all.'+objId)}};_23sgFlash=function(C,v,x,V,c,X,i,O,I,l,o){var z=this;if(!document.createElement||!document.getElementById){return}z.id=v?v:"";z.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";z.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+(c?c:"7")+",0,0,0";z.width=x;z.height=V;z.movie=C;z.bgcolor=X?X:null;z.quality=O?O:"high";z.src=z.movie;z.pluginspage="http://www.macromedia.com/go/getflashplayer";z.type="application/x-shockwave-flash";z.useExpressInstall=i?i:null;z.xir=(I)?I:window.location;z.redirectUrl=l?l:null;z.detectKey=o?o:null;z.escapeIs=false;z.objAttrs={};z.params={};z.flashVars=[];z.flashVarsStr="";z.embedAttrs={};z.forSetAttribute("id",z.id);z.objAttrs["classid"]=z.classid;z.forSetAttribute("codebase",z.codebase);z.forSetAttribute("width",z.width);z.forSetAttribute("height",z.height);z.forSetAttribute("movie",z.movie);z.forSetAttribute("quality",z.quality);z.forSetAttribute("pluginspage",z.pluginspage);z.forSetAttribute("type",z.type);z.forSetAttribute("bgcolor",z.bgcolor)};_23sgFlash.prototype={getFlashHtml:function(){var I=this,i='<object ';for(var l in I.objAttrs){i+=l+'="'+I.objAttrs[l]+'" '}i+='>';for(var l in I.params){i+='<param name="'+l+'" value="'+I.params[l]+'" /> '}if(I.flashVarsStr!=""){i+='<param name="FlashVars" value="'+I.flashVarsStr+'" /> '}i+='<embed ';for(var l in I.embedAttrs){i+=l+'="'+I.embedAttrs[l]+'" '}i+=' ></embed></object>';return i},forSetAttribute:function(I,i){var l=this;I=I.toLowerCase();switch(I){case "classid":break;case "pluginspage":l.embedAttrs["pluginspage"]=i;break;case "src":l.embedAttrs["src"]=i;l.params["movie"]=i;break;case "movie":l.params["movie"]=i;l.embedAttrs["src"]=i;break;case "onafterupdate":case "onbeforeupdate":case "onblur":case "oncellchange":case "onclick":case "ondblClick":case "ondrag":case "ondragend":case "ondragenter":case "ondragleave":case "ondragover":case "ondrop":case "onfinish":case "onfocus":case "onhelp":case "onmousedown":case "onmouseup":case "onmouseover":case "onmousemove":case "onmouseout":case "onkeypress":case "onkeydown":case "onkeyup":case "onload":case "onlosecapture":case "onpropertychange":case "onreadystatechange":case "onrowsdelete":case "onrowenter":case "onrowexit":case "onrowsinserted":case "onstart":case "onscroll":case "onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "type":l.embedAttrs["type"]=i;break;case "codebase":l.objAttrs["codebase"]=i;break;case "width":l.objAttrs["width"]=i;l.embedAttrs["width"]=i;break;case "height":l.objAttrs["height"]=i;l.embedAttrs["height"]=i;break;case "align":l.objAttrs["align"]=i;l.embedAttrs["align"]=i;break;case "vspace":l.objAttrs["vspace"]=i;l.embedAttrs["vspace"]=i;break;case "hspace":l.objAttrs["hspace"]=i;l.embedAttrs["hspace"]=i;break;case "class":l.objAttrs["class"]=i;l.embedAttrs["class"]=i;break;case "title":l.objAttrs["title"]=i;break;case "accesskey":l.objAttrs["accesskey"]=i;break;case "name":l.objAttrs["name"]=i;l.embedAttrs["name"]=i;break;case "id":l.objAttrs["id"]=i;l.embedAttrs["name"]=i;break;case "tabindex":l.objAttrs["tabindex"]=i;break;default:l.params[I]=l.embedAttrs[I]=i}},forGetAttribute:function(i){var I=this;i=i.toLowerCase();if(I.objAttrs[i]!=undefined){return I.objAttrs[i]}else if(I.embedAttrs[i]!=undefined){return I.embedAttrs[i]}else if(I.embedAttrs!=undefined){return I.embedAttrs[i]}else{return null}},setAttribute:function(I,i){this.forSetAttribute(I,i)},getAttribute:function(i){return this.forGetAttribute(i)},addVariable:function(I,i){var l=this;if(l.escapeIs){I=escape(I);i=escape(i)}if(l.flashVarsStr==""){l.flashVarsStr=I+"="+i}else{l.flashVarsStr+="&"+I+"="+i}l.embedAttrs["FlashVars"]=l.flashVarsStr},getVariable:function(I){var o=this,i=o.flashVarsStr;if(o.escapeIs){I=escape(I)}var l=new RegExp(I+"=([^\\&]*)(\\&?)","i").exec(i);if(o.escapeIs){return unescape(RegExp.$1)}return RegExp.$1},addParam:function(I,i){this.forSetAttribute(I,i)},getParam:function(){return this.forGetAttribute(name)},write:function(i){var I=this;if(typeof i=="string"){_23sg.$(i).innerHTML=I.getFlashHtml()}else if(typeof i=="object"){i.innerHTML=I.getFlashHtml()}}}
function $E(id){ return document.getElementById(id);}
function loadPlayer(_f,_w,_h,_a,_A,_p){
	if(_p==2){
	var so = new _23sgFlash("/v/player2.swf", "FlvPlay", _w, _h, "8");
	try{
	so.addParam("menu", "false");
	so.addParam("allowFullScreen", "true");
	so.addParam("allowScriptAccess","always");
	so.addVariable("GlowColor", 0x66FF00);
	so.addVariable("BarColor", 0x3D3D3D);
	so.addVariable("BarTransparent", 100);
	so.addVariable("BarPosition", 1);
	so.addVariable("IsShowBar", 1);
	so.addVariable("IsAutoPlay", _A?_A:"1");//_A当作字符，以字符传入，不要以数值传入，否则始终都为自动播放
	so.addVariable("LogoText", "rugesy.cn");
	//so.addVariable("BeginSwf", "/v/beginflash2.swf");
	//so.addVariable("EndSwf", "/v/endflash2.swf");
	so.addVariable("vcastr_file", _f);
	//so.addVariable("vcastr_xml", "/v/vcastr.asp");
	}catch(e){}
	so.write(_a?_a:"viewsp_area");
	}else if(_p==1){
	var so = new _23sgFlash("/v/player.swf", "FlvPlay", _w, _h, "8");
	try{
	so.addParam("menu", "true");
	so.addParam("allowFullScreen", "true");
	so.addVariable("auto", _A?_A:"1");
	so.addParam("quality", "high");
	so.addParam("bgcolor", "#ffffff");
	so.addVariable("id", _f);
	so.addVariable("webroot","http://www.rugesy.cn");
	}catch(e){}
	so.write(_a?_a:"viewsp_area");
	}else if(_p==0){
		var bMedia = false;
		try
		{
			var Media =  new ActiveXObject("WMPlayer.OCX.7");
			bMedia = true;
		}catch(e){};
		if(bMedia)
		{
			var pv='';
			pv += '<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" id="mPlayerswf" width="'+_w+'" height="'+_h+'">';
			pv += '<param name="FileName" value="'+_f+'">';
			pv += '<param name="ShowControls" value="0">';
			pv += '<param name="invokeURLs" value="0">';
			pv += '<param name="ShowStatusBar" value="0">';
			pv += '</object>';
			_a?$E(_a).innerHTML=pv:$E("viewsp_area").innerHTML=pv;
		}else{
			loadPlayer(_f,_w,_h,_a,_A,_p);
		}
	}else if(_p==55){
		try{
			var pv='';
			var tAuto=_A?_A:"1";
			pv += '<object classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" id="mPlayer" width="'+_w+'" height="'+_h+'" onclick=function(){if (mPlayer.playState==3)mPlayer.fullScreen="true"}>';
			pv += '<param name="url" value="'+_f+'">';
			pv += '<param name="volume" value="65">';
			pv += '<param name="enablecontextmenu" value="1">';
			pv += '<param name="enableerrordialogs" value="0">';
			pv += '<param name="showdisplay" value="0">';
			pv += '<param name="invokeURLs" value="0">';
			pv += '<param name="AutoStart" value="'+tAuto+'">';
			pv += '<param name="playcount" value="100">';
			pv += '</object>';
			_a?$E(_a).innerHTML=pv:$E("viewsp_area").innerHTML=pv;
		}catch(e){}
	}else{
	var so = new _23sgFlash( _f, "FlvPlay", _w, _h, "8");
	try{
	so.addParam("menu", "false");
	so.addParam("allowFullScreen", "true");
	so.addParam("allowFullScreen", "true");
	so.addParam("quality", "high");
	so.addParam("bgcolor", "#ffffff");
	}catch(e){}
	so.write(_a?_a:"viewsp_area");
	}
}
