



jQuery(document).ready(function(){
//subMenu = new menuNesting;
	$('ul.SubMenu').animate({ opacity: 0.8 });

	$('div.menu').hover(
		function(){
			if ($('ul',$(this)).css('opacity') == 0.8){
				$('ul',$(this)).animate({
				  height: 'toggle', opacity: 'show'
				}, "slow");
			}
		},
		function(){
  			$('ul',$(this)).animate({
				  height: 'toggle', opacity: 'hide'
				}, "slow");
		}
	);

	$('li.SubMenu').hover(
		function(){
			$(this).css('background-color','#969696')
			$(this).css('color','white')
			$('a',$(this)).css('color','white')
		},
		function(){
			$(this).css('background-color','white')
			$(this).css('color','#414141')
			$('a',$(this)).css('color','#414141')
		}
	);

//	subMenu.data = new Array("button1","button2","button3","button4","button5","button6")
//	subMenu.init(1);
});

/*
function menuNesting() {
	this.id			= null;
	this.data		= null;
	this.id			= null;
	this.timeOut 	= 1222;
	this.startTime	= 666;
	this.effect  	= 1;
	this.button 	= null;
	this.subMenu 	= null;
	this.blockSystem= false;
	this.on      	= false;
	this.stId		= null;

	this.off			= function(obj){
	                       	switch( this.effect){
		                 		case 1 	:	obj.slideUp('slow'); break;
		                 		case 2	:	obj.fadeTo('slow',0.7);
		                   		default	:	obj.hide('slow');
	                   		}

					}
	this.on 		= function(obj){
		                 	switch( this.effect){
		                 		case 1 	:	obj.slideDown('slow'); break;
		                 		case 2	:	obj.fadeTo('slow',0.7);
		                 		default	:	obj.show('slow');
	                   		}
					}

	this.thishide	= function(){
							this.off($("#"+this.data[this.id]+"-submenu")); //.slideUp(this.effect);
					};
	this.hideId		= function(id){
						this.off($("#"+this.data[id]+"-submenu"));//.slideUp('slow');
						if (this.id==id){
							this.id=null;
					}
				};
	this.show		= function(){
						this.on($("#"+this.data[this.id]+"-submenu"));//.slideDown('slow');
					};
	this.showId		= function(id){
						if (id==this.id){
							this.on($("#"+this.data[id]+"-submenu"));//slideDown('slow');
						}
					};
	this.over		= function(mover){
						var myself = this;
						if (this.id==null) {
								this.setId(this.getId(mover));
								this.show();
						}else{
							if ((this.data[this.id]==mover.id) || (this.data[this.id]+"-submenu"==mover.id)){
								window.clearTimeout(this.stId);
								return false;
							}else{
									this.outId(this.id);
									this.setId(this.getId(mover));
									var myselfId = this.id;
									setTimeout(
										function () {
											myself.showId(myselfId);
                    					}
									    ,this.startTime);
							}
						}
					};
	this.getId		= function(mover){
						var result = false;
						for (var item in this.data){
							if (this.data[item]!= null){
								if((this.data[item] == mover.id) || (this.data[item]+"-submenu"==mover.id)){
									result=item;
								}
							}
						}
						return result;
					};
	this.out		= function(mover){
						var myself = this;
						var myselfId =this.getId(mover);
						this.stId=setTimeout(
							function () {
											myself.hideId(myselfId);
                    					}
      						,this.timeOut);


					};
	this.outId		= function(id){
						var myself = this;
						this.stId=setTimeout(
												function () {
													myself.hideId(id);
		                    					}
		                    					,this.timeOut);
					};
	this.unSet		= function(){
						this.id = null;
					};
	this.setId		= function(id){
						this.id = id;
					};
	this.init		= function(effect){
						this.effect = effect
						var myself = this;
						this.name = name;
						for (zz in this.data){
							$("#"+this.data[zz]+"-submenu").hide();
							$("#"+this.data[zz]).hover(
											function () {
												myself.over(this);
											},
											function () {
												myself.out(this);
											});
							$("#"+this.data[zz]+"-submenu").hover(function () {
												myself.over(this);
											},function () {
												myself.out(this);
											});
						}
					}
}

*/
