$(document).ready(function () {
	// Remove the word Go from forms with the arrow
	$(".go_button").each(function () {
		$(this).val("");
	});
	
	if ($("#header > form").length == 1) {
		// Pre-populate the username and passwords fields to be more "informative"
		$username = $("#header > form > input[name='username']");
		$password = $("#header > form > input[name='password']");
		
		if ($username.val().length == 0 || $username.val() == "username") {
			$username.val("username");
			$username.addClass("unused");
			$username.focus(function () {
				$(this).val("");
				$(this).removeClass("unused");
				$(this).unbind('focus');
			});
		}
		
		if ($password.val().length == 0) {
			$password.replaceWith('<input name="password" class="unused" type="text" size="16" maxlength="60" value="password">');
			$("#header > form > input[name='password']").focus(function () {
				$(this).replaceWith('<input name="password" type="password" size="16" maxlength="60" value="">');
				$("#header > form > input[name='password']").focus();
			});
		}
	}
	
	// Create a marquee effect in the header
	$("#header_marquee").text("Online Training Videos for Microsoft Excel, Microsoft Word, Microsoft PowerPoint, Microsoft Outlook, Microsoft Project, Microsoft Access, Adobe Dreamweaver, Adobe Photoshop, Adobe InDesign, Adobe Illustrator, Adobe Flash, Adobe ActionScript, Browsing the Web, Microsoft Windows Vista");
	$("#header_marquee").marquee("marquee");
	
	// Remove the dividing line image from the last item in the navigation menu
	$("#navigation > ul > li:last").css({
		"padding" : 0,
		"background" : 'none'
	});
				
	// Make sure half-width item pairs are same height
	$(".balance").each(function () {
		left_height = $(this).height();
		right_height = $(this).next().height();
		
		if (left_height > right_height) {
			$(this).next().height(left_height);
		}
		else if (left_height < right_height) {
			$(this).height(right_height);
		}
	});
	
	// Enable accordiaon for options in sidebar
	if ($("#sidebar #options h3").length > 1) {
		$("#sidebar #options").accordion();
	}
	
	// Make sure the document fills the full height of the window (if not already taller)
	// This has been disabled, replaced with a background image that matches the footer
	/*
	window_height = $(window).height();
	static_height = $("#header").outerHeight(true) + $("#navigation").outerHeight(true) + $("#footer").outerHeight(true);
	variable_height = $("#content").outerHeight(true);
	
	if (static_height + variable_height < window_height) {
		$("#content").height(window_height - static_height - (variable_height - $("#content").height()));
	}
	*/
});