function m_comments_imgOn(imgName) {
    if (document.images) { document[imgName].src = imgon.src; }
}
function m_comments_imgOff(imgName) {
    if (document.images) { document[imgName].src = imgoff.src; }
}

var c=0;
function m_comments_rate(comment_id, nr){
    var Name;
    c=nr;
    for (var i=1;i<6;i++){
        Name='c_'+comment_id+'_'+i;
        if (i>nr){
            m_comments_imgOff(Name);
        }
        else {
            m_comments_imgOn(Name);
        }
    }
    document.comments_vote.vote_id.value = comment_id
}
function m_comments_SubmitRating(){
    if (c==0) return;
    document.comments_vote.rating.value=c;
    document.comments_vote.m_comment_action.value = "stars_vote";
    document.comments_vote.submit();
}

function m_comments_open_window(url){
    var winname = this.open(url, "win", "buttons=no,scrollbars=yes,location=no,menubar=yes,resizable=yes,status=no,directories=no,toolbar=no, width=600,height=500,left=180,top=150");
}

function m_comments_quoteText(c_id) {
	var name_obj = document.getElementById('comment_name_' + c_id);
	var text_obj = document.getElementById('comment_text_' + c_id);
	var comment_obj = document.comments_form.m_comments_text;
	if (name_obj && text_obj && comment_obj) {
		c_head = name_obj.innerHTML;
		c_body = text_obj.innerHTML;
		c_body = c_body.replace(/(<br[^>]*>)/ig, ':-=-:');
		c_body = c_body.replace(/(\n)/ig, '');
		c_body = c_body.replace(/<div[^>]+>.*?<\/div>/ig, '');
		c_body = c_body.replace(/(<([^>]*)>)/ig, '');
		c_head = c_head.replace(/(<([^>]*)>)/ig, '');
		c_body = c_body.replace(/:-=-:/ig, '\n');
		comment_obj.value = comment_obj.value + "[quote]" + c_head + "\n" + c_body + "[/quote]\n";
	}
}