	var fading = true;

	function XGF_INIT(){
		// enable fading effects if editor disabled
		try{
			if (tinyMCE.init){
				fading = false;
			}
		}catch(exc){
			fading = true;
		}

		// dropdown navi
		elements = $$("#dropdown li").each(function(element){
			element.addEvent("mouseover", function(){
				if (this.firstChild && this.firstChild.nextSibling && this.firstChild.nextSibling.nextSibling)
					this.firstChild.nextSibling.nextSibling.style.display="block";
			});
			element.addEvent("mouseout",  function(){
				if (this.firstChild && this.firstChild.nextSibling && this.firstChild.nextSibling.nextSibling)
					this.firstChild.nextSibling.nextSibling.style.display = "none";
			});		
		});	

		// pseudo elemente adden 
		$$('#dropdown ul').each(function(node){
			var newLI = new Element("li", {'styles': {'background': 'none'}}).injectInside(node);
			new Element("span").injectInside(newLI);
		});
		
		// section table hover
		$$('tr .sectiontableentry1').each(function(element){
			element.addEvent("mouseover", function(){
				this.style.backgroundColor = "#e0e0e0";
			});
			element.addEvent("mouseout", function(){
				this.style.backgroundColor = "#ffffff";
			});
		});
		$$('tr .sectiontableentry2').each(function(element){
			element.addEvent("mouseover", function(){
				this.style.backgroundColor = "#e0e0e0";
			});
			element.addEvent("mouseout", function(){
				this.style.backgroundColor = "#f0f0f0";
			});
		});




		$$("a").each(function(element){
			element.addEvent("click", function(){
						var overlayer = new Element('div', {'id': 'Overlayer'}).injectInside(document.body);
		
var fx = {overlay: overlayer.effect('opacity', {duration: 500}).hide()};
				//overlayer.setStyles({top: (window.getScrollTop() + (window.getHeight() / 15)), display: 'block'});
				//var myFx = new Fx.Style(overlayer, 'opacity').start(0,1);
				fx.overlay.start(0.8);
			});
		});

		


		// focus forms
		if (document.adminForm && document.adminForm.filter){
			document.adminForm.filter.focus();
		}
		if (document.forms[0] && document.forms[0].searchword){
			document.forms[0].searchword.focus();
		}

		
		// page change
		
				//this.top = window.getScrollTop() + (window.getHeight() / 15);
				//r.setStyles({top: this.top, display: ''});
				


		if (true){
			//initLinks();
			//new Effect.Fade(overlayer, {duration:0.5, to:0.0, afterFinishInternal: function(effect) {
			//	overlayer.style.display = "none";
			//}});
		}
	}


	function hideOverlayer(){
		$('Overlayer').hide();
	}

	function showLoadingProcess(){

	}
	
	function who(threadid){
		window.open("misc.php?action=whoposted&threadid=" + threadid + "&sid=$session[hash]", "moo", "toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300");
	}


	window.addEvent('load', XGF_INIT);
