//IE6 Background Color
var ie6BGColor = '#15499f';

var DHTMLSlides = {
	navmenu: function(){
		$$('.Menu').each( function(button, i) {
			if($defined($('Sub' + button.id))) {
				
				$('Sub' + button.id).getParent().setStyle('top', 33);
				
				if(window.ie6){
					if(i != 5){
						$('Sub' + button.id).getParent().setStyle('width', 175);
					}else{
						$('Sub' + button.id).getParent().setStyle('width', 115);
					}
					$('Sub' + button.id).getElements('a').each(function(itm){
						itm.setStyle('background', ie6BGColor);
						itm.addEvent('mouseover', function(){
							itm.setStyles({'background': '#fff', 'color': ie6BGColor});
						});
						itm.addEvent('mouseout', function(){
							itm.setStyles({'background': ie6BGColor, 'color': '#fff'});
						});
					});
						
				}
				
				var width = -122;
				
				for(c = 0;c < i; c++){
					if(c != i){
						width = width + $$('.Menu')[c].getChildren()[0].width;
					}
				}
				
				$('Sub' + button.id).getParent().setStyle('left', width + 'px');
				
				var myFx = new Fx.Slide($('Sub' + button.id), {duration: 400}).hide();			
				$('Sub' + button.id).onmouseover = function(){
					myFx.cancel(); //Mootools 1.2
					//myFx.stop(); //Mootools 1.11
					myFx.slideIn();
				}
			
				$('Sub' + button.id).onmouseout = function(){
					myFx.cancel(); //Mootools 1.2
					//myFx.stop(); //Mootools 1.11
					myFx.slideOut();
				}
				
				button.onmouseover = function(){
					myFx.cancel(); //Mootools 1.2
					//myFx.stop(); //Mootools 1.11
					myFx.slideIn();	
				}
					
				button.onmouseout = function(){
					myFx.cancel(); //Mootools 1.2
					//myFx.stop(); //Mootools 1.11
					myFx.slideOut();	
				}
			}
		});
	}
}
window.addEvent('domready',function() {
	DHTMLSlides.navmenu();
});
