function showArticle( articleId ) {
    Dialog.alert({url: HTTP_MAIN + "Blog/ajax/viewarticle/id/"+articleId, options: {method: 'get'}}, {className: "alphacube", width:540, height: 400, okLabel: "Fermer"});
}

function showComment( commentId ) {
    Dialog.alert({url: HTTP_MAIN + "Blog/ajax/viewcomment/id/"+commentId, options: {method: 'get'}}, {className: "alphacube", width:540, height: 250, okLabel: "Fermer"});
}

function activateSpecific(){
    $('modulesList').show();
    $('activateSpecific').hide();
    $('deactivateSpecific').show();
    $('modulesListSpec').value = '1';
}

function deactivateSpecific(){
    $('modulesList').hide();
    $('activateSpecific').show();
    $('deactivateSpecific').hide();
    $('modulesListSpec').value = '0';
}

function publishComment( commentId ) 
{
    var link  = 'acceptLink_'+commentId;
    var link2 = 'refuseLink_'+commentId;
    var span  = 'status_'+commentId;
    $(link).update('<span class="warn">Veuillez patienter...</span>');
    $(link2).update('');
    var url =  HTTP_MAIN + 'Blog/ajax/publishcomment/id/'+commentId;
        var req1 = new Ajax.Request(url, {
            method: 'get',
            onSuccess: function(transport) {

                if ( transport.responseText.length > 2 ) 
                {
                    $(link).update('');
                    $(span).update('<span class="pos">Publié</span>');
                }
            }
        });
}

function unpublishComment( commentId ) 
{
    var link  = 'acceptLink_'+commentId;
    var link2 = 'refuseLink_'+commentId;
    var span  = 'status_'+commentId;
    $(link).update('<span class="warn">Veuillez patienter...</span>');
    $(link2).update('');
    var url =  HTTP_MAIN + 'Blog/ajax/unpublishcomment/id/'+commentId;
        var req1 = new Ajax.Request(url, {
            method: 'get',
            onSuccess: function(transport) {

                if ( transport.responseText.length > 2 ) 
                {
                    $(link).update('');
                    $(span).update('<span class="neg">Non publié</span>');
                }
            }
        });
}

function disableSubmit() {
    $('configSubmit').disable();
    $('loader').show();
}

Event.observe(window, 'load', function() {
    if ( $('activateSpecific'))         Event.observe('activateSpecific', 'click', activateSpecific );
    if ( $('deactivateSpecific'))         Event.observe('deactivateSpecific', 'click', deactivateSpecific );
	if ( $('configSubmit'))              Event.observe('configSubmit', 'click', disableSubmit );
});