$(function(){
			  
/* ---------------------------------------------------------
        NOTE : Assumes that the global variables 
		  gTab and gSubTab and gLayout
		  are set to determine active menus and layout
   --------------------------------------------------------- */
 
/* ---------------------------------------------------------
        UTILITY FUNCTION SETS POPUPS
   --------------------------------------------------------- */
 			  
			  function setpopups() {//
							$('a.popup').click(function(){ 
												window.open(this.href, 
													'_blank',
													'menubar=yes,scrollbars=yes,resizable=yes,width=960,height=680');
												return false;
											});
									$('a.popupSmall').click(function(){ 
												window.open(this.href, 
															'_blank',
															'menubar=yes,scrollbars=yes,resizable=yes,width=600,height=280');
												return false;
											});
									$('a.popupVideo').click(function(){ 
												window.open(this.href, 
															'_blank',
															'menubar=yes,scrollbars=yes,resizable=yes,width=650,height=500');
												return false;
											});
				};

/* ---------------------------------------------------------
       DYNAMICALLY LOAD MODULE BAR - SET POPUPS ON COMPLETION
   --------------------------------------------------------- */
	
$('#modules').load('_modules.html', function(){ setpopups();} );

/* ---------------------------------------------------------
        DYNAMICALLY LOAD TAB AND SUBTAB MENUS - ADD ACTIVES ON COMPLETION
   --------------------------------------------------------- */
 
$('#tabwrapper').load('_tabmenu.html', function(){				
							$('li.tab.'+gTab).addClass('active');
							$('li.subtab.'+gSubTab).addClass('active');
					});

/* ---------------------------------------------------------
        SET BODY CLASS
   --------------------------------------------------------- */

$('body').addClass(gLayout);

});



