﻿if(typeof loongs=="undefined")var loongs=new Object();var MediaTemp=new Array();var imgShow=new Array();imgShow["play"]="images/mm_snd.gif";imgShow["stop"]="images/mm_snd_stop.gif";var imgType=new Array();imgType["swf"]="images/flash.gif";imgType["wma"]="images/music.gif";imgType["wmv"]="images/mediaplayer.gif";imgType["rm"]="images/realplayer.gif";imgType["ra"]="images/realplayer.gif";imgType["qt"]="images/mediaplayer.gif";imgType["flv"]="images/flash.gif";var imgText=new Array();imgText["swf"]="Flash动画";imgText["wma"]="播放音频文件";imgText["wmv"]="播放视频文件";imgText["rm"]="播放real视频流文";imgText["ra"]="播放real音频流文";imgText["qt"]="播放mov视频文件";imgText["flv"]="播放flv视频文件";loongs.MSObject=function(type,id,url,width,height){if(!document.getElementById){return;};if(!type||!id||!url){return;};this.strType=type;this.strID=id;this.strURL=url;this.strWidth=width?width:'500';this.strHeight=height?height:'300';this.strPath=getRootPath();this.strImgType=MediaType(this.strType);this.strImgText=MediaText(this.strType);};loongs.MSObject.prototype={getMSHTML:function(){var msNode="";msNode+='<div class="MSPanel">';msNode+='<div class="MSTitle">';msNode+='<img class="imgtype" src="'+this.strPath+this.strImgType+'" alt="" />'+this.strImgText+'</div>';msNode+='<div class="MSContent">';msNode+='<a id="'+this.strID+'_href" href="javascript:MediaShow(\''+this.strType+'\',\''+this.strID+'\',\''+this.strURL+'\',\''+this.strWidth+'\',\''+this.strHeight+'\')"><img class="imgplay" name="'+this.strID+'_img" src="'+this.strPath+imgShow["play"]+'" alt="" /><span id="'+this.strID+'_text">在线播放</span></a>';msNode+='<div id="'+this.strID+'"></div>';msNode+='</div>';msNode+='</div>';return msNode;},write:function(elementID){var n=(typeof elementID=='string')?document.getElementById(elementID):elementID;n.innerHTML=this.getMSHTML();}};function getRootPath(){var path='';var metas=document.getElementsByTagName('meta');for(var i=0;i<metas.length;i++){if(metas[i].name=='pluginpath')path=metas[i].content;};return path;};function MediaShow(strType,strID,strURL,intWidth,intHeight){var tmpstr;var rootPath=getRootPath();if(MediaTemp[strID]==undefined)MediaTemp[strID]=false;else MediaTemp[strID]=!MediaTemp[strID];if(MediaTemp[strID]){if(document.all){document.getElementById(strID).outerHTML='<div id="'+strID+'"></div>'}else{document.getElementById(strID).innerHTML=''};document.images[strID+"_img"].src=rootPath+imgShow["play"];document.getElementById(strID+"_text").innerHTML="在线播放"}else{document.images[strID+"_img"].src=rootPath+imgShow["stop"];document.getElementById(strID+"_text").innerHTML="关闭在线播放"
switch(strType){case "swf":tmpstr='<div style="height:6px;overflow:hidden"></div><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+intWidth+'" height="'+intHeight+'"><param name="movie" value="'+strURL+'" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="'+strURL+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+intWidth+'" height="'+intHeight+'" /></object>';break;case "wma":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="MediaPlayer" width="'+intWidth+'" height="'+intHeight+'"><param name="howStatusBar" value="-1"><param name="AutoStart" value="true"><param name="Filename" value="'+strURL+'"></object>';break;case "wmv":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="'+intWidth+'" height="'+intHeight+'"><param name="FileName" VALUE="'+strURL+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+strURL+'" autostart="true" width="'+intWidth+'" height="'+intHeight+'" /></object>';break;case "rm":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="'+intHeight+'"><param name="SRC" value="'+strURL+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+strURL+'" nojava="true" controls="ImageWindow" console="one" width="'+intWidth+'" height="'+intHeight+'"></object>'+'<br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="'+intHeight+'" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+strURL+'" nojava="true" controls="StatusBar" console="one" width="'+intWidth+'" height="'+intHeight+'" /></object>'+'<br /><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="'+intHeight+'" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+strURL+'" nojava="true" controls="ControlPanel" console="one" width="'+intWidth+'" height="'+intHeight+'" autostart="true" loop="false" /></object>';break;case "ra":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" id="RAOCX" width="'+intWidth+'" height="'+intHeight+'"><param name="_ExtentX" value="6694"><param name="_ExtentY" value="1588"><param name="AUTOSTART" value="true"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="SRC" value="'+strURL+'"><param name="CONTROLS" value="StatusBar,ControlPanel"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><embed src="'+strURL+'" width="'+intWidth+'" autostart="true" height="'+intHeight+'"></embed></object>';break;case "qt":tmpstr='<div style="height:6px;overflow:hidden"></div><embed src="'+strURL+'" autoplay="true" loop="false" controller="true" playeveryframe="false" cache="false" scale="TOFIT" bgcolor="#000000" kioskmode="false" targetcache="false" pluginspage="http://www.apple.com/quicktime/" />';case "flv":tmpstr='<div style="height:6px;overflow:hidden"></div><object type="application/x-shockwave-flash" width="'+intWidth+'" height="'+intHeight+'" wmode="transparent" data="http://www.loonges.com/data/flash/mediaplayer.swf?file='+strURL+'&backcolor=0x000000&autostart=true&shownavigation=false"><param name="movie" value="http://www.loonges.com/data/flash/mediaplayer.swf?file='+strURL+'&backcolor=0x000000&autostart=true&shownavigation=false" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="http://www.loonges.com/data/flash/mediaplayer.swf" width="'+intWidth+'" height="'+intHeight+'" menu="false" quality="hight" allowscriptaccess="never" allowfullscreen="false" flashvars="file='+strURL+'&backcolor=0x000000&autostart=true&shownavigation=false"/></object>';};document.getElementById(strID).innerHTML=tmpstr;};document.getElementById(strID+"_href").blur()};function MediaType(strType){return 	imgType[strType];};function MediaText(strType){return imgText[strType];};if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];}};var MSObject=loongs.MSObject;