﻿<!--
    function forumTopicTrackComponent(forumTopicId, applicationSubPath, sticky, closed) {
        this.forumTopicId = forumTopicId;
        this.applicationSubPath = applicationSubPath;
        this.sticky = sticky;
        this.closed = closed;
        
        function check() {  
            wsComponent.sendRequest(applicationSubPath + '/Portal/WebServices/ForumTopicTrackService.asmx', 'Check', '<forumTopicId>' + forumTopicId + '</forumTopicId>', true, wsComponent.execOnSuccess(checkCallback));
        }
        
        function checkCallback(xmlHttpReq) {
            if (wsComponent.getNodeValue(xmlHttpReq, 'CheckResult') == 'true') {
                if (sticky && closed)
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_stickyclosed_unread.gif';
                else if (sticky)
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_sticky_unread.gif';
                else if (closed)
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_closed_unread.gif';
                else
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_unread.gif';
                document.getElementById('imgForumTopic' + forumTopicId).title = 'Nowe wiadomości';
            } else {
                if (sticky && closed)
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_stickyclosed_read.gif';
                else if (sticky)
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_sticky_read.gif';
                else if (closed)
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_closed_read.gif';
                else
                    document.getElementById('imgForumTopic' + forumTopicId).src = '../Portal/Images/Forum/topic_read.gif';
                document.getElementById('imgForumTopic' + forumTopicId).title = 'Brak nowych wiadomości';
            }        
        }
    
        this.check = check;
    }   
//-->

