var profiles =
	{

		videos:
		{
			height:630,
			width:820,
			toolbar:0, // determines whether a toolbar (includes the forward and back buttons) is displayed {1 (YES) or 0 (NO)}.
			scrollbars:0, // determines whether scrollbars appear on the window {1 (YES) or 0 (NO)}.
			status:0, // whether a status line appears at the bottom of the window {1 (YES) or 0 (NO)}.
			resizable:1, // whether the window can be resized {1 (YES) or 0 (NO)}. Can also be overloaded using resizable.
			center:1, // should we center the window? {1 (YES) or 0 (NO)}. overrides top and left
			createnew:0, // should we create a new window for each occurance {1 (YES) or 0 (NO)}.
			location:0, // determines whether the address bar is displayed {1 (YES) or 0 (NO)}.
			menubar:0
		}

	};
	
// Adds a class focus to input text when focused
function focusfix(selector, className) {
$(selector).focus(function() {
$(this).addClass(className);
});
// Removes class when focus is lost
$(selector).blur(function() {
$(this).removeClass(className);
});
}



$(function(){
	// run the code in the markup!
	$('code.jquery').each(function() {
		eval($(this).text());
	});
	$("q").prepend("&ldquo;").append("&rdquo;");
	$("q q").prepend("&lsquo;").append("&rsquo;");
	// Add classes to input pseudotypes
	$("input[type='text'], input[type='password']").addClass("text");
	$("input[type='button'], input[type='submit'], input[type='checkbox'], input[type='image'], input[type='radio'], input[type='reset'], button").addClass("nontext");
	$("input[type='button'], input[type='submit'], input[type='reset'], button").addClass("button");
	// Focus on the first text input field in the first field on the page
    $("#content p input[type='text']:first").focus();
	// Add focus class to inputs
	focusfix("input.text", "focus");
	// Add stripe and hover classes
	$("table.striped tr:even").addClass("alt");
	$("table.striped tr, input").mouseover(function() {$(this).addClass("hover");}).mouseout(function() {$(this).removeClass("hover");});
	// Add scrollbars
	$('.scrollable').jScrollPane();
	// Pop-up windows for videos
	$('.popupwindow').popupwindow(profiles);
	// Add tabs for courseware
	var $tabs = $('#cw_tabs > ul').tabs({ fx: { opacity: 'toggle' } }); // first tab selected
	$('.select-tab1').click(function() { $tabs.tabs('select', 0); return false; });
	$('.select-tab2').click(function() { $tabs.tabs('select', 1); return false; });
	$('.select-tab3').click(function() { $tabs.tabs('select', 2); return false; });
	$('.select-tab4').click(function() { $tabs.tabs('select', 3); return false; });
	$('.select-tab5').click(function() { $tabs.tabs('select', 4); return false; });
	// Round corners
	$('#merchant_info, .corner').corner();
});
