   //<![CDATA[         
        function ShowMnu(ClickedID)
        { 	  		    
		    document.getElementById(ClickedID).className += (document.getElementById(ClickedID).className?' ':'') + 'CSStoShow'; 
        } 
        function HideMnu(ClickedID)
        {           
		    document.getElementById(ClickedID).className = document.getElementById(ClickedID).className.replace(/ ?CSStoShow$/,''); 
        }
	//]]>
	
	//<![CDATA[  	
		//handles how menu items pass sessionstate information
		function CheckDrag(Control)    
		{			
			//===============================================
			try
			{				
				if (Ultranet2.Default.isDragEnabled()== true)
                {                       
					document.getElementById("DIV_" + Control).className="SnapHeader";
					document.getElementById("MINIMIZE_"+ Control).className="SnapHeader";					
					document.getElementById("TABLE_" + Control).className="SnapHeader";
					document.getElementById("ICON_" + Control).className="SnapHeader";
					document.getElementById("TITLE_" + Control).className="SnapHeader";
				} 
				else
				{
					document.getElementById("DIV_" + Control).className="SnapHeaderHidden";
					document.getElementById("MINIMIZE_"+ Control).className="SnapHeaderHidden";					
					document.getElementById("TABLE_" + Control).className="SnapHeaderHidden";
					document.getElementById("ICON_" + Control).className="SnapHeaderHidden";
					document.getElementById("TITLE_" + Control).className="SnapHeaderHidden";
				} 		
			}
			catch (error) {
				alert(error + "CheckDragState(Control)");
			}							 
		}
	//]]>
	//<![CDATA[       
        // handles collapsing and uncollapsing the dropdown controls
        function DockEvent(args , SnapObject)
        {            
			try
			{
				  //===============================================
				  if(SnapObject == "ControlStore"){
					   args.Collapse(); 
				  }
				  //===============================================
				  if(SnapObject != "ControlStore"){      
					  args.Expand();  
				  } 
				  //=============================================== 
			}
			catch (error) {
				//alert(error + "function DockEvent(args,SnapObject )");
			}
        }                           
    //]]>
    	
	//<![CDATA[  	
		//handles how menu items pass sessionstate information
		function DoLoginProcess(err)    
		{			
			PopUpWLoginWindow("/Security/aspxLogin.aspx", 260, 675, "LoginPage","");							 
		}
	//]]>
				
	//<![CDATA[ 	
		function Search(){
			PopUpWindowFromWindow("/Modules/Search/Search.aspx",515,700	,  "CurrentPage","Search");
		}		
	//]]>
	
	//<![CDATA[ 	
		function Bookings(){
			PopUpWindowFromWindow("/Modules/Booking System/Normal/Bookings.aspx", 435, 730,  "CurrentPage","Search");
		}
		function Notices(){
		    PopUpWindowFromWindow("/Modules/Annoucements/ViewAnnouncements.aspx", 555, 648, "CurrentPage","Notices");
		}		
	//]]>
	
	//<![CDATA[		
				
		function ShaderSize(){
		        
		        try{
		            var objWindowShader = parent.document.getElementById("Gray_Out_Controls"); 
		            objWindowShader.style.width= document.body.scrollWidth+ "px";
                    objWindowShader.style.height= document.body.scrollHeight+ "px"; 
                }
                catch(error)
                {
                }
		}
		
		function PopUpWindowFromWindow(PageToLoad, Height, Width, ParentWindow,Title)    
		{			
			//===============================================
			try
			{													
				//Open a new window, with no url set
				/*
				var oWindow = radopen(PageToLoad, ParentWindow); 					
				oWindow.SetSize(Width, Height);	 
				oWindow.SetTitle(Title);					 				 
				if (navigator.userAgent.indexOf("Firefox")==-1){
					oWindow.SetModal(true);
				}			 
				oWindow.SetStatus("");
				*/							

                var fWindow=dhtmlwindow.open("UltranetPopupWindow", "iframe", PageToLoad, Title, "width="+Width+"px,height="+Height+"px,resize=1,scrolling=1,center=1", "recal" ,true)
                var objWindowShader = parent.document.getElementById("Gray_Out_Controls");     
                objWindowShader.style.display="block";                
                objWindowShader.style.width= Math.max(document.body.scrollWidth,800) + "px";
                objWindowShader.style.height= Math.max(document.body.scrollHeight,600)+ "px";
                                                        
                fWindow.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
                    var objWindowShader = parent.document.getElementById("Gray_Out_Controls");             
                    objWindowShader.style.display="none"        
                    parent.document.forms[0].submit(); 
                }			
			}
			catch (error) {
				//alert(error.message + "Please reload your browser by refreshing the current page");
			}							 
		}
		//===============================================
		function PopUpWLoginWindow(PageToLoad, Height, Width, ParentWindow,Title)    
		{			
			//===============================================
			try
			{																			
                var objWindowShader = parent.document.getElementById("Gray_Out_Controls");     
                objWindowShader.style.display="block";                
                objWindowShader.style.width= Math.max(document.body.scrollWidth,800) + "px";
                objWindowShader.style.height= Math.max(document.body.scrollHeight,600)+ "px";
                
                var fWindow=dhtmlwindow.open("UltranetLoginPopupWindow", "iframe", PageToLoad, Title, "width="+Width+"px,height="+Height+"px,resize=0,scrolling=0,center=1", "recal" ,false )
                                                
                fWindow.onclose=function(){ //Run custom code when window is being closed (return false to cancel action):
                    var objWindowShader = parent.document.getElementById("Gray_Out_Controls");             
                    objWindowShader.style.display="none"        
                    parent.document.forms[0].submit(); 
                }			
			}
			catch (error) {
				//alert(error.message + "Please reload your browser by refreshing the current page");
			}							 
		}
		//===============================================
		function PopUpWindow(PageToLoad, Height, Width, ParentWindow,Title)    
		{			
			PopUpWindowFromWindow(PageToLoad, Height, Width, "CurrentPage",Title)    		 
		}
		//===============================================
		function OnClientClose(radWindow)
        {
           __doPostBack('','');
        }		
		//===============================================
	//]]>
		
	//<![CDATA[  		
		//handles toolbar menu clicks
		function OnEditToolbarHandler(sender, eventArgs)    
		{
			try{
				Ultranet2.Default.EditOnClick(sender.CommandName);
			}catch(error){
				//alert(error + "OnEditToolbarHandler(sender, eventArgs)");
			}
		}
	//]]>
	
	//<![CDATA[  	
		//handles how menu items pass sessionstate information
		function CheckDrag(Control)    
		{			
			//===============================================
			try
			{				
				if (Ultranet2.Default.isDragEnabled()== true)
                {                       
					document.getElementById("DIV_" + Control).className="SnapHeader";
					document.getElementById("MINIMIZE_"+ Control).className="SnapHeader";					
					document.getElementById("TABLE_" + Control).className="SnapHeader";
					document.getElementById("ICON_" + Control).className="SnapHeader";
					document.getElementById("TITLE_" + Control).className="SnapHeader";
				} 
				else
				{
					document.getElementById("DIV_" + Control).className="SnapHeaderHidden";
					document.getElementById("MINIMIZE_"+ Control).className="SnapHeaderHidden";					
					document.getElementById("TABLE_" + Control).className="SnapHeaderHidden";
					document.getElementById("ICON_" + Control).className="SnapHeaderHidden";
					document.getElementById("TITLE_" + Control).className="SnapHeaderHidden";
				} 		
			}
			catch (error) {
				//alert(error + "CheckDragState(Control)");
			}							 
		}
	//]]>
	
	//<![CDATA[  						
			function Logout()
			{
				try
				{
					Edtech.Ultranet2.Default.Logout(callback_Reload);									
				}
				catch (error) {
					alert("Please refresh the current page by pressing F5 (Internet explorer)\n or pressing refresh button on your browser.");
				}			
			}	
			function NavagateToPage(i)
			{
				try
				{
					Edtech.Ultranet2.Default.ViewPage(i,callback_Reload);									
				}
				catch (error) {
					alert("Please refresh the current page by pressing F5 (Internet explorer)\n or pressing refresh button on your browser.");
				}							
			}				
			function NavagateToProfile(){
				try
				{
					Edtech.Ultranet2.Default.ViewProfile(callback_Reload);									
				}
				catch (error) {
					alert("Please refresh the current page by pressing F5 (Internet explorer)\n or pressing refresh button on your browser.");
				}	
			}	
			function callback_Reload(response) 
			{
				try
				{															
					__doPostBack('','');					
				}
				catch (error) {
					alert(error + "callback_GetPage_function(response)");
				}			 
			}
			function DoRestPassword(sender, e){
				if(confirm("Reset password for the selected user account.")== false){																					
					return false;
				}
			}	
			function DoDeleteUser(sender, e){
				if(confirm("Delete seletced user account.")== false){																
					return false;
				}
			}	
			function DoUnlockUser(sender, e){
				if(confirm("Unlock selected user account.")== false){																
					return false;
				}
			}										
	//]]>
	
	//<![CDATA[  
									 
				
			function callback_Edit(response) 
			{
				try
				{						
					PopUpWindowFromWindow("/Framework/Pages/aspxLoadDragAndDrop.aspx", 600, 800, "CurrentPage","Modify Layout");								 									
				}
				catch (error) {
					alert(error + "callback_GetPage_function(response)");
				}			 
			}	
			function callback_Menu(response) 
			{
				try
				{										
					__doPostBack('','');									
				}
				catch (error) {
					alert(error + "callback_GetPage_function(response)");
				}			 
			}
			function o(id){
				document.getElementById(id).style.display = "block";
			}																
//]]>

//<![CDATA[ 
			function PrintPreview() 
			{
				try{
					day = new Date();
					id = day.getTime();
					eval("page" + id + " = window.open('/Framework/Pages/aspxPrintPreview.aspx', 'Ultranet_Print_View', '');");
				}
				catch (error) {
					alert("Browser you are using does not support Ultranet Print Preview. Use print oprtion from your web browser to print.");
				}	
	        }
//]]>