﻿$(document).ready(function () {
    $('.fwMenu > .fwMenu_left > ul > li:not(:last-child)').addClass('borderright');
    $('.fwMenu > .fwMenu_left > ul > li:first').addClass('paddingleft5');
    $('.fwMenu ul li ul li:last-child').css('background', 'none');

    $('.fwMenu ul li').hover(function () {
        $(this).find('ul').show().idle(2500);
    }, function () {
        $(this).find('ul').hide();
    });

    $('.right_width675 .contactus').each(function () {
        if ($(this).find("img").attr('src').toString() == '/ShowFile.ashx?FileInstanceId=00000000-0000-0000-0000-000000000000') {
            $(this).find("img").css({ 'display': 'none' });
        }
    });

    $('div.midContactCard').each(function(){
    if( $(this).children().length <1)
    {
        $(this).parent().css('display', 'none');
    }
    });


$('div.imageSmall').each(function () {
    if ($(this).children().length < 1) {
        $(this).css('display', 'none');
    }
});

$('.bg_contactcard').each(function () {
    if ($(this).find("img").attr('src').toString() == '/ShowFile.ashx?FileInstanceId=00000000-0000-0000-0000-000000000000') {
        $(this).find("img").css('display', 'none');
    }
});

    
});



/*-----------------------------------------------------------*/
// function frontSlideImage image
frontSlideImage = function (strSelector, strSelectorButton, timeDelay) {
    var tOut;
    var curindex = 0;
    var maxindex = 0;
    var preIndex = 0;
    maxindex = $(strSelector).length;
    if (maxindex >= 2) {
        autochange($(strSelector + ":eq(" + curindex + ")"));
    }
    else {
        $(strSelectorButton + ":eq(" + curindex + ")").addClass("active");
        $(strSelector + ":eq(" + curindex + ")").fadeIn(800);
    }
    $(strSelectorButton).click(function () {
        $(strSelector + ":eq(" + preIndex + ")").fadeOut(1000);
        $(strSelector + ":eq(" + curindex + ")").css("z-index", 0);
        curindex = $(strSelectorButton).index($(this));
        autochange($(strSelector + ":eq(" + curindex + ")"));
    });
    function autochange(obj) {
        clearTimeout(tOut);
        $(obj).css("z-index", 1)
        preIndex = curindex;
        $(strSelectorButton + ".active").removeClass("active");
        $(strSelectorButton + ":eq(" + curindex + ")").addClass("active");
        $(obj).fadeIn(800, function () {
            tOut = setTimeout(function () {
                $(strSelector + ":eq(" + preIndex + ")").fadeOut(1000);
                $(strSelector + ":eq(" + curindex + ")").css("z-index", 0);
                curindex++;
                if (curindex == maxindex) curindex = 0;
                autochange($(strSelector + ":eq(" + curindex + ")"));
            }, timeDelay);
        });
    }
}; 


