/*-------------------------------------------------------+
| Ajax Comments mSF For PHP-Fusion 7.xx v.1.2
| Copyright © 2008-2009 Powered by .:MeF:.
| URL: http://x-iweb.ru/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

function addcomment()
    {
            new Ajax.Updater( 'printcomments', '../comments/data.php?delete_comment=0',
	    {
		    method: 'post',
		    parameters: $('cform').serialize(),
		    onSuccess: function() {
			$('comment_text').value = '';
		    }
	    }                   );
		
		var loader = document.getElementById('loading');
		loader.innerHTML = '<img src="../comments/images/comment_loading.gif" alt="loading" />';
	
    }
	
function deletecomment(commetid,cid,ctype,cdb,ccol,clink,cstart)
    {
            new Ajax.Updater( 'printcomments', '../includes/comments/data.php?delete_comment=1',
	    {
		    method: 'post', 
			parameters: $({			
            comment_id: commetid, 
			id: cid,
            ctype: ctype,
            cdb: cdb,
            ccol: ccol,			
			clink: clink,
			cstart: cstart })
	    }                   );
		
		var loader = document.getElementById('loading');
		loader.innerHTML = '<img src="../includes/comments/images/comment_loading.gif" alt="loading" />';
		
    }
	
function editcomment(commetid,cid,ctype,cdb,ccol,clink,cstart)
    {
            new Ajax.Updater( 'printcomments', '../includes/comments/data.php?delete_comment=2',
	    {
		    method: 'post', 
			parameters: $({			
            comment_id: commetid, 
			id: cid,
            ctype: ctype,
            cdb: cdb,
            ccol: ccol,			
			clink: clink,
			cstart: cstart })
	    }                   );
		
		var loader = document.getElementById('load_'+commetid);
		loader.innerHTML = '<img src="../includes/comments/images/comment_loading.gif" alt="loading" />';
		
    }
	
function savecomment(commet_id)
    {
            new Ajax.Updater( 'printcomments', '../comments/data.php?delete_comment=3',
	    {
		    method: 'post',
		    parameters: $('saveform_'+commet_id).serialize(),
		    onSuccess: function() {
			$('comment_text').value = '';
		    }
	    }                   );
		
		var loader = document.getElementById('load_'+commet_id);
		loader.innerHTML = '<img src="../comments/images/comment_loading.gif" alt="loading" />';
		
    }
