﻿function Video(_AuthenticationKey) 
{
    this.authenticationKey = _AuthenticationKey;

    this.Initialize = function() {
        //$(".clickIndiqueVideo").click(function() { Video.Indique($(this).attr("rel")) });
        //$(".clickFavoritoVideo").click(function() { Video.Favorito($(this).attr("rel")) });
        //$(".clickVisualizarVideo").click(function() { Video.Visualizar($(this).attr("rel")) });

    }

    this.SetaExibido = function(pIdVideo) {
        $("#playlistVideo_" + pIdVideo).addClass("videoAtivo");
    }
    
    this.Compartilhar = function(pVideoId) {
        var oParams = "pAuthenticationKey=" + this.authenticationKey + "&pVideoId=" + pVideoId;
        $$$.NewSystemRequest("/WebService/Video.asmx/AddVideoCompartilhar", oParams, null, null);
    }

    this.Indique = function(pVideoId) {
        var oParams = "pAuthenticationKey=" + this.authenticationKey + "&pVideoId=" + pVideoId;
        $$$.NewSystemRequest("/WebService/Video.asmx/AddVideoIndique", oParams, null, null);
    }

    this.Favorito = function(pVideoId) {
        var oParams = "pAuthenticationKey=" + this.authenticationKey + "&pVideoId=" + pVideoId;
        $$$.NewSystemRequest("/WebService/Video.asmx/AddVideoFavorito", oParams, null, null);
    }

    this.Visualizar = function(pVideoId) {
        var oParams = "pAuthenticationKey=" + this.authenticationKey + "&pVideoId=" + pVideoId;
        $$$.NewSystemRequest("/WebService/Video.asmx/AddVideoVisualizar", oParams, null, null);
    }
    
}
