$(document).ready(function () { register_program_tab(); add_active_link(); HideShowMoreButton('programEpisodes', 'btnMoreEpisodes', 8); compare(); }); function register_program_tab() { $("#prog_det_tab>li:first-child").addClass("activeLi"); $("#prog_det_tabs > div").hide(); $("#programEpisodes").show(); $("#prog_det_tab").find("a").bind("click", function () { if ($(this).parents().hasClass("activeLi")) { return false; } $("#prog_det_tabs > div").each(function (i) { $(this).find(">div:first-child").html(""); $("#relatedEpisodes").html(''); $(this).hide(); }); $("#prog_det_tabs > div > #hdnPageNo").each(function (i) { $(this).val("0"); }); $("#" + $(this).attr("data-my_tab")).fadeIn(); }); } function add_active_link() { $("#prog_det_tab").find("li").bind("click", function () { $(this).addClass("activeLi"); $(this).siblings().removeClass("activeLi"); }); } function GetProgramEpisodes(count) { $("#programEpisodes #relatedEpisodes .imagesLoader").remove(); var programId = $('#programId').val(); var pageNumber = parseInt($('#programEpisodes #hdnPageNo').val()) + 1; var URL = "/Content/GetProgramEpisodes?layout=&pageNumber=" + pageNumber + "&count=" + count + "&programId=" + programId; $.ajax({ type: "GET", url: URL, dataType: "html", beforeSend: function () { $("#programEpisodes #relatedEpisodes").append("
"); }, success: function (response) { $("#programEpisodes #relatedEpisodes .imagesLoader").remove(); if (response != "") { $('#programEpisodes #relatedEpisodes').append(response); $('#programEpisodes #hdnPageNo').val(pageNumber); HideShowMoreButton('programEpisodes', 'btnMoreEpisodes', count); } else { $('#programEpisodes #relatedEpisodes').html('
لا يوجد حلقات
'); } } }); } function GetProgramNews(count) { $("#programNews #relatedNews .imagesLoader").remove(); var programId = $('#programId').val(); var pageNumber = parseInt($('#programNews #hdnPageNo').val()) + 1; var URL = "/Content/GetProgramNews?pageNumber=" + pageNumber + "&count=" + count + "&programId=" + programId; $.ajax({ type: "GET", url: URL, dataType: "html", beforeSend: function () { $("#programNews #relatedNews").append("
"); }, success: function (response) { $("#programNews #relatedNews .imagesLoader").remove(); if (response != "") { $('#programNews #relatedNews').append(response); equalHeight($("a.guest_title")); $('#programNews #hdnPageNo').val(pageNumber); $('#programNews #hdnTotal').val($("#relatedNews #hdnTotal").val()); $("#relatedNews #hdnTotal").remove(); HideShowMoreButton('programNews', 'btnMoreNews', count); } else { $('#programNews #relatedNews').html('
لا يوجد اخبار
'); } } }); } function GetProgramPhotoAlbums(count) { $("#programPhotos #relatedPhotoAlbums .imagesLoader").remove(); var programId = $('#programId').val(); var pageNumber = parseInt($('#programPhotos #hdnPageNo').val()) + 1; var URL = "/Content/GetProgramPhotoAlbums?pageNumber=" + pageNumber + "&count=" + count + "&programId=" + programId; $.ajax({ type: "GET", url: URL, dataType: "html", beforeSend: function () { $("#programPhotos #relatedPhotoAlbums").append("
"); }, success: function (response) { $("#programPhotos #relatedPhotoAlbums .imagesLoader").remove(); if (response != "") { $('#programPhotos #relatedPhotoAlbums').append(response); $('#programPhotos #hdnPageNo').val(pageNumber); $('#programPhotos #hdnTotal').val($("#relatedPhotoAlbums #hdnTotal").val()); $("#relatedPhotoAlbums #hdnTotal").remove(); IntializeImageHover("singers_image", "singer_discription"); HideShowMoreButton('programPhotos', 'btnMorePhotos', count); } else { $('#programPhotos #relatedPhotoAlbums').html('
لا يوجد صور
'); } } }); } function equalHeight(group) { var tallest = 0; group.each(function () { thisHeight = $(this).height(); //alert(thisHeight); if (thisHeight > tallest) { tallest = thisHeight; } }); group.height(tallest); } function GetProgramVideos(count) { $("#programVideos #relatedVideos .imagesLoader").remove(); var programId = $('#programId').val(); var pageNumber = parseInt($('#programVideos #hdnPageNo').val()) + 1; var URL = "/Content/GetProgramVideos?pageNumber=" + pageNumber + "&count=" + count + "&programId=" + programId; $.ajax({ type: "GET", url: URL, dataType: "html", beforeSend: function () { $("#programVideos #relatedVideos").append("
"); }, success: function (response) { $("#programVideos #relatedVideos .imagesLoader").remove(); if (response != "") { $('#programVideos #relatedVideos').append(response); $('#programVideos #hdnPageNo').val(pageNumber); $('#programVideos #hdnTotal').val($("#relatedVideos #hdnTotal").val()); $("#relatedVideos #hdnTotal").remove(); IntializeImageHover("guest_video", "video_des"); HideShowMoreButton('programVideos', 'btnMoreVideos', count); } else { $('#programVideos #relatedVideos').html('
لا يوجد فيديوهات
'); } } }); } function compare() { var str1 = $('.program').html(); var str2 = $('.title_detailed').html(); if (str1==str2) { $('.current_program_det').show(); } }