﻿$(function() {
  // code to execute when the DOM is ready
  $(document).pngFix();
  $(".sub-menu").css('display','');
  $.extend({
    
     DNOL : {
         init : function(){
           $.DNOL.openMenu='';
           $.DNOL.open = false;

           $(".slidemenu").click(function(){

             // SET SLIDERMENU HEIGHT AND MAIN MENU HEIGHT ACCORDING TO BODY HEIGHT
             var pageHeight = $("body").height()-45; 
             $(".sm-content").css('min-height', pageHeight+'px');
             $(".menu_leftTop").css('min-height', pageHeight+'px');

             if( $.DNOL.openMenu == $(this).attr("rel") )$.DNOL.open = false;
             else $.DNOL.open=true;

             $.DNOL.closeMenu();
             if( $.DNOL.open ){
               $.DNOL.openMenu = $(this).attr("rel");
               $("#"+$(this).attr("rel")).animate({opacity: 0.95, marginLeft:'222px', width:'428px'},'fast'); 
             }
           });
           $(".closebttn").click(function(){
             $.DNOL.closeMenu();
           });
         },
         closeMenu: function(){
           $.DNOL.openMenu = '';
           $(".sub-menu").animate({marginLeft:'-206px'},'fast');
         }
      }


   });
   $.DNOL.init();
});   




