/*
 * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
 * 
 * Project: OpenSubsystems
 * 
 * $Id: loader.js,v 1.2 2007/01/07 06:14:52 bastafidli Exp $
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License. 
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 */

/*
 * Scripts used by the loading page, which displays nice animation while the
 * page is still loading
 *
 * @version $Id: loader.js,v 1.2 2007/01/07 06:14:52 bastafidli Exp $
 * @author Miro Halas
 * @code.reviewer Miro Halas
 * @code.reviewed Initial revision.
 */

/**
 * Hide the page loader and display the page content
 * 
 * @param strPageLoaderId - ID of the page loader element, e.g. pageLoader
 * @param strPageContentId - ID of the page content element, e.g. wholepage, 
 *                           if this is "none" then no content will be displayed
 */
function hidePageLoader(
   strPageLoaderId,
   strPageContentId
)
{
   if (strPageContentId != "none")
   {
	   var ePageLoader;
	   
	   ePageLoader = document.getElementById(strPageLoaderId);
	   if (ePageLoader != null)
	   {
	      ePageLoader.style.display = "none";
	   }
	   else
	   {
	      window.alert("Cannot find page loader element with id " + strPageLoaderId);
	   }   
	   
	   var ePageContent;
	
	   ePageContent = document.getElementById(strPageContentId);
	   if (ePageContent != null)
	   {
	      // This has to be block otherwise it didn't work for some reason
	      ePageContent.style.display = "block";
	   }
	   else 
	   {
	      window.alert("Cannot find page content element with id " + strPageContentId);
	   }   
   }
}

