$(function() {
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$("ul.tabs").tabs("div.panes > div");
});

$(function() {
	$("div.scrollable").scrollable({
		items: 'ul.tabs',
		clickable: false,
		size: 8,
	});
});

function moveNext() {  
	var api = $("div.scrollable").scrollable(); 
	api.move(2); 
} 

function movePrev() { 
	var api = $("div.scrollable").scrollable(); 
	api.move(-2); 
}

// Format Form Errors
$(document).ready(function() {
	
	$("div.text input").wrap("<div class='input-wrapper'></div>");
	$("div.password input").wrap("<div class='input-wrapper'></div>");
	$("div.textarea textarea").wrap("<div class='input-wrapper'></div>");
	
	$("input.form-error").parent().css( 'background-color', '#EC1D25' );
	$("input.form-error").css( 'border-color', '#EC1D25' );
	
	/*
	$.each( $("div.error-message") , function() {

		var msg = $(this);
		var input = msg.prev();
		var pos = input.offset();

		//input.addClass( "error" );
		msg.css( {
				"position" : "absolute", 
				"left": (pos.left+input.outerWidth()+20) + "px", 
				"top":(pos.top+6) + "px",
				"width" : "340px",
				"height" : "35px",
				"color" : "white",
				"padding" : "8px 10px",
				"text-align" : "center",
				"background-image" : "url('/img/tooltip.gif')",
				"background-repeat" : "no-repeat"
		} );
    });
    */

});