/*
var MainMenu = Class.create({
  initialize: function(container) {
  	this.container = container ? container : 'menuContainer';
    this.objects = $$('#' + this.container + ' div.topmenu a img');
    this.objects.each(function(item) {
    	new MainMenuItem(item);
    }); 
    
    $(this.container).show();
  }
});
  
var MainMenuItem = Class.create({
  initialize: function(obj) {
  	this.obj = obj;
  	
  	new Effect.Opacity(this.obj.readAttribute('id'), { to: 0.0, duration: 0.0 });
  	
  	this.obj.observe('mouseover', this.showme.bindAsEventListener(this));
  	this.obj.observe('mouseout', this.hideme.bindAsEventListener(this));
  },
  
  showme: function() {
    new Effect.Opacity(this.obj.readAttribute('id'), { to: 1.0, duration: 0.4 });
  },
  
  hideme: function() {
    new Effect.Opacity(this.obj.readAttribute('id'), { to: 0.01, duration: 0.2 });
  }
});

var MainMenuObj;
function initMainMenu() {
	MainMenuObj = new MainMenu();
}
*/

function fadeEfectClass(b) {
	
	this.changeOpac = changeOpac;
	this.fadeIn = fadeIn;
	this.fadeOut = fadeOut;
	
	var b = b;
	var opcaityTimer1;
	var opcaityTimer2;
	var opacityN = 1;
	
	function changeOpac(opacity, id) {
	    var object = document.getElementById(id).style;
	 try {   object.opacity = (opacity / 100); } catch (e) { }
	 try {   object.MozOpacity = (opacity / 100);} catch (e) { }
	 try {   object.KhtmlOpacity = (opacity / 100);} catch (e) { }
	 try {   object.filter = "alpha(opacity=" + opacity + ")";} catch (e) { }
	}
	
	
	function fadeIn(id) { 
		if(opacityN < 100) { 
			clearTimeout(opcaityTimer2);
			opacityN = opacityN+5;
			changeOpac(opacityN, id);
			opcaityTimer1 = setTimeout(b+'.fadeIn(\''+id+'\')', 15);
		}
	}
	
	function fadeOut(id) { 
		if(opacityN > 5) {
			clearTimeout(opcaityTimer1);
			opacityN = opacityN-5;
			changeOpac(opacityN, id);
			opcaityTimer2 = setTimeout(b+'.fadeOut(\''+id+'\')', 15);
		}
	}
}

b1 = new fadeEfectClass('b1');
b2 = new fadeEfectClass('b2');
b3 = new fadeEfectClass('b3');
b4 = new fadeEfectClass('b4');
b5 = new fadeEfectClass('b5');
b6 = new fadeEfectClass('b6');
b7 = new fadeEfectClass('b7');
b8 = new fadeEfectClass('b8');
