function controlInputs()
{
	if($('modeselect').getValue()=="actionshot")
	{
		$('team_id').disable();$('bib').disable();
	}
	else
	{
		$('team_id').enable();$('bib').enable();
	}	
}

Event.observe(window,'load',function(){	
	
	controlInputs();
	$('modeselect').observe('change',controlInputs);
	jQuery("select[name=year]").change(function(){jQuery('#teampic form').submit()})
	
	if($$('#teampicplane.actionshot').length>0)
	{
		$$('#teampicplane.actionshot')[0].setStyle({'height':'530px','overflow':'hidden'})
	}
	
	$$('.pic_tn.actionshot').each(function(e){
		e.setStyle({'backgroundImage':'url('+e.down('.src').innerHTML+')'});
		e.down('.src').remove();
	})

	//eScroll
	$$('a[rel=scroll]').each(function(el){
		el.observe('click',function(e){
			var scrollsize=528;
		
			var a=e.element().id.split('-');
			var se=$(a[0]);
			var top=parseInt(se.getStyle('top'));
			if(!top){top=0;}
			switch(a[1])
			{
				case 'scrolldown':				
					if(se.clientHeight-se.parentNode.clientHeight>Math.abs(top))
					{
						top=top-scrollsize;
						top=Math.round(top/scrollsize)*scrollsize
						se.morph('top:'+(top)+'px');
					}
				break;
				case 'scrollup':
					if(top<0)
					{
						top+=scrollsize;
						if(top>0){top=0;}
						top=Math.round(top/scrollsize)*scrollsize
						se.morph('top:'+top+'px');
					}
				break;
			}		
		});	
	});	

	
});

