﻿

$(document).ready(function () {
	//showWait();

	$('#subnav .open').click(function () {

		$("#subnav > li > ul:visible").slideUp();
		$(this).siblings('ul:not(:visible)').slideDown();
		return false;
	});

	//Expand the selected branch
	//$('#subnav .selected').parents('ul').css('display', 'block');


});


function showWait() { 

	try {
		
	
		  //Get the screen height and width  
         var maskHeight = $(document).height();  
       
         //Set height and width to mask to fill up the whole screen  
         $('#modal-bg').css({'height': maskHeight });
   
         //transition effect       
         $('#modal-bg').fadeTo("fast", 0.25);

         var id = '#modal-message-container';
         var startY = parseInt($(id).css('top'), 10);

         if (startY == 0) {
         	startY = 120;
         }
         var scrollY = $(this).scrollTop();

        //Set the popup window to center  
         $(id).css('top', startY + scrollY);  

         //transition effect  
         $(id).fadeIn(250);

         //return false;



	}
	catch (err) {
		// Ignore and carry on posting the form.
	}

	return true;
	

}
