hta+html+js+mediaplay写的支持lrc显示的歌曲播放器

 <html>
<head>
<title>QPlayer1.01.080107</title>
<HTA:APPLICATION ID="QPlayer"
APPLICATIONNAME="QPlayer"
border="thin"
ICON = ""
MAXIMIZEBUTTON ="no"
WINDOWSTATE = ""
SINGLEINSTANCE = "yes"
SELECTION = "yes"
INNERBORDER = "no"
VERSION = "1.0" />
<style>
 li{
    cursor:hand;
  }
 
  #selectedPath {
    background:green;
  }
 
  input{
     height:17px;
     vertical-align:middle;
     border:1px solid black;
  }
 
  body {
 scrollbar-face-color: black;
 scrollbar-highlight-color: black;
 scrollbar-shadow-color: white;
 scrollbar-darkshadow-color: black;
 scrollbar-3dlight-color: white;
 scrollbar-arrow-color: green;
 scrollbar-track-color: black;
 scrollbar-base-color: black;
}
</style>
</head>
<body scroll=no topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0  style="background:black; color:white;" onselectstart="return false;" οncοntextmenu="return false;">

<input type="file" id="filePath" style="display:none;"> 

<OBJECT ID="mplayer"
  CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="width:0px; height:0px; display:none;">
  <PARAM name="autoStart" value="false">
</OBJECT>

<div id=towWin style="border:1px solid green; width:300px;height:441px;">

<span id=oneWin style="border-bottom:1px solid green; width:100%; height:49px;">

<span
 style="font-size: 15pt; width:100%; height:23px; white-space:nowrap; overflow:hidden; border-bottom:1px solid green; "
  οnmοuseοver="showLrcButton(1);" οnmοuseοut="showLrcButton(0);"><span
  style="width:50%;
 overflow:hidden;"><span
  style=" width:100%;"></span><span
  id=bottomLrc
 style=" position : relative; color:rgb(79,198,0);"></span></span><span
  style="width:50%; overflow:hidden;"><span
 id=topLrc style=" position : relative; color:rgb(159,208,0);"></span></span></span>

<span id=lrcButton style="top:0px; left:0px; width:100%px; height:23px; position:absolute; display:none; " οnmοuseοver="showLrcButton(1);" οnmοuseοut="showLrcButton(0);"><input
 type=button value=搜索 οnclick="searchLrc()" hidefocus><input
  type=button value=重载 οnclick="reloadLrc()" hidefocus><input
   type=button value=编辑 οnclick="showEditLrcSpan()" hidefocus><input
    type=button value=打开 οnclick="showLrcFile()" hidefocus><input
    type=button value=删除 οnclick="delLrcFile()" hidefocus></span>
   
    <a href=# οnclick="playNewMusic(-1)"
   style="font-family:Webdings; font-size:20px; color:white; text-decoration:none;" hidefocus>9</a><a href=#
   id=playPauseB οnclick="playPause(this);"
   style="font-family:Webdings; font-size:20px; color:white; text-decoration:none;" hidefocus>4</a><a href=#
   οnclick="stopPlayer()"
  style="font-family:Webdings; font-size:20px; color:white; text-decoration:none;" hidefocus><</a><a href=#
  οnclick="playNewMusic(1)"
  style="font-family:Webdings; font-size:20px; color:white; text-decoration:none;" hidefocus>:</a>
<a href=# id="playMode" οnclick="changePlayMode()"
 style="font-family:Webdings; font-size:20px; color:white; text-decoration:none;" hidefocus>`</a>
 <a href=#
 id=winState οnclick="showListWin()"
   style="font-family:Webdings; font-size:17px; color:white; text-decoration:none;" hidefocus>1</a>

<span style="cursor:default; border:1px solid orange; background:green; height:15px; width:102px; overflow:hidden;"  οnmοusedοwn="positionStart(this)"
 onmousemove ="changePosition();" οnmοuseup="positionEnd()"><span
 id=positionNum style="font-size:10px; width:50px; border-right:1px solid orange; text-align:center; color:orange; text-align:center;">00:00:00</span><span
       id=mediaLen style="font-size:10px; width:50px; border-left:1px solid orange; text-align:center;  text-align:center;">00:00:00</span><span id=positionBar
        style="width:0px; font-size:4px; background:orange;"></span></span><span style="cursor:default; border:1px solid orange; background:green; font-size:10px; height:15px; width:52px; overflow:hidden;" οnmοusedοwn="moveObj = this; this.setCapture(true); changeVol();"
 onmousemove ="changeVol();" οnmοuseup="moveObj.releaseCapture(); moveObj=null;"><span id=volNumber style="color:orange; text-align:center; width:50px;">100%</span><span id=volBar style="width:30px; font-size:4px; background:orange;"></span></span>
  
</span>


<span style="color:green; width:100%; height:390px; overflow-y:auto; word-wrap :break-word; "   οncοntextmenu="return showListMenu(event.srcElement);">
<ol start="1" type="1" id="list" οndblclick="clickPlay(event.srcElement)"></ol>
</span>


<span id=editLrcSpan style="top:68px; left:0px; width:100%; height:373px;  position:absolute; display:none;background:black; overflow:auto;" nowrap=true>
<textarea id=editText style="width:100%; height:310px; padding:10px;" οnclick="typeTime()">
</textarea><BR>
标题<input id=editLrcTitle style="width:113px;">
专辑<input id=editLrcAuthor style="width:113px;"><br>
演唱<input id=editLrcArtist style="width:113px;">
编辑<input id=editLrcEditer style="width:113px;"><br>
插入时间<input type=checkbox id=enableType><input
 type=button value=保存为 οnclick="editLrcSave()" style="width:42px;"><input id=editLrcFile style="width:142px;"><input
 type=button value=关闭 οnclick="editLrcSpan.style.display = 'none';" style="width:30px;">
</span>

<span id=winSpan style="top:68px; left:0px; width:100%; height:373px;  position:absolute; display:none; background:black;"></span>

<span id=settingSpan style="top:68px; left:0px; width:100%; height:373px;  position:absolute; display:none;background:black;"><p><input type=button value="关闭设置窗口" οnclick="showSettingSpan()" style="width:100%;"></p><span
 style="height:330px; border:1px solid orange; overflow:auto; white-space:nowrap; padding:5px; color:orange;">
<li>歌词文件夹<input value="lrc" id=lrcFolder οnclick="showDrivers('lrcFolder.value = folderSpan.path');" style="width:186px;" CONTENTEDITABLE = false>
<li>删除歌曲后删除歌词<input id=delLrc type=button value="立刻删除" οnclick="changeDelLrcValue()" style="width:124px;" hidefocus>
<li>删除歌曲或歌词成功后<input id=alertDel type=button value="不提示" οnclick="this.value = (this.value == '提示'?'不提示':'提示');" style="width:108px;" hidefocus>
<li>单曲试听x秒(小于10禁用)<input id=testListen type=button value="0" οnclick="setTestTime()" style="width:83px;" hidefocus>
<li>歌曲在列表中显示方式<input id=musicTitle type=button value="文件名.格式" οnclick="changeMusicTitle()" style="width:108px;" hidefocus>
<li>普通歌词颜色<input id=lrcTopColor type=button value="orange" οnclick="showColorBar('setLrcTopColor')" style="width:172px;" hidefocus>
<li>高亮歌词颜色<input id=lrcBottomColor type=button value="black" οnclick="showColorBar('setLrcBottomColor')" style="width:172px;" hidefocus>
<li>列表字体颜色<input id=listFontColor type=button value="green" οnclick="showColorBar('setListFontColor')" style="width:172px;" hidefocus>
<li>列表背景颜色<input id=listBackColor type=button value="black" οnclick="showColorBar('setListBackColor')" style="width:172px;" hidefocus>
<li>列表高亮颜色<input id=listPlayColor type=button value="RGB(0, 250, 0)" οnclick="showColorBar('setListPlayColor')" style="width:172px;" hidefocus>
<li>置顶播放条目<input id=showPlaying type=button value="0" οnclick="this.value = (this.value == '1') ? 0 : 1;" style="width:172px;" hidefocus>
</span></span>

<span id=folderSpan path="" evalText="alert(folderSpan.path);"
 style="top:68px; left:0px; width:100%; height:373px; position:absolute; display:none; color:orange; border:1px solid orange; background:black; " nowrap=true></span>

<span id=alertSpan style="top:68px; left:0px; width:100%; height:373px; vertical-align:middle; text-align:center;  position:absolute; display:none; background:black; overflow:auto;"></span>

<span id=menu οnblur="hideListMenu()" οnclick="hideListMenu()" style="padding:4px; color:orange; border:1px dashed  white; height:200px; width:200px; white-space:nowrap; overflow:auto; position:absolute; display:none; background:green;" type="disc">
<li οnclick="if (typeof(currentPlaying) == 'object'){currentPlaying.scrollIntoView(1)}">显示播放歌曲
<li οnclick="delList(listMenuSrc);">删除选中歌曲
<li οnclick="delList(currentPlaying);">删除播放中歌曲
<li οnclick="getfile(getFilePath());">添加单首歌曲
<li οnclick="showDrivers('getallfolder(folderSpan.path)');">添加歌曲文件夹
<li οnclick="openWeb(prompt('输入音乐网址(不是音乐文件下载地址)',''));">添加网络歌曲
<li οnclick="clearList()">清空播放列表
<li οnclick="delDeadList()">删除本地不存在列表
<li οnclick="saveList()">保存播放列表
<li οnclick="loadList(getFilePath())">载入播放列表
<li οnclick="showDrivers('downMusic(folderSpan.path)');">下载正播放中的文件
<li οnclick="showRenameBar(listMenuSrc);">重命名选中歌曲
<li οnclick="showFolder(listMenuSrc.filePath)">浏览选中文件
<li οnclick="showDrivers('sendTo(listMenuSrc.filePath,folderSpan.path)');">发送到...
<li οnclick="showSearch()">查找
<li οnclick="showSettingSpan()">播放器设置
<li οnclick="showFolder(lrcFolder.value)">打开歌词目录
<li οnclick="showFolder(htaPath)">打开程序目录
<li οnclick="viewSource()">查看源代码
<li οnclick="showTestWin()">打开测试窗口
</span>

</div>

</body>
</html>
<script>

function reportError(msg,url,line)
{
 alert("当前页的脚本发生错误: /n/n信息: " + msg + "/n/n行:" + line);
 return true;
}
window.onerror = reportError;

function show(html)
{
   alertSpan.style.display = "";
   alertSpan.innerHTML = '<input type=button value=隐藏提示信息 οnclick="alertSpan.style.display = /'none/';"><br>' + html;
}

</script>

<script>

var fso = new ActiveXObject("Scripting.FileSystemObject");
var runtime = 100;
var foldersarray;
var fsotime;
var fp = null;
var currentFolder;//文件夹数组的下标
var playTimer;
var htaPath = fso.getparentfoldername(unescape(location.pathname).match(/[a-z]/:[^/:/.]+/.hta$/gi)) + "//";//根目录
var defaultList = htaPath + "QplayerList";//默认播放列表
var lrcTimer;//定时显示歌词
var webTimer;//测试网页载入状态
var listMenuSrc  = undefined;//列表点左键对象
var showList = 0; //显示当前歌曲列表
var scrollTimer;//定时滚动句柄
var showLrcTimer;//换歌词句柄
var lrcLeft;
var positioner; //position 定时句柄
var moveObj = null;//移动对象
var winWidth = 0;//窗口横向边框宽度
var winHeight = 0; //窗口坚向边框宽度
var thisLrcWidth = 0;//当前lrc

function getFilePath()
{
   filePath.click();
   return filePath.value;
}

function showFolders(obj, click)
{
     if (obj.tagName != "LI")
     {
       return 0;
     }
    
     if (click)
     {//点击,选择     
         if (obj.disabled == false)
         {               
           if (typeof(selectedPath) == "object")
           {
              selectedPath.removeAttribute("id");
           }
          
           obj.id = "selectedPath";
           folderSpan.path = obj.path;
         }
     }else if (obj.type == "disc")
      {
          if ( (obj.nextSibling == null) || (obj.nextSibling.tagName == "LI"))
          {//展开
         
             var drvs = new Enumerator(fso.getfolder(obj.path).SubFolders);
             var drvsText = '<dir>';
             var drv;
             var liType;
             var folderL;
            
                 for (; !drvs.atEnd(); drvs.moveNext())
                 {
                     drv = drvs.item();
                     liType = "circle";
                    
                     try
                     {
                       folderL = fso.getfolder(drv).SubFolders.count;
                     }catch(e)
                      {
                        folderL = 0;
                      }
                     
                     if (folderL)
                     {//有文件夹
                       liType = "disc";
                     }
              
                     drvsText += '<li type="' + liType + '" path="' + drv.path + '">' + drv.name;
                 }
             drvsText += '</dir>';
  
             obj.insertAdjacentHTML("afterEnd",drvsText);
         }else
          {
             obj.nextSibling.outerHTML = "";
          }
      }
}

function showDrivers(functionH)
{
    folderSpan.evalText = functionH;
    folderSpan.style.display = "";
   
    var drvs = new Enumerator(fso.Drives);
    var drvsText = '<input type=button value="取消" οnclick="folderSpan.style.display =/'none/'; folderSpan.evalText = /'/'; folderSpan.path = /'/';">';
    drvsText += '<input type=button value="确定" οnclick="folderSpan.style.display =/'none/'; eval(folderSpan.evalText);">';
    drvsText += '<dir id=myDrivers οndblclick="showFolders(event.srcElement, 0)" οnclick="showFolders(event.srcElement, 1)" style="width:255px; height:310px; overflow:auto;">';
    var drv;
    var liType;
    var disabled;
    var typeText;
    var folderL;
   
         for (; !drvs.atEnd(); drvs.moveNext())
         {
            drv = drvs.item();
            liType = "circle";
            disabled = " disabled";
            typeText = "本地磁盘";

            if (drv.IsReady)
            {//可用
               disabled = "";
              
                    
               try
               {
                    folderL = fso.getfolder(drv.rootfolder).SubFolders.count;
               }catch(e)
                {
                        folderL = 0;
                }
               
               if (folderL)
               {//有文件夹
                 liType = "disc";
               }
              
               drvsText += '<li type="' + liType + '" path="' + drv.rootfolder + '"' + disabled + '>' + typeText + drv.VolumeName + "(" + drv.DriveLetter + ")";        
            }else
             {
                   switch (drv.DriveType)
                  {
                     case 0: typeText = "未知设置"; break;
                     case 1: typeText = "移动磁盘"; break;
                     case 2: typeText = "软盘"; break;
                     case 3: typeText = "网络磁盘"; break;
                     case 4: typeText = "光驱"; break;
                     case 5: typeText = "闪存磁盘"; break;
                  }

                   drvsText += '<li type="' + liType + '" path="' + drv + '"' + disabled + '>' + typeText + "(" + drv.DriveLetter + ")";
             }
         }
  
   drvsText += '</dir>';
  
   folderSpan.innerHTML = drvsText;
}

function openWeb(url)
{
    if (url == null)
    {
      return 0;
    }else if (url.match(/^http/:.*/..+/..+/gi) == null)
     {
         return show("网页地址格式不对");
     }
        winSpan.style.display = "";
        winSpan.innerHTML = '<iframe id=win style="scrollbar-face-color: black;width:100%;height:280px;"'
                          + ' src="' + url + '">'
                          + '</iframe>'
                          + '<input type=button value=关闭网页'
                          + ' οnclick="winSpan.innerHTML =/'/'; winSpan.style.display = /'none/';" style="width:55px;'
                          + 'border:1px solid red;background:orange;">'
                          + '<input type=button value=添加剪贴板音乐链接'
                          + ' οnclick="addlist(window.clipboardData.getData(/'Text/'));" style="width:119px;'
                          + ' border:1px solid red;background:orange;">'
                          + '<input type=button value=自动提取音乐链接'
                          + ' οnclick="addMusicLinks(0);" style="width:107px;'
                          + ' border:1px solid red;background:orange;">';
}

function addMusicLinks(linkI)
{//添加打开的网页中所有的音乐链接
          try
          {
             var theLinks = win.document.links; 
        
             if (linkI < theLinks.length)
             {            
                 if ( theLinks[linkI].href.match(/^.+/.(midi?)|(mp3)$/gi) != null)
                  {
                     list.insertAdjacentHTML("beforeEnd",'<li filePath="'
                            + theLinks[linkI].href + '">' + theLinks[linkI].outerText );
                  }                
            
                  clearTimeout(fsotime);            
                  fsotime = setTimeout("addMusicLinks(" + (linkI + 1) + ");", runtime);
             }else
              {
                 show("自动查找网页音乐链接并添加完成");
              }
         }catch(e)
           {
               win =  null;
               return show("网页对象win不可用,可能是没打开音乐网页,或已关闭了");
           }
             
}

function getfile(path)
{
     if ( fso.fileExists(path))
    {
        addlist(path);        
      }else if (path != "")
        {
            show("出错啦!/n[" + path + "] 文件不存在!");
          }
}

function getallfolder(path)
{
         if ( fso.fileExists(path) || fso.folderExists(path))
       {
            fsotime = null;
            mygetfolder(path);
           
         }else
        {
            show("出错啦!/n[" + path + "] 文件夹不存在!");
          }
}

function mygetfolder(path){//自己递归时没参数

      if(path != undefined)
      {
         clearTimeout(fsotime);
         fp = null;
         currentFolder = 0;
         foldersarray = new Array(fso.getFolder(path).path);
      }

      try
      {
         if(fp == null)
         {
           var folderObj = fso.getFolder(foldersarray[currentFolder++]);
           //show('正在获取后面文件夹下的文件夹...<br>' + folderObj);
           fp = new Enumerator(folderObj.subFolders);
         }
        
      }catch(e)
       {
         //show("已把所有文件夹读取完成");
         fp = null;
         clearTimeout(fsotime);
         return doallfile();
       }

      if(!fp.atEnd())
      {
         foldersarray[foldersarray.length] = fp.item().path;
         fp.moveNext();
      }
       else
       {
           fp = null;
       }
      
       clearTimeout(fsotime);
      
       if (fsotime == "abort")
       {
          show("文件夹读取的操作已被取消");
       }else
        {
           fsotime = setTimeout("mygetfolder()",runtime);
        }
        
}

function doallfile(start){
        
         try
         {
            foldersarray.length < 1;
         }catch(e)
          {
      return show("请先点[获取全部文件夹]获取要处理的文件夹对象");
          }

         if(fp == null)
         {
            try
            {
               fp = new Enumerator(fso.getfolder(foldersarray.shift()).files);
            }catch(e)
             {
                show("已完成音乐文件添加");
                theno = fp = nowi = null;
                return clearTimeout(fsotime);
             }
         }

         if(!fp.atEnd())
         {
           try
           {
                addlist( fp.item().path );
           }catch(E)
            {
               show("执行自定义处理文件方法时出错:" +  E.description);
            }
           fp.moveNext();
         }
          else
         {
           fp = null;
         }

       clearTimeout(fsotime);
      
       if (fsotime == "abort")
       {
          show("文件读取的操作已被取消");
       }else
        {
           fsotime = setTimeout("doallfile(1)",runtime);
        }

}

function addlist(filePath, fileName)
{
        if (  (filePath.indexOf(":") == 1)
           && (/^[a-z]:[][^:]+/.(?:mp3)|(?:mid)|(?:midi)|(?:wma)|(?:asf)|(?:wmv)|(?:avi)|(?:wav)|(?:au)|(?:ape)$/gi.test(filePath) == false) )
        {//非以上格式文件 不加
           return 0; 
        }

        if (fileName == undefined)
        {
            fileName = filePath;
        }
       
        //show('添加:<br>' + filePath);
       
        switch (musicTitle.value)
        {
             case "文件名.格式":
                fileName = fso.getfile(fileName).name;
                break;
             case "文件名":
                fileName = fso.getbasename(fileName);
                break;
             case "完整路径":
                ;
                break;
        }
       
        list.insertAdjacentHTML("beforeEnd",'<li filePath="' + filePath + '">' + fileName );
}

function changePlayMode()
{
        switch(playMode.innerText)
        {
           case "`"://顺序
              playMode.alt = "随机选择";
              playMode.innerText = "-";//随机
              break;
           case "-":
              playMode.innerText = "q";//单曲连播
              playMode.alt = "单曲循环";
              break;
           case "q":
              playMode.innerText = "`";
              playMode.alt = "顺序和循环";
              break;
        }
}

function playPause(obj)
{
      if (mplayer.controls.isAvailable('pause'))
      {
         mplayer.controls.pause();
      }else if (mplayer.controls.isAvailable('play'))
       {
         mplayer.controls.play();
       }
}

function stopPlayer()
{
      mplayer.controls.stop();
}

function changeVol()
{
  if (moveObj != null)
  {
   var theNum = event.x - moveObj.offsetLeft;
  
  if ((theNum > -1) && (theNum < 51))
  {
   volNumber.innerText = "音量" + theNum * 2 + "%";
   volBar.style.width = theNum;
   mplayer.settings.volume = theNum * 2;
  }
 }
}

function positionStart(obj)
{
    if (mplayer.controls.isAvailable("currentPosition"))
    {
      moveObj = obj;
      obj.setCapture(true);
      clearInterval(positioner);
      changePosition();
    }
}

function changePosition()
{
  if (moveObj != null)
  {
   var theNum = event.x - moveObj.offsetLeft;
  
  if ((theNum > -1) && (theNum < 101))
  {
    positionBar.style.width = theNum;
    var len = mplayer.currentMedia.duration * theNum / 100
    positionNum.innerText = Math.floor(len / 3600) + ":" + Math.floor((len % 3600) / 60) + ":" + Math.floor(len % 60);
  }
 }
}

function positionEnd()
{
   if (moveObj != null)
   {
       moveObj.releaseCapture();
       moveObj=null;
       mplayer.controls.currentPosition = parseInt(positionBar.style.width) * mplayer.currentMedia.duration / 100;
   }
}

function setPosition()
{
     try
     {
         positionNum.innerText = mplayer.controls.currentPositionString;
         positionBar.style.width = mplayer.controls.currentPosition * 100 / mplayer.currentMedia.duration;
     }catch(e){}
}

function playNewMusic(how)
{
        if (list.children.length == 0)
        {
              return 0;
        }
       
        if (typeof(currentPlaying) != "object")
         {
            list.firstChild.id = "currentPlaying";
         }
        
        switch(playMode.innerText)
        {
           case "`"://顺序重复列表
             if (how > 0)
             {
                if (currentPlaying == list.lastChild)
                {
                   playthis(list.firstChild);
                }else
                 {
                   playthis(currentPlaying.nextSibling);
                 }
              }else
               {
                if (currentPlaying == list.firstChild)
                {
                   playthis(list.lastChild);
                }else
                 {
                   playthis(currentPlaying.previousSibling);
                 }
               }
             
              break;
           case "-"://随机列表歌曲
             if (list.length == 1)
             {
                   playthis(currentPlaying.fistChild);
              }else
               {
                   var newLi = list.children[Math.ceil(list.children.length * Math.random())];
                   playthis(newLi);
               }
              break;
           case "q"://单曲重复播放
              playthis(currentPlaying);
              break;
        }     
}

function clickPlay(obj)
{
  if (obj.tagName != "LI")
  {
     return 0;
  }
 
  if(typeof(currentPlaying) != "object")
  {
     obj.id = "currentPlaying";
  }
  playthis(obj);
}

function playthis(srcObj, state, position)
{
       if (typeof(currentPlaying) == "object")
       {
         playingAttribute(currentPlaying, 0);
       }
      
       playingAttribute(srcObj, 1);
       mplayer.url = currentPlaying.filePath;
      
       if ( (position = parseInt(position)) > 0)
       {
             mplayer.controls.currentPosition = position;
       }
      
       document.title = currentPlaying.outerText;
      
       if (state != 1)
       {//1,stop; other,playing
          mplayer.controls.play();
       }
      
       if (showList && (showPlaying.value * 1))
       {
         currentPlaying.scrollIntoView(1);
       }
}

function playingAttribute(srcObj, how)
{
      if (how)
      {
        srcObj.id = "currentPlaying";
        srcObj.style.color = listPlayColor.value;
      }else
       {
         currentPlaying.removeAttribute("style");
         currentPlaying.removeAttribute("id");
       }
}

function showListMenu(obj)
{    
      menu.style.display = '';
      menu.focus();
      menu.style.top = event.clientY;
      menu.style.left = event.clientX;     
      listMenuSrc = obj;
          
      if (obj.tagName == "LI")
      {
         listMenuSrc.style.background = "yellow";
      }
}

function hideListMenu()
{
  listMenuSrc.style.background = "";
  menu.style.display = "none";
}

function delList(EObj, auto)
{   
    if (
     (typeof(EObj) == "object") && (EObj.tagName == "LI")
  && ( (auto == "yes") || confirm(EObj.outerHTML + "/n/n确定要删除这条列表?") ) )
    {
        var filePath = EObj.filePath;
        var nextLi;
       
        if (EObj.id == "currentPlaying")
        {
            if ( ((nextLi = EObj.nextSibling) != null)
              || ((nextLi = EObj.previousSibling) != null) )
            {
               currentPlaying.removeAttribute("id");
               EObj.outerHTML = "";
              
               playthis(nextLi);
            }else
            {
                mplayer.close();
                currentPlaying.removeAttribute("id");
                EObj.outerHTML = "";
            } 
        }else
         {
            EObj.outerHTML = "";
         }
      
       if (fso.fileexists(filePath) && confirm("同时删除硬盘中的文件?"))
       {
             try
            {      
               fso.DeleteFile (filePath, 1);
              
               if (alertDel.value == "提示")
               {
                 show(filePath + "删除成功");
               }
            }catch(e)
            {
               show("未明原因,无法删除" + filePath + "/n/n" + e.description);
            }
       }
       
       filePath = lrcFolder.value + "// " + fso.getbasename(filePath) + ".lrc";
      
       if ( fso.fileexists(filePath) && (delLrc.value == "立刻删除")
        || ((delLrc.value == "提示删除") && confirm("同时删除硬盘中同名的歌词文件?"))
           )
       {
             try
            {
               fso.DeleteFile (filePath, 1);
              
               if (alertDel.value == "提示")
               {
                 show(filePath + "删除成功");
               }
            }catch(e)
            {
               show("未明原因,无法删除" + filePath + "/n/n" + e.description);
            }
       }
    }
}

function showSearch()
{
         show('输入要查找文字后回车<br>'
            + '<input οnkeydοwn="searchStart(this);" style="width:100%;" index=0>'
            + '<BR><span id=found></span>');
}

function searchStart(obj)
{
         var index = obj.index * 1;
         var text;
        
         if ((event.keyCode == 13) && (obj.value.match(/^ *$/g) == null))
         {
            for (; index < list.children.length; ++index)
            {
               text = list.children[index].innerText;
               if (text.indexOf(obj.value) > -1)
               {
                 found.innerHTML = '<input type=button value="点击播放[' + text + ']"'
                                 + ' οnclick="clickPlay(list.children[' + index + '])">';
                 return obj.index = index + 1;
               }
            }
           
            obj.index = 0;
            found.innerHTML = '查找结束';
         }
}

function showRenameBar(obj)
{   
    if ( (typeof(obj) == "object") && (obj.tagName == "LI"))
    {
        if (!fso.fileExists(obj.filePath))
        {//找不到文件了
           show("找不到[" + obj.filePath + "]文件.<br>可能已被删除或移动!");
        }else
         {
            show("请更改文件名后按回车键<br><span id=reNameAlert style='color:red;'></span><BR>"
               + '<input value="' + fso.getBaseName(obj.filePath) + '" '
               + 'onkeyDown="if(event.keyCode == 13){renameList(this.value)}" >.'
               + fso.GetExtensionName(obj.filePath));
         }
    }
}

function renameList(newName)
{
   try
   {
     if (mplayer.url == listMenuSrc.filePath)
     {
         playNewMusic(1);
     }
    
     var newPath = fso.GetParentFolderName(listMenuSrc.filePath) + "//"
               + newName + '.' + fso.GetExtensionName(listMenuSrc.filePath);
     fso.MoveFile(listMenuSrc.filePath, newPath);
       
     var lrcOld = lrcFolder.value + "//" + fso.getBaseName(listMenuSrc.filePath) + '.lrc';
    
     if (fso.fileExists(lrcOld))
     {//更改同名歌词名
       fso.MoveFile(lrcOld, lrcFolder.value + "//" + newName + '.lrc');
     }
    
     listMenuSrc.filePath =  newPath;
     listMenuSrc.innerText = newName;
    
     reNameAlert.innerText = '重命名成功';
     setTimeout("alertSpan.style.display = 'none';", 1000);
   }catch(e){
        reNameAlert.innerText = '重命名出错:' + e.description;
    }
}

function clearList()
{
   if (typeof(currentPlaying) == "object")
   {
         currentPlaying.removeAttribute("id");
   }
  
   list.innerHTML = "";
   currentFolder = undefined;
}

function delDeadList()
{
   for (var listI = 0; listI < list.children.length; ++listI)
   {
       if (
            (fso.GetDriveName(list.children[listI].filePath) != "")
         && ( !fso.fileExists(list.children[listI].filePath) ) )
       {
          delList(list.children[listI], "yes");
       }
   }
  
   show("清除无用列表完成");
}

function getLrc(reload)
{
    if (typeof(currentPlaying) != "object")
    {
       return 0;
    }
   
    var lrcName = fso.getbasename(currentPlaying.outerText);
    var title = mplayer.currentMedia.getItemInfo("title");
    var Artist = mplayer.currentMedia.getItemInfo("Artist");
    var lrcPath = lrcFolder.value + "//" + lrcName + ".lrc";
   
    if ( (!reload) &&  topLrc.children.length
      && (topLrc.children[0].fileName == lrcName) )
    {
       showLrc1();
    }else if (  fso.fileexists(lrcPath)
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + title + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + Artist + "_" + title + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + Artist + "-" + title + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + Artist + " - " + title + ".lrc")
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + Artist + " " + title + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + title + "_" + Artist + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + title + "-" + Artist + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + title + " - " + Artist + ".lrc")
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + title + " " + Artist + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + lrcName.split("_")[0] + ".lrc" )
             || fso.fileexists(lrcPath = lrcFolder.value + "//" + lrcName.split("_")[1] + ".lrc" )
              )
    {
        var lrcArray = new Array();
        lrcArray[0] = new Array('<span t="0" fileName="' + lrcName + '"><span style="display:none;">歌词文件名:' + lrcName, " </span></span>");
       
        lrcToText(lrcArray, lrcPath);
    }else
     { 
        bottomLrc.style.left = "0px"; 
        topLrc.style.left = "0px";
        bottomLrc.innerText = "";
        topLrc.innerText = "硬盘中没有歌词";
     }
}

function lrcToText(lrcArray, lrcPath)
{
    var fp = fso.openTextFile(lrcPath);
   
    var lrcLine;
    var lrcText = "";
    var matchTime;
    var lrcTime;
    var offset = 0;
   
    while (!fp.AtEndOfStream)
    {
        lrcLine = fp.readLine();
               
        if (lrcLine.match(//[ti:([^/[:/]]+)/]/gi))
        {
             lrcArray[0][1] = "歌曲名:" + RegExp.$1 + lrcArray[0][1] + " ";
        }else if (lrcLine.match(//[ar:([^/[:/]]+)/]/gi))
         {
             lrcArray[0][1] = "演唱者:" + RegExp.$1 + lrcArray[0][1] + " ";
         }else if (lrcLine.match(//[offset:([^/[:/]]+)/]/gi))
           {
              offset = RegExp.$1;
           }else if ((matchTime = lrcLine.match(//[/d+:/d+/.?/d+/]/g)))
            {               
                lrcText = lrcLine.replace(//[/d+:/d+/.?/d+/]/g,"");
               
                while (matchTime.length)
                {
                  lrcTime = matchTime.shift().replace(/[/[/]]/gi,"").toString().split(":");
                  lrcTime = lrcTime[0] * 60 + parseFloat(lrcTime[1]) + offset / 1000;
                  lrcArray[lrcArray.length] = new Array('<span t="' + lrcTime + '"><span style="display:none;">', lrcText + " </span></span>");                   
                }               
            }
    }

    fp.close();
    fp = null;
   
    if (lrcArray.length < 3)
    {
      return lrcArray = null;      
    }
   
    lrcArray.sort(timeSort);
    lrcText = lrcArray.join("").replace(/,/g, " ");
    lrcArray = null;
   
    bottomLrc.innerHTML = topLrc.innerHTML = lrcText;
                     
    showLrc1();
}

function timeSort(timeA, timeB)
{
   var a = parseFloat(timeA[0].split('t="')[1]);
   var b = parseFloat(timeB[0].split('t="')[1]);
  
   if ( a < b)
   {
     return -1;
   }else if (a == b)
    {
       return 0;
    }else
     {
        return 1;
     }
}

function lrcDisplay(i)
{
       bottomLrc.children[i].children[0].style.display = topLrc.children[i].children[0].style.display = "inline";
       bottomLrc.children[i].style.width = topLrc.children[i].style.width = topLrc.children[i].offsetWidth;
}

function lrcHidden(i)
{
  try{
       bottomLrc.children[i].children[0].style.display = topLrc.children[i].children[0].style.display = "none";
  }catch(e){}
}

function setLrcLeft(px)
{
     lrcLeft -= px;
     topLrc.style.left = bottomLrc.style.left = lrcLeft;
}

function moveLrcLeft(endT, lrcWidth)
{
      clearTimeout(lrcTimer);         
      setLrcLeft(1);
      --lrcWidth;
      var evalText = 'moveLrcLeft(' + endT + ',' + lrcWidth + ')';
  
   if ( (lrcWidth < 2) || ( (endT - new Date().getTime()) < 10 ) )
   {
       setLrcLeft(lrcWidth);
   }else
    {   
      lrcTimer = setTimeout(evalText, parseInt((endT - new Date().getTime())/ lrcWidth) );
    }
}

function chanleLrc()
{
       clearTimeout(showLrcTimer);
       clearTimeout(lrcTimer);
       clearTimeout(scrollTimer);
}

function showLrc1()
{
       bottomLrc.style.left = "0px"; 
       topLrc.style.left = "0px";
       lrcLeft = 0;
       showLrc2(0);
}

function showLrc2(childI)
{//像素级变色滚动
       lrcDisplay(childI);
       var timeA = topLrc.children[childI].t * 1;
       var lrcWidth = topLrc.children[childI].offsetWidth;
       document.title = topLrc.children[childI].innerText;    
      
       try{
             lrcDisplay(childI + 1);            
       }catch(e)
        {//出错了,最后没有对象了
             scrollTimer = setInterval("setLrcLeft(1)", 85);
             showLrcTimer = setTimeout("chanleLrc();"
                                     + "lrcHidden(" + (childI - 2) + ");"
                                     + "lrcHidden(" + (childI - 1) + ");"
                                     + "lrcHidden(" + childI + ");", 200 + lrcWidth * 85);
             return 0;
        }
       
       var timeB = topLrc.children[childI + 1].t * 1;
       var tLen = parseInt((timeB - mplayer.controls.currentPosition) * 1000);
       chanleLrc();
       lrcHidden(childI - 2);
       
       if (tLen < 1)
       {
           setLrcLeft(lrcWidth);
           showLrc2(childI + 1);
       }else
        {
          showLrcTimer = setTimeout("showLrc2(" + (childI + 1) + ")", tLen);
          moveLrcLeft(new Date().getTime()+tLen, lrcWidth);
        }
}

function showLrcButton(yes)
{
      if (yes)
      {
         lrcButton.style.display = "";
      }else
       {
         lrcButton.style.display = "none";
       }
}

function searchLrc()
{
    if (typeof(currentPlaying) != "object")
    {
       return 0;
    }
 
    if  (!showList)
    {
       winState.click();
    }
   
     var lrcName = fso.getbasename(currentPlaying.outerText);
     try
     {
        searchWin.location;
     }catch(e)
      {          
        winSpan.innerHTML = '<iframe id=searchWin style="width:299px;height:350px;"'
                          + 'src="
                          + '</iframe>'
                          + '<input type=button value=点此关闭搜索窗口'
                          + ' οnclick="closeSearchWin()" style="width:45%;'
                          + ' border:1px solid red;background:orange;">'
                          + ' | <input id=downButton type=button value=点此下载剪贴板的链接 lrcName=""'
                          + ' οnclick="downLrc(this.lrcName);" style="width:45%;'
                          + ' border:1px solid red;background:orange;">';
      }
     
      winSpan.style.display = "";
      downButton.lrcName = lrcName;
      typeLrcName(lrcName);
     
}


function closeSearchWin()
{
    winSpan.style.display = 'none';
}

function typeLrcName(lrcName)
{
          if(searchWin.document.readyState == "complete")
          {
             var typeObj = searchWin.document.getElementById("ti");
             typeObj.value = lrcName;
             typeObj.scrollIntoView(true);
             searchWin.document.getElementsByName("f")[1].checked = true;
          }else
           {
              clearTimeout(webTimer);
              webTimer = setTimeout("typeLrcName('" + lrcName + "')",500);
           }
}

function downLrc(lrcName)
{
   var url = window.clipboardData.getData('Text');
   var lrcPath = lrcFolder.value + "//" +  lrcName + ".lrc";
  
   if (url.match(/http:.+/gi))
   {
     downFile(url, lrcPath, 0);
   }
}

function downMusic(theFolder)
{
   
   if( (mplayer.url != "") && (typeof(currentPlaying) == "object") )
   {
    if (currentPlaying.filePath.indexOf(":") == 1)
    {
        return show("现在播放中的是磁盘文件,不需再下载!");
    }
     
      if (fso.folderExists(theFolder) == false)
      {
         return show("找不到" + theFolder + "文件夹/n/n请选择保存路径");
      }
     
      var fileType = mplayer.url.match(//.[^/.]+$/gi);
      var thePath = theFolder + "//" + currentPlaying.outerText + fileType;
      var oldName = currentPlaying.outerText.replace(/[》《]/gi,"");
      thePath = prompt("现在的路径是:" + thePath + ":要更改吗?请输入文件名",oldName);
     
      if (thePath == null)
      {
        return 0;
      }
     
      thePath = theFolder + "//" + thePath.replace(/[/:/*/?/"/</>/|]/gi,"&") + fileType;
     
      if (fso.fileExists(thePath) && (confirm("文件" + thePath + "已存在!/n/n要替换吗?") == false) )
      {
        return 0;
      }
     
      downFile(mplayer.url, thePath, 1);
   }
}


function downFile(url, filePath, tip)
{
    try
   {
         var xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP");
         xmlHTTP.open("Get", url, false);
         xmlHTTP.send();
         var bite = xmlHTTP.responseBody;
         xmlHTTP = null;
      }catch(e)
       {
          return show("下载文件" + url + "出错! 下载文件操作已取消!/n/n" + e.description);
       }
      
      try
      {
         var adodbStream=new ActiveXObject("ADODB.Stream");
         adodbStream.Type=1;
         adodbStream.Open();
         adodbStream.write(bite);
         adodbStream.SaveToFile(filePath, 2);
         adodbStream.Close();
         adodbStream = null;
        
         if (tip)
         {
            show("下载,保存文件完成");
         }
         reloadLrc();
      } catch(e)
        {         
          return show("保存文件" + filePath + "出错! 保存文件操作已取消!/n/n" + e.description);
        }      
}

function reloadLrc()
{
        chanleLrc();
        getLrc(1);
}

function showFolder(path)
{
   var wshshell = new ActiveXObject("WScript.Shell");
   wshshell.run('Explorer /select,"' + path + '"');
   wshshell = null;  
}

function sendTo(pathFrom, pathTo)
{
   try
   {
      fso.copyFile(pathFrom, pathTo, false);
      show("发送完成");
   }catch(e)
   {
     show("复制文件出错:" + e.description);
   }
}

function showEditLrcSpan()
{
   if (typeof(currentPlaying) != "object")
   {
         return 0;
   }
 
    if (!showList)
    {
       winState.click();
    }
  
   var lrcName = fso.getbasename(currentPlaying.outerText);
   var lrcPath = lrcFolder.value + "//" + lrcName + ".lrc";
  
    if (!fso.fileexists(lrcPath))
    {
       editText.value = "";
      
    }else
     {
        editLrcFile.value = lrcName;
        editLrcTitle.value = "";
        editLrcAuthor.value = "";
        editLrcArtist.value = "";
        editLrcEditer.value = "qidizi";
        lrcPath = fso.openTextFile(lrcPath, 1, false, false);       
        editText.value = lrcPath.readAll().replace(//[[^/[/]:]*:[^/[/]:]*/]/g,"").replace(/^/r/n/gm,"");
        lrcPath.close();
        lrcPath = null;
     }
  
   editLrcSpan.style.display = "";
}

function showLrcFile()
{
   if (typeof(currentPlaying) != "object")
   {
         return 0;
   }
  
   var lrcName = fso.getbasename(currentPlaying.outerText);
   var lrcPath = lrcFolder.value + "//" + lrcName + ".lrc";
   var wshshell = new ActiveXObject("WScript.Shell");
   wshshell.run('Notepad.exe "' + lrcPath);
   wshshell = null;   
}

function delLrcFile()
{
   if (typeof(currentPlaying) != "object")
   {
         return 0;
   }
  
   var lrcName = fso.getbasename(currentPlaying.outerText);
   var lrcPath = lrcFolder.value + "//" + lrcName + ".lrc";
   try
   {
      fso.deleteFile(lrcPath);
      show("歌词已删除");
   }catch(e)
    {
       show("删除歌词出错:" + e.description);
    }   
}


function typeTime()
{
         var position = mplayer.controls.currentPositionString;
        
         if ( enableType.checked
          && (editText.document.selection.type == "Text")
          && (position != "")
            )
         {
            editText.document.selection.createRange().text = "[" + position + "]";
         }
}

function editLrcSave()

   try
   {
      if ( (editLrcFile.value == "")
       ||  (/^( +)|(.*[:/*/?"<>/|]+.*)$/g.test(editLrcFile.value))
          )
      {
         return show("歌词文件名不正确!/n/n1.不能包含:*?/"<>|/n2.空白未填");
      }
  
      var lrcFile = fso.CreateTextFile(lrcFolder.value + "//" + editLrcFile.value + ".lrc", true, false);
      lrcFile.writeLine("[ti:" + editLrcTitle.value + "]");
      lrcFile.writeLine("[ar:" + editLrcArtist.value + "]");
      lrcFile.writeLine("[al:" + editLrcAuthor.value + "]");
      lrcFile.writeLine("[by:" + editLrcEditer.value + "]");     
      lrcFile.write(editText.value);
      lrcFile.close();
      lrcFile = null;
      show("已保存编辑的歌词文件");
   }catch(e)
   {
      show("保存编辑的歌词文件出错:/n/n" + e.description);
   }
}

function changeDelLrcValue()
{
    switch (delLrc.value)
    {
        case "不删除":
           delLrc.value = "提示删除";
           break;
        case "提示删除":
           delLrc.value = "立刻删除";
           break;
        case "立刻删除":
           delLrc.value = "不删除";
           break;
    }
}

function viewSource()
{  
   var wshshell = new ActiveXObject("WScript.Shell");
   wshshell.run('Notepad.exe "' + location.pathname + '"');
   wshshell = null;   
}

function showTestWin()
{  
   show('输入代码按CTRL+ENTER键运行<br>'
      + '<textarea style="width:100%;" rows=21 '
      + ' οnkeypress="if (event.keyCode == 10){eval(this.value);}">'
      + '</textarea>');   
}

function changeMusicTitle()
{
    switch (musicTitle.value)
    {
        case "文件名.格式":
           musicTitle.value = "文件名";
           break;
        case "文件名":
           musicTitle.value = "完整路径";
           break;
        case "完整路径":
           musicTitle.value = "文件名.格式";
           break;
    }
}

function setLrcTopColor(theRGB)
{
   topLrc.style.color = theRGB;
   lrcTopColor.value = theRGB;
}

function setLrcBottomColor(theRGB)
{
   bottomLrc.style.color = theRGB;
   lrcBottomColor.value = theRGB;
}

function setListFontColor(theRGB)
{
   list.style.color = theRGB;
   listFontColor.value = theRGB;
}

function setListBackColor(theRGB)
{
   list.style.background = theRGB;
   listBackColor.value = theRGB;
}

function setListPlayColor(theRGB)
{
   list.style.background = theRGB;
   listBackColor.value = theRGB;
}

function showListWin()
{  
   if (winState.innerText == "2")
   {//1,单窗口样式,窗口是展开 
      winState.innerText = 1;
      showList = 1;     
      window.resizeTo(winWidth + towWin.offsetWidth, winHeight + towWin.offsetHeight);
   }else
    {//2,双窗口图标,窗口收起   
      winState.innerText = 2;
      showList = 0;     
      window.resizeTo(winWidth + towWin.offsetWidth,  winHeight + oneWin.offsetHeight + 1);
    }
}

function showColorBar(funName)
{
         show(              
               '请在三色条中点下左键后不放,然后拉动调配颜色<br>'
             + '<input id=redColor value=0  on=0 οnmοusedοwn="this.on=1;" '
             + 'onmousemove ="changeColorName(this, /''+ funName + '/');" οnmοuseup="this.on=0;" '
             + 'οnmοuseοut="this.on=0;" '
             + 'style="cursor:default; width:260px; background: red; text-align:center; " '
             + 'contenteditable=false UNSELECTABLE=on><BR>'
             + '<input id=blueColor value=0  on=0 οnmοusedοwn="this.on=1;" '
             + 'onmousemove ="changeColorName(this, /''+ funName + '/');" οnmοuseup="this.on=0;" '
             + 'οnmοuseοut="this.on=0;" '
             + 'style="cursor:default; width:260px; background: blue; text-align:center;"  '
             + 'contenteditable=false UNSELECTABLE=on><br>'
             + '<input id=greenColor value=0  on=0 οnmοusedοwn="this.on=1;" '
             + 'onmousemove ="changeColorName(this, /''+ funName + '/');" οnmοuseup="this.on=0;" '
             + 'οnmοuseοut="this.on=0;" '
             + 'style="cursor:default; width:260px; background: green; text-align:center;" '
             + 'contenteditable=false UNSELECTABLE=on><br>'
             );
}

function changeColorName(obj, funName)
{
   var colorNumber = event.x - obj.offsetLeft - 2;
  
  if (
      (obj.on == "1")
   && (colorNumber > -1)
   && (colorNumber < 251)
     )
  {
   obj.value = colorNumber;
   var theRGB = "RGB(" + redColor.value + ", " + blueColor.value + ", " + greenColor.value + ")";
   eval(funName + "(theRGB)");
  }

}

function setTestTime()
{
    var theValue = parseInt(prompt("请输入每首曲只试听的秒数(小于10数字或非数字不启用)","10"));
   
    if (theValue >= 10)
    {
        testListen.value = theValue;
    }else
     {
        testListen.value = 0;
     }
    
    
}

function saveList()
{
    var thePath;
   
    if ( (list.children.length == 0) || ((thePath = prompt("输入列表的文件名","")) == null) || (thePath == ""))
    {
       return 0;
    }
   
    thePath = thePath.replace(/[:/*/?"<>/|]/gi,"&");   
    thePath = htaPath + thePath + ".txt";
   
    if (fso.fileExists(thePath) && (confirm(thePath + "已存在!/n/n是否要替换?") == false))
    {
      return 0;
    }
   
   
       var listFile = fso.CreateTextFile(thePath, true, true);
       var objCopy = currentPlaying;
       playingAttribute(objCopy, 0);
       var listText = list.innerHTML;
       playingAttribute(objCopy, 1);
       listFile.write(listText);
       listFile.close();
       listFile = null; 
       show("列表已保存在" + thePath);
}

function loadList(path)
{
      if (fso.fileExists(path))
      {
        var listText = fso.openTextFile(path, 1, false, true);
        try
        {
            var getText = listText.readAll();
        }catch(e)
         {
            var getText = "";
         }
       
        listText.close();
        listText = null;
        list.insertAdjacentHTML("beforeEnd",getText);
     }
}

function showSettingSpan()
{
         switch (settingSpan.style.display)
         {
                case "":
                    settingSpan.style.display = "none";
                    break;
                default:
                    settingSpan.style.display = "";
         }
}

function SaveSetting()
{    
       var settingJs = "function loadSetting()"
                    +  '{'
                    +  'showPlaying.value = ' + showPlaying.value + ';'
                    +  'volNumber.innerText = "音量" + (mplayer.settings.volume = ' + mplayer.settings.volume + ') + "%";'
                    +  'volBar.style.width = mplayer.settings.volume / 2;'
                    +  'playMode.innerText = "' + playMode.innerText + '";'
                    +  'lrcFolder.value = "' + lrcFolder.value.replace("//", "

") + '";'
                    +  'if (!fso.folderExists(lrcFolder.value))'
                    +  '{'
                    +  'lrcFolder.value = htaPath + "lrc";'
                    +  'fso.CreateFolder(lrcFolder.value);'
                    +  '}';
                   
                    if (typeof(currentPlaying) == "object")
                    {
                       settingJs += 'playthis(currentPlaying, 1, ' + mplayer.controls.currentPosition + ');';
                    }
                   
                    if (mplayer.playState  == 3)
                    {
                       settingJs += 'mplayer.controls.play();';
                    }
                   
                     settingJs += 'delLrc.value = "' + delLrc.value + '";';
                     settingJs += 'alertDel.value = "' + alertDel.value + '";';
                     settingJs += 'testListen.value = "' + testListen.value + '";';
                     settingJs += 'musicTitle.value = "' + musicTitle.value + '";';
                     settingJs += 'topLrc.style.color = lrcTopColor.value = "' + lrcTopColor.value + '";';
                     settingJs += 'bottomLrc.style.color = lrcBottomColor.value = "' + lrcBottomColor.value + '";';                   
                     settingJs += 'list.style.color = listFontColor.value = "' + listFontColor.value + '";';                   
                     settingJs += 'list.style.background = listBackColor.value = "' + listBackColor.value + '";';                  
                     settingJs += 'listPlayColor.value = "' + listPlayColor.value + '";';
                    settingJs += '}';
                   
       var settingFile = fso.CreateTextFile(htaPath + "setting.js", true, true);  
       settingFile.write(settingJs);
       settingFile.close();
       settingFile = null;      
}

function update(ver)
{
    
}

function getWinBorder()
{
  moveTo(0,0);
  winWidth = window.screenLeft * 2;
  winHeight = window.screenTop + window.screenLeft;
  showListWin();
}

function window.onload()
{
     getWinBorder();
     update(document.title);
     loadList(defaultList);
     try{ loadSetting(); }catch(e){show("自定义播放器的设置文件丢失,还原播放器为默认状态!");}
}

function window.onbeforeunload()
{
      
       var listFile = fso.CreateTextFile(defaultList, true, true);
       listFile.write(list.innerHTML);
       listFile.close();
       listFile = null;
      
       SaveSetting();
}


</script>

<SCRIPT LANGUAGE = "JScript"  FOR = mplayer EVENT = PositionChange(oldPosition, newPosition)>       
         chanleLrc();
         getLrc();
         clearInterval(positioner);
         positioner = setInterval("setPosition();", 1000);
</SCRIPT>

<SCRIPT LANGUAGE = "JScript"  FOR = mplayer EVENT = playStateChange(NewState)>

switch (NewState){
    case 1://stop
         playPauseB.innerText = "4";
         clearInterval(positioner);
         setPosition();
         chanleLrc();
         break;
    case 2://pause
         chanleLrc();
         clearInterval(positioner);
         playPauseB.innerText = "4";
         break;
    case 3://playing
         clearInterval(positioner);
         positioner = setInterval("setPosition();", 1000);
       playPauseB.innerText = ";";
       if (parseInt(testListen.value))
       {        
         chanleLrc();
         bottomLrc.innerText = "";
         topLrc.innerText = "试听模式";
         clearTimeout(playTimer);
         playTimer = setTimeout("playNewMusic(1);", parseInt(testListen.value) * 1000);
       }else
        {      
          getLrc();
        }
        break;
    case 8://MediaEnded Media item has completed playback.
         clearInterval(positioner);
         clearTimeout(playTimer);
         playTimer = setTimeout("playNewMusic(1);", 800);
         break;
    default:
         playPauseB.innerText = 4;
         clearInterval(positioner);     
         chanleLrc();
         setPosition();
}
</SCRIPT>

<SCRIPT LANGUAGE = "JScript"  FOR = mplayer  EVENT = OpenStateChange(NewState)>

if (NewState == 13)
{
   mediaLen.innerText = mplayer.currentMedia.durationString;
}
</SCRIPT>

<script src="setting.js" language="javascript"></script>
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值