
function changeNewsPage()
{
	var page = document.newspages.newspage.value;
	document.location.href = "http://www.titantorrent.to/en/Movies-Music-Games-Software-Miscellaneous-XXX/news-" + page + "-torrent-news.html";
}

function changeCategoryPage(bTop, params, folder)
{
	var page;
	if (bTop == true)
		page = document.categorypages1.categorypage.value;
	else
		page = document.categorypages2.categorypage.value;
	document.location.href = "http://www.titantorrent.to/en/" + folder + "/" + params + "-" + page + "-torrent-category.html";
}

function sendKeywordRequest()
{
	var keyword = document.searchform.keyword.value;
	if (keyword == "") {
		document.location.href = "http://www.titantorrent.to/en/Movies-Music-Games-Software-Miscellaneous-XXX/news-torrent-news.html";
		return;
	}
	var category = document.searchform.searchcat.value;
	keyword = keyword.replace("/", "%20");
	keyword = keyword.replace("*", "%20");
	keyword = keyword.replace("#", "%20");
	keyword = keyword.replace("'", ".bgsl.");
	keyword = keyword.replace("&", ".andchr.");
	keyword = escape(keyword);
	document.location.href = "http://www.titantorrent.to/en/" + keyword + "/" + category + "-torrent-search.html";
}

function SetSearchForm(SearchKeyword, SearchCat)
{
	document.searchform.keyword.value = SearchKeyword;
	document.searchform.searchcat.value = SearchCat;
}

function copyTextToClipboard(form, element)
{
	var textarea = document.forms[form].elements[element];
	textarea.focus();
	textarea.select();
}

function StartDownload(type, name)
{
	if (adbl)
		alert("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.");
	else
		window.open("http://www.titantorrent.to/en/download-file.php?type=" + type + "&n=" + name);
}
