lmact=5;
window.addEvent('domready',function(){
	_n=110,
	_s =92,
	_f=200;
	var e=$$("#menu .item");
	var fx=new Fx.Elements(e,{
		wait:false,
		duration:300,
		transition: Fx.Transitions.Expo.easeOut
	});
	if(_act<=lmact){
		e[_act].setStyle("width",_f);
		e.each(function(other,j){
			if(_act!=j){
				var w=other.getStyle("width").toInt();
				if(w!=_s) e[j].setStyle("width",_s);
			}
		});
	}
	e.each(function(k,i){
		k.addEvent("mouseenter",function(event){
			var o={};
			o[i]={width:[k.getStyle("width").toInt(),_f]}
			e.each(function(other,j){
				if(i!=j){
					var w=other.getStyle("width").toInt();
					if(w!=_s) o[j]={width:[w,_s]};
				}
			});
			fx.start(o);
		});
	});
	$("menu").addEvent("mouseleave",function(event){
		var o={};
		try{ 
			o[_act]={width:[e[_act].getStyle("width").toInt(),_f]}; 
			e.each(function(other,j){
				if(_act!=j){
					var w=other.getStyle("width").toInt();
					if(w!=_s) o[j]={width:[w,_s]};
				}
			});
			fx.start(o);
		}catch(e){
			
		}
	})
	$$(".apagado").each(function(e){
		e.setStyle('opacity',0.2);
	});
	$("vai-webmail").addEvent("click",function(e){
		$('userid').value=$('userid').value;
		$('webmail').action='http://pop.mmhinformacao.com.br/cgi-bin/webmail/webmail.pl';
		$('webmail').target='_blank';
		$('webmail').submit();
		$('userid').value='';
		$('password').value='';
	});
	$("vai-newsletter").addEvent("click",function(e){
		if(_validator._onSubmit(e)==true){
			$("newsletter").submit();
		}else{
			alert('Por favor, digite o e-mail corretamente.');
		}
	});
	if(_act==1){
		$("moodle").hover(0.7);
	}else if(_act==2|| _act==3){
		$('q').searchbox("Pesquisar");
		$('vai-pesquisa').hover();
	}
	$('vai-webmail').hover();
	$('vai-newsletter').hover();
	
	
	
	doBlank();
	
	$$('.item-midiateca').each(function(elm){
		elm.highlight('#ffffff','#ffffaa');
		elm.addEvent('mouseenter',function(event){
			var event=new Event(event);
			setBox(this,false,event);
		}.bindWithEvent(elm));
		elm.addEvent('mouseleave',function(event){
			try{ $('tt').remove(); }catch(e){}
		}.bindWithEvent(elm));
	});
	
	$$('.hover').each(function(i){
		i.hover();
	});
	
	
	
});

window.addEvent('load',function(){
	$$(".link").each(function(e){
		e.addEvent('mouseenter',function(){
			new Fx.Style(this,'color',{duration:200,wait:false}).start(e.getStyle('color'),'#bbccff');	   
		});
		e.addEvent('mouseleave',function(){
			new Fx.Style(this,'color',{duration:200,wait:false}).start(e.getStyle('color'),'#0033cc');	   
		});
	});
});

function enterMail(e){
	var n=e.which ? e.which : e.keyCode;
	if(n==13){
		$('userid').value=$('userid').value;
		$('webmail').action='http://pop.mmhinformacao.com.br/cgi-bin/webmail/webmail.pl';
		$('webmail').target='_blank';
		$('webmail').submit();
		$('userid').value='';
		$('password').value='';	
	}
}