function hide_element (id) {
	e = document.getElementById(id);
	e.style.display = 'none';
}
function show_element (id) {
	e = document.getElementById(id);
	e.style.display = 'block';
}
function toggle_element (id) {
	e = document.getElementById(id);
        if (e.style.display == 'none') {
                e.style.display = 'block';
                return;
        }
        e.style.display = 'none';
}
function httpRequest (url, callback) {
    var xmlhttp;
    if (window.XMLHttpRequest) {
        xmlhttp=new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
    } else if (window.ActiveXObject) {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
    } else {
        alert("Get a good browser like Firefox, Opera, or Safari to view comments.");
    }
    xmlhttp.onreadystatechange=callback;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}
function get_s (x) {
    if (x == 1)
        return '';
    return 's';
}
function get_fdate_ago (current_time, compare_time) {
    if ((current_time - compare_time) > 2419200) {
        x = Math.round((current_time - compare_time) / 2419200);
        fdateago = x+" month"+get_s(x)+" ago";
    } else if (compare_time < (current_time - 604800)) {
        x = Math.round((current_time - compare_time) / 604800);
        fdateago = x+" week"+get_s(x)+" ago";
    } else if (compare_time < (current_time - 86400)) {
        x = Math.round((current_time - compare_time) / 86400);
        fdateago = x+" day"+get_s(x)+" ago";
    } else if (compare_time < (current_time - 3600)) {
        x = Math.round((current_time - compare_time) / 3600);
        fdateago = x+" hour"+get_s(x)+" ago";
    } else if (compare_time < (current_time - 60)) {
        x = Math.round((current_time - compare_time) / 60);
        fdateago = x+" minute"+get_s(x)+" ago";
    } else if (compare_time < (current_time - 1)) {
        x = current_time - compare_time;
        fdateago = x+" second"+get_s(x)+" ago";
    } else {
        fdateago = "just now";
    }
    return fdateago;
}