/********************************/
/*	Helper Functions			*/
	
function selectDefault(value, selectbox){
	
	if($(selectbox)){
		
		var options = $(selectbox).options;
	
		for (var i = 0; i < $(selectbox).length; i++) 
		{
		
		    if ($(selectbox).options[i].value == value) 
			{
			
	         $(selectbox).options[i].selected = true;

	      	}

	   	}
	
	}
	
}

/********************************/
/*	Window Load					*/

window.onload = function(){
	
	/****************************/
	/*	Link Hovers				*/
	
	var list = $$('#dQuicksearch a');
	list.each(function(element) {
		
		var fx = new Fx.Morph(element, {duration:200, wait:false});

		element.addEvent('mouseenter', function(){
			//stop();
			fx.start({
				'color' : '#000000'
			});
		});

		element.addEvent('mouseleave', function(){
			//stop();
			fx.start({
				'color' : '#707070'
			});
		});

	});
	
	/****************************/
	/*	Menu Hovers				*/
	
	var list = $$('.aMenuItem .iDown, .aSearchButton .iDown, .aSignupButton .iDown');
	list.each(function(element) {
		
		var fx = new Fx.Morph(element, {duration:200, wait:false});

		element.addEvents({
			
			'mouseenter' : function(e){
				
				//stop();
				fx.start({
					'opacity' : '0'
				});
				
			},
			
			'mouseleave' : function(element){
				
				//stop();
				fx.start({
					'opacity' : '1'
				});
				
			}
			
		});

	});
	
	/****************************/
	/*	Dropdowns				*/
	
	var menu = new MenuMatic({});
	
	/****************************/
	/*	Top Scroller			*/

	var scroller = new Scroller();
	scroller.run();
	
}

var scroller;
var switchy;