﻿var animating=false;var currentPageIndex=1;$().ready(function(){$(".ContentLightGrayBoxSelectedItem").hide();$(".StartPageNewsListCategoryLink").show();$(".NewsListCategoryId0").hide();$(".NewsListSelectedCategoryId0").show();$(".StartPageBlogListPagingNext").click(function(){AnimateList("next",this)});$(".StartPageBlogListPagingPrev").click(function(){AnimateList("prev",this)});$(".StartPageNewsListCategoryLink").click(function(){if(animating==false){var A=$(this).children(".StartPageNewsListCategoryLinkCategoryId").html();$(".StartPageBlogListPlate").hide();$(".StartPageBlogListProgressPlate").show();$.ajax({type:"POST",url:"/Home/BloggList/"+A,data:"",success:function(B){if(B!="false"){$(".StartPageBlogListPlate").html(B);if(A=="0"){$(".ContentLightGrayBoxSelectedItem").hide();$(".StartPageNewsListCategoryLink").show();$(".NewsListCategoryId0").hide();$(".NewsListSelectedCategoryId0").show()}else{$(".ContentLightGrayBoxSelectedItem").hide();$(".StartPageNewsListCategoryLink").show();$(".NewsListSelectedCategoryId"+A).show();$(".NewsListCategoryId"+A).hide()}$(".StartPageBlogListProgressPlate").hide();$(".StartPageBlogListPlate").show();var D=$(".StartPageBlogListItemWrapper:visible").length;var E=Math.ceil(D/3);var C=1;for(C=1;C<=5;C++){if(C<=E){$(".PagingItem"+C).removeClass("Hide")}else{$(".PagingItem"+C).addClass("Hide")}}AnimateList("",null)}}})}})});function AnimateList(A,B){if(!$(B).hasClass("StartPageBlogListPagingOff")){var C="0px";if(A=="next"){C="-=324px"}else{if(A=="prev"){C="+=324px"}else{$(".StartPageBlogListPlate").css("top","319px")}}if(animating==false){animating=true;$(".StartPageBlogListPlate").animate({top:C},1500,function(){animating=false});if(A=="next"){currentPageIndex++}else{if(A=="prev"){currentPageIndex--}else{currentPageIndex=1}}var D=$(".StartPageBlogListPagingItem:visible").length;if(currentPageIndex==1){$(".StartPageBlogListPagingPrev").addClass("StartPageBlogListPagingOff").removeClass("PointerLink");$(".StartPageBlogListPagingPrev").children("span").children("img").attr("src","/Content/Images/Design/StartPage/Boxes/blog/paging_prev_off.gif")}else{if($(".StartPageBlogListPagingPrev").hasClass("StartPageBlogListPagingOff")){$(".StartPageBlogListPagingPrev").removeClass("StartPageBlogListPagingOff").addClass("PointerLink");$(".StartPageBlogListPagingPrev").children("span").children("img").attr("src","/Content/Images/Design/StartPage/Boxes/blog/paging_prev_on.gif")}}if(currentPageIndex==D){$(".StartPageBlogListPagingNext").addClass("StartPageBlogListPagingOff").removeClass("PointerLink");$(".StartPageBlogListPagingNext").children("span").children("img").attr("src","/Content/Images/Design/StartPage/Boxes/blog/paging_next_off.gif")}else{if($(".StartPageBlogListPagingNext").hasClass("StartPageBlogListPagingOff")){$(".StartPageBlogListPagingNext").removeClass("StartPageBlogListPagingOff").addClass("PointerLink");$(".StartPageBlogListPagingNext").children("span").children("img").attr("src","/Content/Images/Design/StartPage/Boxes/blog/paging_next_on.gif")}}$(".StartPageBlogListPagingItem").children("img").attr("src","/Content/Images/Design/StartPage/Boxes/blog/paging_off.gif");$(".PagingItem"+currentPageIndex).children("img").attr("src","/Content/Images/Design/StartPage/Boxes/blog/paging_on.gif")}}};
