//IE6 Background Color
var ie6BGColor = '#cccccc';

var DHTMLSlides = {
	navmenu: function(){
		$$('.Menu').each( function(button, i) {
			if($defined($('Sub' + button.id))) {
				
				$('Sub' + button.id).parentNode.style.top = '35px';
				if(window.ie6){
					$('Sub' + button.id).parentNode.style.width = '200px';
				}
				var width 	   = -1;
				var widthRight = -1;
				
				for(c = 0;c < i; c++){
					if(c != i){
						width = width + $$('.Menu')[c].getChildren()[0].width;
					}
				}
				
				// Adjusts the alignment of the last top menu button for rightside position instead of leftside.
				if(button.id == 7){					
					$('Sub' + button.id).getParent().setStyle('right', widthRight + 'px');
				}else{
					$('Sub' + button.id).getParent().setStyle('left', width + 'px');
				}
				
				//Original Line - $('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.stop();
					myFx.slideIn();
				}
			
				$('Sub' + button.id).onmouseout = function(){
					myFx.stop();
					myFx.slideOut();
				}
				
				button.onmouseover = function(){
					myFx.stop();
					myFx.slideIn();	
				}
					
				button.onmouseout = function(){
					myFx.stop();
					myFx.slideOut();	
				}
			}
		});
	}
}
window.addEvent('domready',function() {
	DHTMLSlides.navmenu();
});