﻿$(document).ready(function () {
    var pathname = window.location.pathname;
    $('.TopMenu > ul > li').each(function () {
        $('.TopMenu > ul > li:first').addClass('Current');
        if ($('.TopMenu > ul > li').not(':first').hasClass('Current') || pathname == "/Search.aspx") {
            $('.TopMenu > ul > li:first').removeClass('Current');
        }
    });

    $('.submenu ul li ul').each(function () {
        if ($(this).children().length < 1) $(this).remove();
    });

    $('.Count2 ul').each(function () {
        if ($(this).children().length < 2) $(this).parent().parent().parent().css({ 'display': 'none' });
    });
    $('.fwMenu ul li').hover(function () {
        $(this).find('ul').slideToggle();
    }, function () {
        $(this).find('ul').hide();
    });

    $('.twoWebfolder .ex_webfolder:last-child').css({ 'margin-right': '0px' });
    $('.threeArticle .articleRootPage:last-child').css({ 'margin-right': '0px' });
    $('.ArticleList li.col_0').css({ 'margin-right': '0px' });


    $('.threeArticle .articleRootPage div.img').each(function () {
        if ($(this).find("img").attr('src').toString() == '/ShowFile.ashx?FileInstanceId=00000000-0000-0000-0000-000000000000') {
            $(this).css({ 'display': 'none' });
        }
    });


    $('.Template-Content .ArticleList li .img').each(function () {
        if ($(this).find("img").attr('src').toString() == '/ShowFile.ashx?FileInstanceId=00000000-0000-0000-0000-000000000000') {
            $(this).find('img').css({ 'display': 'none' });
        }
    });

    $('.imageLRT .image').each(function () {
        if ($(this).find("img").attr('src').toString() == '/ShowFile.ashx?FileInstanceId=00000000-0000-0000-0000-000000000000') {
            $(this).css({ 'display': 'none' });
        }
    });

    //$('.submenu ul:empty').parent().parent().parent().css({ 'display': 'none' });
    //    if (!$('.submenu ul').find('li a').hasClass('child')) {
    //        $('.submenu').css({ 'display': 'none' });
    //    };


    $('.gallary_banner .SlideImage').cycle({
        fx: 'fade',
        speed: '4000',
        timeout: 800,
        next: '.gallary_banner .next',
        prev: '.gallary_banner .prev'
    });

});
