// Site Initialization

$(document).ready(function(){
						   
	// init jquery superfish menus
	$("#hd ul.sf-menu").supersubs({
		speed:		 'fast',
		minWidth:    15,   // minimum width of sub-menus in em units 
		maxWidth:    25,   // maximum width of sub-menus in em units 
		extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
						   // due to slight rounding differences and font-family 
	}).superfish();
					 // call supersubs first, then superfish, so that subs are 
					 // not display:none when measuring. Call before initialising 
					 // containing tabs for same reason. 


	// init search box hints
	var t = $('#hd .forms input[type=text]');
	if (t) {
		t.focus(function() {
			$(this).removeClass('hint');
		});
		t.blur(function() {
			var t = $(this);
			var v = $(this).attr('value');
			if (jQuery.trim(v) == '') {
				t.addClass('hint');
			}
		});
		t.addClass('hint');
	}


	// the reps false select box
	var p = $('#reps .pseudo-select');
	if (p) {
		var a = p.find('a');
		a.click(function(event) {
			var p = $(this).parents('.pseudo-select');
			var o = p.find('ul.options');
			
			p.toggleClass('show-options');
			if (p.hasClass('show-options')) {
				o.show();
			} else {
				o.hide();
			}
			
		});
	}
});

