$(function(){

	// Accordion
	$("#accordion").accordion({ 
		header: "h3", 
		autoHeight: false, 
		collapsible: true,
		navigation: true
		});
	
	// Accordion1
	$("#accordion1").accordion({ 
		header: "h4", 
		collapsible: true,
		alwaysOpen: false,
		autoHeight: false
		});


	// Tabs
	$('#tabs').tabs();
	$('#tabs1').tabs();
	$('#tabs2').tabs({ fx: { opacity: 'toggle' } });
	$('#tabs3').tabs( "option", "fx", { opacity: 'toggle' } );
	$( "#tabs4" ).tabs({ spinner: 'Loading...' });
	$("#tabs5").tabs({
			spinner: 'Loading...',
			cookie: {
				// store cookie for a day, without, it would be a session cookie
				expires: 30
			}
		});
	$('.tab_panel').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 'fast' } });



	// Dialog			
	$('#dialog').dialog({
		autoOpen: false,
		width: 600,
		buttons: {
			"Ok": function() { 
				$(this).dialog("close"); 
			}, 
			"Cancel": function() { 
				$(this).dialog("close"); 
			} 
		}
	});
	
	// Dialog Link
	$('#dialog_link').click(function(){
		$('#dialog').dialog('open');
		return false;
	});

	// Datepicker
	$('#datepicker').datepicker({
		inline: true
	});
	
	// Slider
	$('#slider').slider({
		range: true,
		values: [17, 67]
	});
	
	// Progressbar
	$("#progressbar").progressbar({
		value: 20 
	});
	
	//hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});

