﻿// *************************************************************************
// *                                                                       *
// * Pentia A/S                                                            *
// * http://www.pentia.dk/                                                 *
// *                                                                       *
// * Authors: as/Asim J Sikandar                                           *
// *          ts/Thomas Stern                                              *
// *                                                                       *
// * E-Mail: dev@pentia.dk                                                 *
// *                                                                       *
// *                                                                       *
// * Copyright(C) Pentia, 1998 - 2008. All rights reserved (R).            *
// *                                                                       *
// *                                                                       *
// * LEGAL NOTICE: This is unpublished proprietary source code of Pentia.  *
// * The contents of this file are protected by copyright laws and         *
// * international copyright treaties, as well as other intellectual       *
// * property laws and treaties. These contents may not be extracted,      *
// * copied, modified or redistributed either as a whole or part thereof   *
// * in any form, and may not be used directly in, or to assist with, the  *
// * creation of derivative works of any nature without prior written      *
// * permission from Pentia. The above copyright notice does not           *
// * evidence any actual or intended publication of this file.             *
// *                                                                       *
// *************************************************************************

function initMenu() {
  $('#MainMenu .sub').hide();
  $('#MainMenu .sub:first').show();
  
  var firstSlideLink = $('#MainMenu .SlideSection:first');
  firstSlideLink.addClass('active');
  firstSlideLink.attr('value','-');
  
  $('#MainMenu .SlideSection').click(
    function () {
      $('#MainMenu .SlideSection').removeClass('active');
      $('#MainMenu .SlideSection').attr({ value: "+" });
      $(this).addClass('active');
      $(this).attr({ value: "-" });
      var checkElement = $(this).parent().parent().parent().siblings();
      if ((checkElement.is('.sub')) && (checkElement.is(':visible'))) { return false; }
      if ((checkElement.is('.sub')) && (!checkElement.is(':visible'))) {
        $('#MainMenu .sub:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
      }
    }
    );
  }
$(document).ready(function() {initMenu();});
