﻿// JScript File

$(document).ready(function() {
    // Opening the current menu <-- Javascript node opening
    //    var sPage = document.URL.substring(document.URL.lastIndexOf('/') + 1);

    //    $('.slider a').each(function(i) {
    //        if ($(this).attr("href") == sPage) {
    //            //$(this).parents("ul:first").show();
    //            $(this).parents("ul").prev().addClass('active');
    //        }
    //    });

    $('.menuItem img.logo').each(function() {
        $(this).data('color', $(this).attr('colorSrc'));
        $(this).data('gray', 'UserImages/graybox.png');
    });

    $('.menuItem').click(function() {
        //document.location = $(this).next().find('a:first').attr('href'); <-- for auto clicking the first node    
        $('.menuItem').next().slideUp();
        $(this).not('.active').next().slideDown();

        $('.menuItem').not(this).removeClass('active');
        $(this).toggleClass('active');

        $('.menuItem img.logo').each(function() {
            $(this).attr('src', $(this).data('gray'));
        });

        if ($('.menuItem.active').length == 0) {
            $('.menuItem img.logo').each(function() {
                $(this).attr('src', $(this).data('color'));
            });
        }
    });
})

function bookmark(){
var title = 'Eshed Group Site';
var url = 'http:\\www.eshedgroup.com';

                 if (window.sidebar) {
                     window.sidebar.addPanel(title, url, "");
                 } else if (document.all) {
                 window.external.AddFavorite(url, title);
                 } else if (window.opera && window.print) {
                     return true;
                 }

}



