/***************************************************************
*  Copyright notice
*
*  (c) 2004 Pavlenko Zorik (zorik@zorik.net)
*  All rights reserved
*	you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script 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.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/



function gg() { // start class ga
	/*
	 * http://simonwillison.net/2004/May/26/addLoadEvent/
	 * The addLoadEvent function takes as an argument another function which should be executed
	 *  once the page has loaded. Unlike assigning directly to window.onload, the function adds
	 *  the event in such a way that any previously added onload functions will be executed first.
	 * */
	this.initWindow = function() {
		try {
			var oldonload = window.onload;
			if (typeof window.onload != 'function') {
				window.onload = function() {
					gg.init();
//					alert("onload1");
				}
			} else {
				window.onload = function() {
					if (oldonload) {
						oldonload();
					}
					gg.init();
				}
			}
		} catch(err) {
			this.errorAlert(err,"initWindow");
		}
	}
	this.errorAlert=function(err,where) {
		alert("error occured - "+err+" in "+where);
	}
	this.init=function() {
//		alert("onload1done");
		$(".nav_main_item").hover(function(){
			$(".sub_menu").css("display","none");
			$(this).next().css("display","block");
		},function(){

		});
		$(".sub_menu").hover(function(){

		},function(){
			$(this).css("display","none");
			$(".sub_menu").css("display","none");
		});
	}


} // end class ga

gg = new gg();
gg.initWindow();


