﻿function DeleteArticlePause() { GlobalMessage.create("האם ברצונך למחוק כתבה זו?", ""); }
function PutTopArticlePause() { GlobalMessage.create("האם לפרסם כתבה בראשי של הקטגוריה ?", ""); }  
function ShowConfirm(id,isAdmin){GlobalMessage.create("האם ברצונך למחוק תגובה זו?","","ArticleDeleteComment('" + id + "');");}  
function ShareObject(objectID,objectType){ShareFavorite(objectID,objectType);}
function ShareFavorite(objectID,objectType){
    GenericAjaxCTL.Reset();
    GenericAjaxCTL.Start(
        'שתף כתבה זו',
        ['Type=FavoriteShare','ObjectID=' + objectID,'ObjectType=' + objectType],
        'FavoriteShare.js',
        ['ObjectID=' + objectID,'ObjectType=' + objectType]
    );
}
function arrowEffect(id,howFar,vote){
    var obj = $get(id);
    new Effect.Move(obj, { y: howFar, mode: 'relative'});
    $(id).fade({duration: 1.5});
    setTimeout("VoteForArticle(" + vote + ")",1500)
}
var OverLink = {
    over : function(dvOver){$(dvOver).style.backgroundColor = '#99CCFF';},
    out : function(dvOut){$(dvOut).style.backgroundColor = '#fff';}
}

/* Comments */
function setdvLoaderGenericHeight(){
    var dvLoaderGenericHeight = $('dvCommentCont').getHeight();                                                                                                
    dvLoaderGenericHeight = dvLoaderGenericHeight + "px";                                                                
    $('dvLoaderComment').setStyle( { 'height' : dvLoaderGenericHeight } );
}

function scrollToText(){
    $.comment.focus('txtCommentAdd');
}

function setReplayComment(CommentID) {
    $.ajax('News_GetCommentContent', { postBody: "CommentID=" + CommentID, onSuccess: function(transport, state) {
        if (state) {
            var text = ""; //trim(GetTextBlock(transport, '#MEK:NewsCommentAuthorUname'));
            text += "[ציטוט " + trim(GetTextBlock(transport, '#MEK:NewsCommentAuthorUname')) + " " + trim(GetTextBlock(transport, '#MEK:NewsCommentDate')) + "]";
            text += GetTextBlock(transport, '#MEK:NewsCommentConent') + "[/ציטוט]\n\n";
            $('txtCommentAdd').value = text;
            $('txtCommentAdd').scrollTop = 9999;
        }

    }
    })
    scrollToText();
};

