function notabcolour(tabid) {

	document.getElementById("tab-"+tabid).style.color="";

}

function friendslist() {

	if(document.getElementById("friendslist").style.display == "none") {
	
		xmlHttp=GetXmlHttpObject();
		
		if (xmlHttp==null) {
		
			alert ("Please switch Javascript on to enable dynamic actions at MangaBullet.");
			return;
		
		}
		
		xmlHttp.onreadystatechange = function() {
			
			if(xmlHttp.readyState==4) {
			
				document.getElementById("friendslistarea").innerHTML = xmlHttp.responseText;
				
				document.getElementById("friendson").innerHTML = document.getElementById("friendsonlineupdate").innerHTML;
			
			}
		
		}
		
		xmlHttp.open("GET","ajaxactions.php",true);
		xmlHttp.send(null);
		
		document.getElementById("friendslist").style.display = "";
	
	}
	
	else {
	
		document.getElementById("friendslist").style.display = "";
	
	}

}

function deleteinteraction(id) {

	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null) {
	
		alert ("Please switch Javascript on to enable dynamic actions at MangaBullet.");
		return;
	
	}
	
	xmlHttp.onreadystatechange = function() {
		
		if(xmlHttp.readyState==4) {
		
			document.getElementById("interaction"+id).style.display = "none";
			document.getElementById("interaction"+id).innerHTML = "";
			document.getElementById("interactionsnotification").innerHTML = "";
		
		}
	
	}
	
	xmlHttp.open("GET","ajaxactions.php?deleteinteraction="+id,true);
	xmlHttp.send(null);
	
	document.getElementById("interaction"+id).innerHTML = "<img src='gfx/i_loading_s.gif' border='0'>";

}

function popUp(URL, width, height) {

	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width='+width+',height='+height+'');");

}

function search() {

	if(document.getElementById("searchtype").value == "1") {
	
		document.location = "http://www.mangabullet.com/store/search/"+escape(document.getElementById("searchbox").value);
	
	}
	
	else if(document.getElementById("searchtype").value == "6") {
	
		document.location = "http://www.mangabullet.com/gallery/?keywords="+escape(document.getElementById("searchbox").value);
	
	}
	
	else if(document.getElementById("searchtype").value == "3") {
	
		document.location = "http://www.mangabullet.com/clubs?browse=1&keywords="+escape(document.getElementById("searchbox").value);
	
	}
	
	else if(document.getElementById("searchtype").value == "2"
		|| document.getElementById("searchtype").value == "4"
		|| document.getElementById("searchtype").value == "5"
		|| document.getElementById("searchtype").value == "7"
		|| document.getElementById("searchtype").value == "9") {
	
		showalert(1,2,"<h3>Not yet available</h3><br />Sorry, but this type of search is not quite ready.<br /><br />Currently you can search for people, artwork, and clubs. In the coming weeks, we will also have search functions for articles, the FAQ, and the MangaBullet Store, as well as eventually events and culture. Give it another try soon!");
	
	}
	
	else {
	
		xmlHttp=GetXmlHttpObject();
		
		if (xmlHttp==null){
		  alert ("Please switch Javascript on to enable dynamic actions at MangaBullet.");
		  return;
		}
		
		url="search.php?noframe=true&type="+document.getElementById("searchtype").value+"&term="+escape(document.getElementById("searchbox").value);
		
		xmlHttp.onreadystatechange = function() {
			
			if (xmlHttp.readyState==4) {
			
				if(xmlHttp.responseText == "failed") {
				
					showalert(1,1,"<h3>Your search was invalid</h3><br />Please try typing a different term into the search box.");
				
				}
				
				else {
				
					document.getElementById("mainarea").innerHTML = xmlHttp.responseText;
				
				}
				
				document.getElementById("loadingarea").style.display="none";
				document.getElementById("mainarea").style.display="";
			
			}
		
		}
		
		document.getElementById("mainarea").style.display="none";
		document.getElementById("loadingarea").style.display="block";
		
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	
	}

}

function togglefooter() {

	if(document.getElementById("footercontent").style.display != "none") {
	
		document.getElementById("footercontent").style.display="none";
	
	}
	
	else {
	
		document.getElementById("footercontent").style.display="";
	
	}
	
	document.getElementById("footertoggleicon").style.width="16px";
	document.getElementById("footertoggleicon").style.width="16px";
	document.getElementById("footertoggleicon").style.backgroundPosition="";
	document.getElementById("footertoggleicon").style.backgroundImage="url(gfx/i_loading_s.gif)";
	
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null){
	  alert ("Please switch Javascript on to enable dynamic actions at MangaBullet.");
	  return;
	}
	
	url="index.php?hidefooter=true";
	
	xmlHttp.onreadystatechange = function() {
		
		if (xmlHttp.readyState==4) {
		
			document.getElementById("footertoggleicon").style.width="17px";
			document.getElementById("footertoggleicon").style.width="17px";
			document.getElementById("footertoggleicon").style.backgroundImage="url(gfx/profile/commenticons.png)";
			
			if(document.getElementById("footercontent").style.display == "none") {
			
				document.getElementById("footertoggleicon").style.backgroundPosition="-128px 0px";
			
			}
			
			else {
			
				document.getElementById("footertoggleicon").style.backgroundPosition="-77px 0px";
			
			}
		
		}
	
	}
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

var uploading = 0;
var fileuploaded = 0;

function sendform() {

	document.getElementById("changefolder").disabled="disabled";
	document.getElementById("newfolder").disabled="disabled";
	document.getElementById("paginate").style.display="none";
	document.getElementById("uploadarea").style.display="none";
	document.getElementById("uploadareapend").style.display="";
	document.getElementById("success").style.display="";

}

function fail() {

	document.getElementById("changefolder").disabled="";
	document.getElementById("newfolder").disabled="";
	document.getElementById("paginate").style.display="";
	document.getElementById("uploadarea").style.display="";
	document.getElementById("uploadareapend").style.display="none";
	document.getElementById("success").style.display="none";
	document.getElementById("fail").style.display="";

}