﻿
$(document).ready(function () {
    //var toac = $('.menu_left').find('div:nth(0)').addClass('activemv');

    var toac = -30;
    if ($('.activemv').position() != null)
        toac = $('.activemv').position().top + 3;

    // alert(toac);
    $('.menu_left').css('background', "url('assets/images/li_hover_menu.gif') no-repeat 5px " + toac + "px");
    var a=null;
    $('.menu_left li div').hover(function () {

        if (a != null)
            a.css({ 'color': 'black', 'padding-left': '20px', 'background': "url('assets/images/lMMicon1.gif') no-repeat 8px center" });
            $('.activemv a').css({ 'color': 'black', 'padding-left': '20px', 'background': "url('assets/images/lMMicon1.gif') no-repeat 8px center" });
        a = $(this).find('a');
        var p = $(this).position().top + 3;
        $('.menu_left').stop().animate({
            backgroundPosition: '5px ' + p + 'px'
        }, 200, function () {
            a.css({ 'background': "url('assets/images/lMMicon2.gif') no-repeat 8px center" });
            a.stop().animate({
                paddingLeft: 25
            }, { easing: '', duration: 100 });
        });
    }, function () {

       /* $('.menu_left').stop().animate({
            backgroundPosition: '5px ' + toac + 'px'
        }, 200, function () {
        });
        a.css({ 'background': "url('assets/images/lMMicon1.gif') no-repeat 8px center" });
        a.stop().animate({
            paddingLeft: 20
        }, { easing: '', duration: 100 });*/

    });
    $('.menu_left').hover(function () {
    }, function () {
        $('.activemv a').css({ 'background': "url('assets/images/lMMicon2.gif') no-repeat 8px center" });
        $('.activemv a').stop().animate({
            paddingLeft: 25
        }, { easing: '', duration: 100 });
    });
});

