/*
    Type=DISCUSSION;
    ElementID=x (DiscussionID,0)
    Value=1/0 (1=set, 0=unset)
*/
                                  
                          
function SetNotify(Type,ElementID,Value,Elem,Class,NewText)
{
    var Vanilla = new PathFinder();
    var ajax = new Ajax.Request(Vanilla.webRoot = Vanilla.getRootPath('script', 'src', 'js/global.js')+'extensions/Notify/ajax.php', {
        parameters:'PostBackAction=ChangeNotify&Type='+Type+'&ElementID='+ElementID+'&Value='+Value,
        onSuccess: function(r)
        {
            //Element.removeClassName(Elem,Class);
            //if (NewText != '') Elem.innerHTML = NewText;
            $(Elem).innerHTML = 'Cambios guardados';
            $(Elem).style.display = "block";
            //Effect.Fade(Elem,{duration:3}); //return false;
            new Effect.Opacity('respuesta', {from:1, to:0});
            //$(Elem).style.visibility = "hidden";
        }
    });
    return true;
}

function NotifyOwn()
{
    Element.addClassName('NotifyOwnCont','PreferenceProgress');
    if ($('NotifyOwnField').checked == true) Value = 1;
    else Value = 0;
    SetNotify('OWN',0,Value,'respuesta','PreferenceProgress','Cambios guardados');
}
