﻿var win = null;
function NewWindow(mypage,myname,w,h,scroll){
//var scroll=1
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

function voteMe(id, rate){
        $("img#myIndicator"+id).show();
        var retValue = '';
        var i=0, resInt=0;
        $.get("vote_post.aspx",
        {"ID":id, "Vote":rate}
        , function(res) {
            resInt = parseInt(res);
            if (res != "0"){
            for(i=1; i<((resInt)+1); i++){
                retValue += "<li><img src='images/rate_point.png' id='rate1' alt='' /></li>";
            }
            for(i=res; i<5; i++)
            {
                retValue += "<li><img src='images/no_rate_point.png' id='rate1' alt='' /></li>";
            }
            $("divTopic"+id).innerHTML = retValue;
            }
            $("img#myIndicator"+id).hide();
        });
    }

function NextVideo(Section,nPage){
        $("#videosBoxThumb").html("<img class='MediaLoading' src='images/loading.gif' />");
        $.getJSON("ajaxpages/media_videos.aspx",
        {"ID":Section, "Page":nPage}
        , function(res) {
            $("#HVideos").html(res.Videos);
            return false;
        });
        //$("img#VideosLoading").hide();
    }

function NextPhoto(Section,nPage){
        $("#WPBoxThumb").html("<img class='MediaLoading' src='images/loading.gif' />");
        $.getJSON("ajaxpages/media_photos.aspx",
        {"ID":Section, "Page":nPage}
        , function(res) {
            $("#HPhotos").html(res.Photos);
            return false;
        });
        //$("img#PhotosLoading").hide();
    }

function CallTopic(topicID) {
    $.getJSON("AjaxPages/TopicText.aspx",
                { "ID": topicID },
                function(data) {
                $("div#divTopic" + topicID).html(data.Topic);
                    return false;
                });
    }