var domain=document.location.hostname;function DownloadMirror(type,name)
{var ck=document.cookie;var value=ck.substr(ck.search('lang=')+5,2);var lang='de';if(value!='')
lang=value;var message="AdBlock prevents that this file can be downloaded with 100Mbit/s. Disable AdBlock and reload this page to start the download with 100Mbit/s by using this link.";if(lang=='de')
message="AdBlock verhindert, dass diese Datei mit 100Mbit/s heruntergeladen werden kann. Deaktiviere AdBlock und lade diese Seite erneut, um den Download mit 100Mbit/s "+unescape("%FC")+"ber diesen Link zu starten.";if(adbl)
alert(message);else
window.open("http://"+domain+"/download-file.php?type="+type+"&n="+name);}
function bookmark()
{document.location="http://"+domain+"/bookmark.php";}
function HandleDetails()
{switch(req.readyState)
{case 4:if(req.status!=200)
alert("Error: "+req.status);else{var xml=req.responseXML;var error=xml.getElementsByTagName("error")[0];error=error.firstChild.nodeValue;if(error!="none"){alert(error);break;}
var name=xml.getElementsByTagName("name")[0];var add=xml.getElementsByTagName("add")[0];var cover=xml.getElementsByTagName("cover")[0];var lang=xml.getElementsByTagName("lang")[0];var language=xml.getElementsByTagName("language")[0];var entrydate=xml.getElementsByTagName("entrydate")[0];var description=xml.getElementsByTagName("description")[0];var downloadlink=xml.getElementsByTagName("downloadlink")[0];var down_ad=xml.getElementsByTagName("down_ad")[0];var l_language=xml.getElementsByTagName("l_language")[0];var l_entrydate=xml.getElementsByTagName("l_entrydate")[0];var l_proceed_download=xml.getElementsByTagName("l_proceed_download")[0];name=name.firstChild.nodeValue;add=add.firstChild.nodeValue;cover=cover.firstChild.nodeValue;lang=lang.firstChild.nodeValue;language=language.firstChild.nodeValue;entrydate=entrydate.firstChild.nodeValue;description=description.firstChild.nodeValue;downloadlink=decodeURIComponent(downloadlink.firstChild.nodeValue);down_ad=down_ad.firstChild.nodeValue;l_language=l_language.firstChild.nodeValue;l_entrydate=l_entrydate.firstChild.nodeValue;l_proceed_download=l_proceed_download.firstChild.nodeValue;details.innerHTML='<div class="info"><div class="cover">'+cover+'</div><div class="detailcontainer">'+l_language+': <img src="http://'+domain+'/flags/'+lang+'.gif" width="32" height="16" alt="'+language+' '+add+'" title="'+language+' '+add+'" /><br />'+l_entrydate+': '+entrydate+'</div></div><div class="description">'+description+'</div><div class="download"><a class="defaultlink" href="javascript:;" title="'+name+add+'" onclick="window.open(\''+downloadlink+'\');" rel="nofollow">'+l_proceed_download+'</a><br /><div id="alternative_download"></div><a class="defaultlink" href="javascript:;" title="'+name+' '+down_ad+'" onclick="DownloadMirror(\'result_details\', \''+encodeURI(name)+'\');" rel="nofollow">'+down_ad+'</a></div>';expand.innerHTML="&lt;";}
break;}}
function createRequest()
{var req=null;try{req=new XMLHttpRequest();}
catch(e){try{req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(failed){req=null;}}}
return req;}
function GetDetails(category,id)
{entryID=id;expand=document.getElementById("expand-"+entryID);details=document.getElementById("details-"+entryID);if(expand.innerHTML=="&lt;"){expand.innerHTML="&gt;";details.innerHTML="";return;}
req=createRequest();if(req==null){alert("Error creating Ajax request object.");return;}
req.open("GET","http://"+domain+"/ajax.php?category="+category+"&id="+id,true);req.onreadystatechange=HandleDetails;req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.send(null);}
function displayDownloads(aff,start)
{var i=start;var linkdiv;var titlediv;var namediv;var downloadlink;while((linkdiv=document.getElementById("download_"+i))!=null)
{titlediv=document.getElementById("t_"+i);titlediv.setAttribute("class","hidden");namediv=document.getElementById("n_"+i);downloadlink=document.createElement("a");downloadlink.innerHTML=linkdiv.innerHTML;downloadlink.setAttribute("class","defaultlink");downloadlink.setAttribute("href","javascript:;");downloadlink.setAttribute("title",titlediv.innerHTML);if(namediv!=null){namediv.setAttribute("class","hidden");downloadlink.setAttribute("onclick","DownloadMirror('"+aff+"', '"+encodeURI(namediv.innerHTML)+"');");}
else
downloadlink.setAttribute("onclick","DownloadMirror('"+aff+"', '"+encodeURI(removeAddons(titlediv.innerHTML))+"');");downloadlink.setAttribute("rel","nofollow");linkdiv.parentNode.replaceChild(downloadlink,linkdiv);i++;}}
function showDownloads()
{var i=0;var linkdiv;var titlediv;var hrefdiv;var downloadlink;while((linkdiv=document.getElementById("downloads_"+i))!=null)
{titlediv=document.getElementById("ddl_"+i);titlediv.setAttribute("class","hidden");hrefdif=document.getElementById("rapidshare_"+i);hrefdif.setAttribute("class","hidden");downloadlink=document.createElement("a");downloadlink.innerHTML=linkdiv.innerHTML;downloadlink.setAttribute("class","defaultlink");downloadlink.setAttribute("href","javascript:;");downloadlink.setAttribute("title",titlediv.innerHTML);downloadlink.setAttribute("onclick","openNew('"+hrefdif.innerHTML.replace(/amp;/g,"")+"');");downloadlink.setAttribute("rel","nofollow");linkdiv.parentNode.replaceChild(downloadlink,linkdiv);i++;}}
function runterladen(name,linkclass,aff)
{var i=0;var titlediv;var downloadlink;while((titlediv=document.getElementById("runterladen_"+i))!=null)
{downloadlink=document.createElement("a");downloadlink.innerHTML=name;downloadlink.setAttribute("class",linkclass);downloadlink.setAttribute("href","javascript:;");downloadlink.setAttribute("title",titlediv.innerHTML);downloadlink.setAttribute("onclick","DownloadMirror('"+aff+"', '"+encodeURI(removeAddons(titlediv.innerHTML))+"');");downloadlink.setAttribute("rel","nofollow");titlediv.parentNode.replaceChild(downloadlink,titlediv);i++;}}
function showMoreHoster()
{var more_hoster=document.getElementById("more_hoster");var show_more=document.getElementById("show_more");if(more_hoster.getAttribute("class")=="hidden"){more_hoster.setAttribute("class","");show_more.innerHTML=document.getElementById("lesstext").innerHTML;show_more.setAttribute("title",document.getElementById("lesstitle").innerHTML);}
else{more_hoster.setAttribute("class","hidden");show_more.innerHTML=document.getElementById("moretext").innerHTML;show_more.setAttribute("title",document.getElementById("moretitle").innerHTML);}}
function openNew(url)
{window.open(url);}
function setHosterSelection(hoster)
{var date=new Date();date=new Date(date.getTime()+1000*60*60*24*1);if(hoster==null){var buttons=document.getElementById("hoster_buttons").getElementsByTagName('*');hoster="";count=0;for(var i=0;i<buttons.length;i++)
{if(buttons[i].nodeName=="INPUT"){count++;if(buttons[i].checked)
hoster=hoster+"|"+count;}}
hoster=hoster.substr(1);}
document.cookie="hoster_selection="+hoster+"; expires="+date.toGMTString()+"; path=/;";document.location.reload();}
function calcHeight()
{var frameHeight=400;if(self.innerWidth)
frameHeight=self.innerHeight;else if(document.documentElement&&document.documentElement.clientWidth)
frameHeight=document.documentElement.clientHeight;else if(document.body)
frameHeight=document.body.clientHeight;document.getElementById("extern_link").style.height=frameHeight*0.9+"px";}
function removeAddons(name)
{name=name.replace(/ Herunterladen/i,"");name=name.replace(" Download","");return name;}
function handleViewDownload()
{switch(req_confirm.readyState)
{case 4:if(req_confirm.status==200&&req_confirm.responseText!="ok")
alert("Invalid response: "+req_confirm.responseText);break;}}
function viewDownload(category,id)
{if(hasViewedDownload(category,id))
return;var cookie=getCookie("downloads");if(cookie!=null)
setCookie("downloads",cookie+";"+category+"-"+id+";",3);else
setCookie("downloads",category+"-"+id+";",3);req_confirm=createRequest();if(req_confirm==null){alert("Error creating Ajax request object.");return;}
req_confirm.open("GET","http://"+domain+"/counter.php?c="+category+"&e="+id,true);req_confirm.onreadystatechange=handleViewDownload;req_confirm.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req_confirm.send(null);}
function hasViewedDownload(category,id)
{var cookie=getCookie("downloads");if(cookie==null)
return false;return cookie.indexOf(category+"-"+id+";")!=-1;}
function setCookie(c_name,value,exdays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+exdays);var c_value=escape(value)+((exdays==null)?"":"; expires="+exdate.toUTCString())+"; path=/;";document.cookie=c_name+"="+c_value;}
function getCookie(c_name)
{var i,x,y;var ARRcookies=document.cookie.split(";");for(i=0;i<ARRcookies.length;i++)
{x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);x=x.replace(/^\s+|\s+$/g,"");if(x==c_name)
return unescape(y);}
return null;}
