function Enjoy_Topic (id) { 
 if (xmlhttp){ 
 						tid = id;
						type = 't';
 						var url = "http://www.darkstarlings.com/bbs/enjoy_topic.php?id=" + id + "&enjoy=1";
                        xmlhttp.open("GET", url, true);
                        xmlhttp.onreadystatechange = parseEnjoyData;
                        xmlhttp.send(null);
                    }
}

function Unjoy_Topic (id) { 
 if (xmlhttp){ 
 	
						tid = id;
						type = 't';
 						var url = "http://www.darkstarlings.com/bbs/enjoy_topic.php?id=" + id + "&enjoy=2";
                        xmlhttp.open("GET", url, true);
                        xmlhttp.onreadystatechange = parseEnjoyData;
                        xmlhttp.send(null);
                    }
}

function Members_Topic (id) { 
 if (xmlhttp){ 
 	
						tid = id;
						type = 't';
						members = 1;
 						var url = "http://www.darkstarlings.com/bbs/enjoy_members_topic.php?id=" + id;
                        xmlhttp.open("GET", url, true);
                        xmlhttp.onreadystatechange = parseEnjoyData;
                        xmlhttp.send(null);
                    }
}

function Enjoy_Reply (id) { 
 if (xmlhttp){ 
 						tid = id;
						type = 'r';
 						var url = "http://www.darkstarlings.com/bbs/enjoy_reply.php?id=" + id + "&enjoy=1";
                        xmlhttp.open("GET", url, true);
                        xmlhttp.onreadystatechange = parseEnjoyData;
                        xmlhttp.send(null);
                    }
}

function Unjoy_Reply (id) { 
 if (xmlhttp){ 
 	
						tid = id;
						type = 'r';
 						var url = "http://www.darkstarlings.com/bbs/enjoy_reply.php?id=" + id + "&enjoy=2";
                        xmlhttp.open("GET", url, true);
                        xmlhttp.onreadystatechange = parseEnjoyData;
                        xmlhttp.send(null);
                    }
}

function Members_Reply (id) { 
 if (xmlhttp){ 
 	
						tid = id;
						type = 'r';
						members = 1;
 						var url = "http://www.darkstarlings.com/bbs/enjoy_members_reply.php?id=" + id;
                        xmlhttp.open("GET", url, true);
                        xmlhttp.onreadystatechange = parseEnjoyData;
                        xmlhttp.send(null);
                    }
}

function parseEnjoyData() {

    if (xmlhttp.readyState == 4) {  
		
        var res = xmlhttp.responseText.split("|")
		if (res[0]) { 
		applyEnjoyFunction (tid, res, type); }
		           
    }     
}

function applyEnjoyFunction(id, res, type){
document.getElementById(type + id + "members").innerHTML = res[0];
if (res[1]) { document.getElementById(type + id + "link").innerHTML = res[1]; }
}

