$(document).ready(function() {
	//flyout menu
	$('ul.flyout li').hover(
	  function(){
	  	$(this).find('ul').css("display", "block");
	  }, function(
	  ){
	  	$(this).find('ul').css("display", "none");
	  }
	);
	$(".accordion").accordion({active: false, collapsible: true});
	
	//this block dims the testimonial in the main part of the page when fly-out menu is activated
	$('ul.flyout').hover(
	  function(){
	  	if (jQuery.support.opacity) {
			$('#homepage .testimonial .text').fadeTo('slow', 0.4);
		}else{
			$('#homepage .testimonial .text').css("color", "#bbb");
		}
	  }, function(
	  ){
	  	if (jQuery.support.opacity) {
			$('#homepage .testimonial .text').fadeTo('slow', 1.0);
		}else{
			$('#homepage .testimonial .text').css("color", "#eee");
		}
	  }
	);
 	
	//add "current" class to menu links to current page
	$("#leftmenu .top").find("a[href='"+window.location.pathname+"']").each(function(){
	    $(this).parent().addClass("current");
	})
	
	//clear out the "quick tracking" box and make font black
	$("#quick_track input").click(function(){
		if($(this).val().match('Shipment Number'))
		{
			$(this).val("");
			$(this).css("color", "#000");
		}
	})
	
	//stash username on login form submit
	$("#loginform").submit(function(){
		var username = $("#loginform input.username").val();
		$.cookie("moveitusername", username, { expires: 365 });
	})
	//populate same form
	$("#loginform input.username").val($.cookie("moveitusername"));
	
	$("#testimonials").cycle({fx: "scrollRight", speed: 1500, timeout: 12000});
	$("#bprlink").corner("round");	
});
	
