var MainMenu = function(data){
	this.data = data;
	var _this = this;
	jQuery(data.id).hover(
		function(){	_this.over(this);}, 
		function(){ _this.out(this);} 
	);
	jQuery(data.id+'>ul>li').hover(
		function(){	_this.overP(this);}, 
		function(){ _this.outP(this);} 
	);
}
MainMenu.prototype.data;
MainMenu.prototype.over = function(item){
	jQuery(item).children('a').children('span').css('color','#FFFFFF');
	jQuery(item).find('ul').each(function(n){
		jQuery(this).show();
	});
}
MainMenu.prototype.out = function(item){
	jQuery(item).children('a').children('span').css('color','');
	var _this = this;
	jQuery(item).find('ul').each(function(n){
		_this.isHide = true;
		_this.hide(this);	
	});
}
MainMenu.prototype.isHide;
MainMenu.prototype.hide=function(item){
	var _this = this;
	setTimeout(function(){
		if (_this.isHide) {
			jQuery(item).hide();
			_this.isHide = false;
		}
	}, 150);
};
MainMenu.prototype.overP = function(item){
	jQuery(item).children('a').children('span').css('color','#FFFFFF');
	var _this = this;
	setTimeout(function(){ _this.isHide = false; }, 75);
}
MainMenu.prototype.outP = function(item){
	jQuery(item).children('a').children('span').css('color','');
	this.isHide = true;	
	this.hide(jQuery(item).parent());
}
/*====================================================================*/
jQuery.noConflict();
jQuery(document).ready(function(){
	new MainMenu({id:'#mainMenu>li'});
});
