
if('undefined'!=typeof VeryCD)setCookie=VeryCD.cookie.set;if('undefined'!=typeof VeryCD)getCookie=VeryCD.cookie.get;if(document.location.toString().match(/#ng$/)){ngurl=document.referrer.match(/\:\/\/([^\/]+)/);if(null!==ngurl){ngurl=ngurl[1];var d=new Date();d.setUTCSeconds(d.getUTCSeconds()+1800);setCookie('ngurl',ngurl,d,'/','.verycd.com');}}
for(var k=0;k<document.links.length;k++){var link=document.links[k]
var isautoDownSub=$('autoDownload');if(link.href.indexOf('ed2k://')===0){link.randomVar=link.href
link.ed2k='';if(isautoDownSub&&isautoDownSub.checked){if(navigator.userAgent.indexOf("MSIE")>0){var language=navigator.userLanguage;}else{var language=navigator.language;}
if(language.toLowerCase().indexOf('zh-cn')>-1){link.subtitle=link.getAttribute('subtitle_zh_cn');}else if(language.toLowerCase().indexOf('zh-tw')>-1){link.subtitle=link.getAttribute('subtitle_zh_tw');}else if(language.toLowerCase().indexOf('en-us')>-1){link.subtitle=link.getAttribute('subtitle_en_us');}else{link.subtitle=link.getAttribute('subtitle_others');}
if(null==link.subtitle){link.subtitle='';}}
var _isRight="L";link.oncontextmenu=function(){_isRight="R";var _size;var regExp=/^(?:ed2k:\/\/\|file\|([^\|]+?)\|(\d+?)\|([0-9a-z]{32})\|((?:\/\|sources,([^\s\|]+?)\||h=([0-9a-z]{32})\||s=([^\s\|]+?)\||p=([^\s\|]+?)\|)*)\/)/i;text_urls=this.toString().replace('\r','');url_lines=text_urls.split('\n');for(var i=0,urlLen=url_lines.length;i<urlLen;i++){var tmp_link='';if(tmp_link=url_lines[i].replace(/^\s+/,'').match(regExp)){var tmp=tmp_link.toString();_size=tmp_link[2];_size=gen_size_m(_size);ed2kstat('Click',_size,_isRight);}}}
link.onclick=function(){var _isRight="L";var _size;var regExp=/^(?:ed2k:\/\/\|file\|([^\|]+?)\|(\d+?)\|([0-9a-z]{32})\|((?:\/\|sources,([^\s\|]+?)\||h=([0-9a-z]{32})\||s=([^\s\|]+?)\||p=([^\s\|]+?)\|)*)\/)/i;text_urls=this.toString().replace('\r','');url_lines=text_urls.split('\n');for(var i=0,urlLen=url_lines.length;i<urlLen;i++){var tmp_link='';if(tmp_link=url_lines[i].replace(/^\s+/,'').match(regExp)){var tmp=tmp_link.toString();_size=tmp_link[2];_size=gen_size_m(_size);ed2kstat('Click',_size,_isRight);}}
var ax=null
try{var ax=new ActiveXObject("IE2EM.IE2EMUrlTaker");var emule_version=ax.GetEmuleVersion();if('e'!=emule_version.substr(0,1)){throw{errorCode:'eMule not Installed.'};}
var ed2k_link='';ed2k_link=this.randomVar;if(isautoDownSub&&isautoDownSub.checked){if(ed2k_link==''){ed2k_link=this.subtitle;}else{ed2k_link+="\n"+this.subtitle;}
ed2k_link+="\n"+this.subtitle;}
ax.SendUrl(ed2k_link,'dd',document.location)
this.onmouseup()
delete ax}catch(e){if(navigator.userAgent.indexOf("MSIE")>0&&'no'!=getCookie('downPopup')){check_link=this.randomVar
if(isautoDownSub&&isautoDownSub.checked){if(check_link==''){check_link=this.subtitle;}else{check_link+=","+this.subtitle;}}
downPopup(this)}else{continueDown(this.randomVar)
if(isautoDownSub&&isautoDownSub.checked){window.setTimeout("continueDown('"+this.subtitle+"')",50);}}}
return false}
link.linkOff=function(){if(navigator.userAgent.indexOf("MSIE")>0){this.href='#';}}
link.linkOn=function(){var sb_ie_all_version=this.innerHTML
this.href=this.randomVar
if(sb_ie_all_version!==this.innerHTML){this.innerHTML=sb_ie_all_version}}
link.onmouseup=link.linkOn
link.onmouseover=link.linkOff
link.onmousemove=function(){window.status=this.randomVar;}
link.onmouseout=function(){window.status='';}
link.onkeyup=function(){}}}
function cancelPopup(){var argv=arguments
var argc=arguments.length
var downPopup=(argc>0)?argv[0]:false
if($('never_popup').checked||downPopup){var day=new Date()
day.setMonth(day.getMonth()+1)
setCookie('downPopup','no',day,'/','.verycd.com')}
var link=check_link.split(",")
try{var ax=new ActiveXObject("IE2EM.IE2EMUrlTaker");var emule_version=ax.GetEmuleVersion();if('e'!=emule_version.substr(0,1)){throw{errorCode:'eMule not Installed.'};}
var ed2k_links='';for(var i=0;i<link.length;i++){if(link[i]&&link[i].indexOf("ed2k://")===0){if(ed2k_links==''){ed2k_links=link[i];}else{ed2k_links+="\n"+link[i];}}}
ax.SendUrl(ed2k_links,'dd',document.location);delete ax;}catch(e){for(var i=0;i<link.length;i++){if(link[i]&&link[i].indexOf("ed2k://")===0){continueDown(link[i])}}
document.body.removeChild($('down_popup_background'))}}
function cancelPopupPage(){document.body.removeChild($('down_popup_background'))}
function downloadEmule(){window.open("http://download.verycd.com/easyMule-Setup.exe")
document.body.removeChild($('down_popup_background'))}
function sGetScrollTop(){if(document.documentElement.scrollTop!=0){return document.documentElement.scrollTop}
return document.body.scrollTop}
function downPopup(active_link){if('no'!=getCookie('downPopup')){if($('down_popup_div')){return}
var div_obj=document.createElement("div")
var background_div=document.createElement("div")
document.onkeydown=function(e){if(document.all){key_code=event.keyCode}else{key_code=e.keyCode}
if(key_code==27){cancelPopupPage()
return}}
background_div.id='down_popup_background'
background_div.style.position='absolute'
background_div.style.left=0
background_div.style.top='0px'
background_div.style.display='block'
background_div.style.background='#333'
background_div.style.height=getWindowLength('h')+'px'
background_div.style.width=getWindowLength('w')+'px'
background_div.style.filter='alpha(opacity=90)'
background_div.style.opacity=.95
background_div.style.MozOpacity=.95
background_div.style.zIndex='107'
background_div.style.textAlign='left'
div_obj.id='down_popup_div'
div_obj.style.position='absolute'
div_obj.style.background='#FFF'
div_obj.style.left='25%'
div_obj.style.width='50%'
div_obj.style.color='black'
div_obj.style.padding='0'
div_obj.style.top=sGetScrollTop()+(window.screen.availHeight*1/4)+'px'
div_obj.style.zIndex='899'
div_obj.style.float='left'
if(VeryCD.client.agent.ie){var active_link_text=active_link.innerText}else{var active_link_text=active_link.text}
var argv=arguments
var argc=arguments.length
var multi_text=(argc>1)?argv[1]:null
if(multi_text){active_link_text=multi_text}
var innerht=''
innerht+='<div style="margin:12px 12px 0 12px">您需要使用电驴从其它互联网用户的计算机中请求以下文件:'
innerht+='<br \/><b class="active-link-text">'+active_link_text+'<\/b>'
innerht+='<br \/><input type="submit" class="button" style="margin-top:12px;height:28px;cursor:pointer;" name="downloadEmule" value="下载安装电驴" onclick="downloadEmule()" \/>　'
innerht+='<a id="never_popup" name="never_popup" style="color:#000;text-decoration:underline;cursor:pointer;" onclick="cancelPopup(true)" \/>我已装过，不要再提示<\/a><\/div>'
innerht+='<img src="http:\/\/statics.verycd.com\/images\/fileclose.png" style="position:absolute;top:0;right:0;cursor:pointer" onclick="cancelPopupPage()" />'
innerht+='<p style="background:#CCC;margin:0;padding:2px;padding-left:12px;margin:10px 12px 0 12px">VeryCD 不提供任何下载服务,使用电驴前请阅读我们的<a id="law" target="_blank" href="http:\/\/www.verycd.com\/about\/law\/" style="text-decoration:underline">权利声明.<\/a><\/p>'
div_obj.innerHTML=innerht;background_div.appendChild(div_obj)
document.body.appendChild(background_div)}}
function continueDown(link){try{if($('down_iframe')){document.body.removeChild($('down_iframe'))}
var iframe_obj=document.createElement("iframe")
document.body.appendChild(iframe_obj)
iframe_obj.id='down_iframe'
iframe_obj.height="0"
iframe_obj.width="0"
iframe_obj.display="none"
if(document.all){var fra='<frameset><frame  src="'+link+'" /></frameset>';window.frames['down_iframe'].document.write(fra);}else{iframe_obj.src=link}}catch(e){iframe_obj.src=link}}