//Global Vars
	

//Init Function
	$(document).ready(function(){
		
		//Bindings
		bind_anchors();
		bind_filter();
		
	});

//Binding Functions
	function bind_anchors(){
		$('a.external, a[rel="external"]').attr('target', 'blank');
		$('a[href="#"]').bind('click', function(){
			return false;
		});
	}
	
	function bind_no_hash_tags(){
		$('a[href^="#"]').bind('click', function(){
			return false;
		});
	}
	
	function bind_filter(){
		$('div.filter').each(function(e){
			
			var filter = $(this);
			var value = filter.find('a.value');
			var unselected = filter.find('ul.unselected');
			var choices = unselected.find('a');
			var time = Math.round( (choices.length/3) * 30 ) + 100;
			
			filter
				.bind('mouseenter', function(){
					unselected.stop(true, true).slideDown(time);
				})
				.bind('mouseleave', function(){
					unselected.stop(true, true).slideUp(time-50);
				});
				
			choices
				.bind('click', function(){
					value.html( $(this).html() );
					value.attr('href', $(this).attr('href') );
					unselected.slideUp(time-50);
					if( typeof filter_callback == 'function') { //Make extendable with callback, but not required.
						filter_callback( filter );
					}
				});
			
		});
	}
