var postid_redirect;
var noticeid_redirect;
function redirect_notice(){
	if (comment_id_redirect != 0){
    	window.location = 'showthread.php?p=' + postid_redirect + '#commentbit_' + comment_id_redirect;
	} else {
		window.location = 'showthread.php?p=' + postid_redirect + '#post' + postid_redirect;
	}
}

function setviewed_notice(noticieid, postid, comment_id){
	comment_id_redirect = comment_id;
	noticeid_redirect = noticieid;
    postid_redirect = postid;
    gnotie = new vB_AJAX_Handler(true);
    gnotie.onreadystatechange(redirect_notice);
	gnotie.send('ajax.php', 'do=setviewed_notice&noticeid='+noticieid);
}
