jQuery(document).ready(function($) {
	$("#main-nav ul").lavaLamp({
 			fx: "backout",
			speed: 700,
			click: function(event, menuItem) {
			return true;
		}
	});
});

jQuery(document).ready(function($) {
	$("#searchbox").focus(function () {
		$(this).val("");
	}).blur(function() {
		if ($(this).val() == "") {
			$(this).val($(this)[0].defaultValue);
		}
	});
});

jQuery(document).ready(function($) {
	var zIndexNumber = 1000;
	$('li').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});

jQuery(document).ready(function($) {
	// Use this example, or...
	$('a[rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
});

jQuery(document).ready(function($) {

			var tabContainers = $('div.tabs > div');
			
			if ($('div.tabs #second .errorlist').length) {
				tabContainers.hide().filter(':last').show();
			} else {
				tabContainers.hide().filter(':first').show();
			}
	
	
			if ($('div.tabs #second .errorlist').length) {
				$('div.tabs ul.tabNavigation a').click(function () {
					tabContainers.hide();
					tabContainers.filter(this.hash).show();
					$('div.tabs ul.tabNavigation a').removeClass('selected');
					$(this).addClass('selected');
					return false;
				}).filter(':last').click();
				
			} else {
				$('div.tabs ul.tabNavigation a').click(function () {
					tabContainers.hide();
					tabContainers.filter(this.hash).show();
					$('div.tabs ul.tabNavigation a').removeClass('selected');
					$(this).addClass('selected');
					return false;
				}).filter(':first').click();
			
			}
		});
