//global functions and items initialised on document load



//global functions
function initTableHighlights() {
	$(".highlight .row input:enabled, .highlight .row select:enabled, .highlight .row textarea:enabled").focus(function () {
		$(this).parents(".row").toggleClass("rowHighlight");
	});
	$(".highlight .row input:enabled, .highlight .row select:enabled, .highlight .row textarea:enabled").blur(function () {
		$(this).parents(".row").toggleClass("rowHighlight");
	});			
}

function initTabs() {
	$(".tabWrapper > ul").tabs();
}

function initErrorMsg() {
	$(".errorMsg").effect("highlight", {}, 1000);	
}

function initTextArea() {
	$("textarea").growfield();
	//noticed double posts and wiered extra characters
}

function initNews() {
	$('.news').cycle({
		fx:    'fade',
		timeout: 4000,
		pause: 1,
		sync: 0
	});	
}

function initButtons() {
	//this stops the page from posting back properly so leave it off. BE
	$(':submit').click(function() {
		$(".errorMsg").hide();
		$(this).attr("disabled", "true");
		//return false;
	});
}

//document load
$(document).ready(function() {
	initTableHighlights();
	initTabs();
	initErrorMsg();
	//initTextArea();
	initNews();
	//initButtons();
});
