﻿///<reference path="jquery-1.3.js">
$(document).ready(function() {
    //alert('menu');
    if (1 == 1) {
        $('.subMenu').hide();

        $('.mainMenuItem').hover(function() {

            var width = $(this).width();
            var height = $(this).height();
            var left = $(this).offset().left;
            var top = $(this).offset().top;
            $(this).children('.subMenu').css('left', left + "px");
            $(this).children('.subMenu').css('top', top + height + "px");
            $(this).children('.subMenu').slideDown(600);

            $(this).children().find('.subMenuItem').each(function(i) {
                if ($(this).find('.subMenuItem')[0] != undefined) {

                    $(this).append("--");
                }
            });
            //$(this).find('.sub').css({ "left": (pos.left + width) + "px", "top": pos.top + "px" });
            //$('.sub', this).show(400);
        },
           function() {

               //$(this).addClass('main');
               //$(this).removeClass('sub');
               $(this).children('.subMenu').slideUp(400);
           });
        $('.subMenuItem').hover(function() {
            var top = this.offsetTop;
            var width = $(this).width();
            var height = $(this).height();

            //alert(pos.top);
            $(this).children('.subMenu').show(400);
            $(this).children('.subMenu').css('left', width - 2 + "px");
            $(this).children('.subMenu').css('top', top + "px");

        },
           function() {


               $(this).children('.subMenu').hide(400);
           });
    }
});

