// this function is called by z_init
function z_sub_init () {
    var cp = document.getElementById ("submit");
    if (cp) {
        if (cp.onclick) {
          cp.oldonclick = cp.onclick;
        }
    	cp.onclick = z_comment_postonclick;
    }
}

function z_sub_get_comment_author () {
    if (typeof (z_user_name) != 'undefined') {
	return z_user_name;
    }
    var x = document.getElementById ("author");
    if (x) {
	return x.value;
    }
    return undefined;
}

function z_sub_get_comment_extra () {
    if (typeof (z_user_email) != 'undefined') {
	return z_user_email;
    }
    var x = document.getElementById ("email");
    if (x) {
	return x.value;
    }
    return undefined;
}

// get base url from original script tag src
var js = document.getElementById ("stats_script");
z_base_url = js.src.substring (0, js.src.lastIndexOf ("/") + 1);
// include stats.js last
document.write ('<script type="text/javascript" src="' + z_base_url + 'stats.js"></script>');
