
var http = createRequestObject();
function createRequestObject() {var ro;var browser = navigator.appName;if(browser == "Microsoft Internet Explorer"){ro = new ActiveXObject("Microsoft.XMLHTTP");}else{ro = new XMLHttpRequest();}return ro;}
function digResponse() {if(http.readyState == 4){    var response = http.responseText;returned = response.split('|');if(response.indexOf('|' != -1)) {var id=returned[1];var numdigs=returned[2];var status=returned[0];if(status == '1'){document.getElementById('digbut'+id).innerHTML = 'vot&eacute;';document.getElementById('numdigs'+id).innerHTML = numdigs;  }else if(status == '2'){document.getElementById('digbut'+id).innerHTML = 'vot&eacute;';}else if(status == '0'){document.getElementById('digbut'+id).innerHTML = '<a href="http://www.buzzarchive.com/connexion.php">Connexion<\/a>';}}}}
function cdigResponse() {if(http.readyState == 4){        var response = http.responseText;returned = response.split('|');if(response.indexOf('|' != -1)) {var id=returned[1];var numdigs=returned[2];var status=returned[0];if(status == '1'){document.getElementById('comd'+id).innerHTML = numdigs+' votes';document.getElementById('cup'+id).className = 'opacityit';document.getElementById('cdown'+id).className = 'opacityit';  }else if(status == '2'){document.getElementById('cup'+id).className = 'opacityit';document.getElementById('cdown'+id).className = 'opacityit';}else if(status == '0'){document.getElementById('comd'+id).innerHTML = '<a href="http://www.buzzarchive.com/connexion.php">Connexion<\/a>';}}    }}
function buryResponse() {if(http.readyState == 4){        var response = http.responseText;returned = response.split('|');if(response.indexOf('|' != -1)) {var id=returned[1];var status=returned[0];if(status == '0'){document.getElementById('digbut'+id).innerHTML = '<a href="http://www.buzzarchive.com/connexion.php">Connexion<\/a>';}else{document.getElementById('storyb'+id).style.filter = "Alpha(Opacity=80)";document.getElementById('storyb'+id).style.opacity = ".2";document.getElementById('digbut'+id).innerHTML = 'Buried';document.getElementById('storyb'+id).disabled = true;}}}}
function dig(id){document.getElementById('digbut'+id).innerHTML = 'sending';http.open('get', 'http://www.buzzarchive.com/dig.php?i='+id);    http.onreadystatechange = digResponse;    http.send(null);}
function digcom(comment_id,dir,story_id){http.open('get', 'http://www.buzzarchive.com/dig.php?type=comm&i='+comment_id+'&story='+story_id+'&dir='+dir);    http.onreadystatechange = cdigResponse;    http.send(null);if(dir == 0){dispcomment(comment_id,false,0);}}
/* function bury_story(id){	if({LOGGEDIN} == 0)	{		document.getElementById('digbut'+id).innerHTML = '<a href="http://www.buzzarchive.com/connexion.php">Connexion<\/a>';		return;	}	http.open('get', 'http://www.buzzarchive.com/bury.php?i='+id);    http.onreadystatechange = buryResponse;    http.send(null);} */
function bury_story(id){http.open('get', 'http://www.buzzarchive.com/bury.php?i='+id);http.onreadystatechange = buryResponse;http.send(null);}
function inclickcheck(field,def,val){if(field.value == def){field.value = val;}}

function dispcomment(id,show,ctype){if(ctype == 0){if(show){document.getElementById('commdesc'+id).style.display = '';document.getElementById('commbut'+id).innerHTML = 'Buried [<a href="javascript:dispcomment('+id+',false,0);">Hide Comment</a>]';}else{document.getElementById('commdesc'+id).style.display = 'none';document.getElementById('commbut'+id).innerHTML = 'Buried [<a href="javascript:dispcomment('+id+',true,0);">Show Comment</a>]';}}else if(ctype == 1){if(show){document.getElementById('commdesc'+id).style.display = '';document.getElementById('commbut'+id).innerHTML = 'Below Threshold [<a href="javascript:dispcomment('+id+',false,1);">Hide Comment</a>]';}else{document.getElementById('commdesc'+id).style.display = 'none';document.getElementById('commbut'+id).innerHTML = 'Below Threshold [<a href="javascript:dispcomment('+id+',true,1);">Show Comment</a>]';}}}
function openWindow(theURL,winName,features) {window.open(theURL,winName,features);}
function replycancel(){document.getElementById('creply').style.display = 'none';document.getElementById('replynick').innerHTML = '';document.getElementById('parentid').value = '0';}
function comreply(id,nickname){	/* if({LOGGEDIN} == 0)	{ 		alert('Please login before replying');		return;	} */	document.getElementById('creply').style.display = '';	document.getElementById('replynick').innerHTML = nickname;	document.getElementById('parentid').value = id;}

