$(".ibod-tabs").tabs();
$(".tabs").tabs({ fx: { height: 'toggle' } });
$(".hide-picker").click(function()
{
	$("#colour-picker").slideToggle('normal');
	return false;
});

$("#beta-slide").click(function()
{
	$(".ibod-tabs").slideToggle('normal');
	return false;
});

$(".ibod-search-form #ib-query").click(function() {
   $(".ibod-search-form").addClass('active');
});

$(".ibod-search-form #ib-query").blur(function() 
{
	$(".ibod-search-form").removeClass('active');	
});

$("p:last-child").addClass('last');

// $(".widgets").sortable({ items: '.widget', placeholder: "placeholder", connectWith: '.widgets', handle: 'h3' });
$(".flash").click(function()
{
	$(this).fadeOut('normal');
});
var accOpts = {
	autoHeight: false,
	collapsible: true,
	active: false
};
$("#px-main-accordion .accordion").accordion(accOpts);

var accOpts = {
	autoHeight: false,
	collapsible: true,
	active: 0
};
$("#px-main-accordion .accordion.single").accordion(accOpts);

// This function compliments of http://bassistance.de/2007/01/23/unobtrusive-clear-searchfield-on-focus/
$.fn.search = function() 
{
	return this.focus(function() 
	 {
		if( this.value == this.defaultValue ) 
		{
			this.value = "";
		}
	}).blur(function() 
	{
		if( !this.value.length ) 
		{
			this.value = this.defaultValue;
		}
	});
};

$(".close").click(function()
{
	$(this).parents(".widget").fadeOut("slow");
	return false;
});

$('#px-slider #slider').nivoSlider({
        effect: 'fade'
});

// Use this to clear any form inputs, just tag the form input with an id or class to clear multiples at once.
$(".grid_5 .input, #ib-query, .ibod .input").search();

$(".close-message").click(function(e)
{
	$('#success_message, #error_message').fadeOut('normal');
	return false;
});
