var thunder_pid = "127084";
function Download(linkObj,url)
{
   if(InitialActiveXObject() == null)
   {
     alert('请先安装迅雷后再下载.......\n\n如果已经安装完成 请重新刷新此页面');
     return;
   }  
   
	linkObj.thunderHref = ThunderEncode(url);
	linkObj.thunderPid = thunder_pid;
	linkObj.thunderResTitle = document.title;
	
	OnDownloadClick_Simple(linkObj,2,4,5);
}


function DownloadAll()
{
   if(InitialActiveXObject() == null)
   {
     alert('请先安装迅雷后再下载.......\n\n如果已经安装完成 请重新刷新此页面');
     return;
   }  
   
    var checkboxs=document.getElementsByName("checkboxid1");   
	 for (var i=0;i<checkboxs.length;i++) {
	  var e=checkboxs[i];
	  if(e.checked){
           var link = document.createElement("a");
			link.thunderHref = ThunderEncode(e.value);
			link.thunderPid = thunder_pid;
			link.thunderResTitle = '';
            document.body.appendChild(link);
			OnDownloadClick_Simple(link,2,4,5);
			document.body.removeChild(link);
		}
	}
}



//迅雷看看
function kankan(url)
{  

   try

   {
        alert("该功能正在开发中……");   

   }catch(e)
   {  
   }

   return QQRightClick;

}
//初始化迅雷插件
function InitialActiveXObject()
{  
   var Thunder;
   try
   {
      Thunder = new ActiveXObject("ThunderAgent.Agent")  
   }catch(e)
   {
     try
     {

       Thunder=new ActiveXObject("ThunderServer.webThunder.1");
     }catch(e)
     {
       try
       {
         Thunder = new ActiveXObject("ThunderAgent.Agent.1");
       }catch(e)
       {
         Thunder = null;
       }      
     }    
   }
   return Thunder;
}

 
//初始化QQdown旋风插件
function QQdownInitialActiveXObject()
{  

   try

   {
        var QQRightClick = new ActiveXObject("QQIEHelper.QQRightClick.2");   

   }catch(e)
   {  
   }

   return QQRightClick;

}


//下载选中





//---------------------QQdown旋风下载脚本------------


 //下载选中

function QQdownDownloadAll(url)
//var url="";

{

   var QQdown = QQdownInitialActiveXObject();

 

   if(QQdown == null)

   {

     alert('只有使用IE浏览器或IE内核的浏览器，才能启动QQ旋风。搜狗浏览器请切换到 兼容 模式');

     return;

   }  

 

   try

   {  
    var checkboxs=document.getElementsByName("checkboxid1");   
 for (var i=0;i<checkboxs.length;i++) {
  var e=checkboxs[i];
  //alert(e.checked);
  if(e.checked){
      QQdown.AddTask(e.value,"","");
	}
}

      QQdown.SendMultiTask();     

   }catch(e)

      {

        alert('您未安装QQdown旋风，请尝试使用迅雷下载.......');

      }       

   }

//复制选中

function copylink(){
var checkboxs=document.getElementsByName("checkboxid2");
var links="";  
 for (var i=0;i<checkboxs.length;i++) {
  var e=checkboxs[i];
  //alert(e.checked);
  if(e.checked){
  if(links){
	links=links+"\\n"+e.value;
	}else{
	links=e.value;
	}
	}
  }
    
copy_clip(links); 
alert("所有选中的链接已经复制到剪贴板！"); 
 }

function copy_clip(copy){
if (window.clipboardData){
window.clipboardData.setData("Text", copy);}
else if (window.netscape){
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
//if (!clip) return;
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
//if (!trans) return;
trans.addDataFlavor('text/unicode');
var str = new Object();
var len = new Object();
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext=copy;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;
//if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);}
//return false;
}
