$(document).ready(
  function()
  {
    //header link
//    $('div.headerHome, div.headerSearch, div.headerPlayer').each(
//      function(i)
//      {
//        $(this).css('cursor', 'pointer').click(function()
//          {
//            redirect('/borsodifoci');
//            return false;
//          }
//        );
//      }
//    );        

    //post hover
//    $('.postItemBs').hover(
//      function ()
//      {
//        $(this).addClass('postItemOn').addClass('postItemBsOn').removeClass('postItem').removeClass('postItemBs');
//      }, 
//      function ()
//      {
//        $(this).addClass('postItem').addClass('postItemBs').removeClass('postItemOn').removeClass('postItemBsOn');
//      }
//    );
    
    //podium video player
//    $('.videoHomeGold .uploadVideoPlayBs, .videoHomeSilver .uploadVideoPlayBs, .videoHomeBronze .uploadVideoPlayBs').each(function(i)
//      {
//        $(this).parent().click(function()
//          {
//            redirect('/borsodifoci/video/' + $(this).attr('id').replace('post_', ''));
//            return false;
//          }
//        );
//      }
//    );
    
    //post video player
//    $('.postItem .uploadVideoBs').each(function(i)
//      {
//        $(this).parent().click(function()
//          {
//            redirect('/borsodifoci/video/' + $(this).parent().parent().attr('id').replace('post_', ''));
//            return false;
//          }
//        );
//      }
//    );  
    
  //post rating
    $('.bsRate').ratingBS({ 
      callback: function(value, link)
        {
          var postId = $(link).parent().parent().parent().find('input.bsRate').attr('name').replace("rt", "");
          $.ajax(
          {
            url: "/ajax/DoRatePost.ashx",
            type: "POST",
            data: {
                    postid: postId,
                    ratevalue: parseFloat(value.replace(',', '.'))*1000
                  },
            cache: false,
            dataType: 'json',
            timeout: 10000,
            success: function(jsonObj){
                hideZizzPopUp();
                if (jsonObj.Status == 'OK')
                {
                  //TODO: set new rating value
                }
              }
            }
          );
        } 
      }
    );
          
  }
);

 

