$(function(){

	// Accordion
	$("#acc_manage").accordion({ header: "h3" });
	$("#acc_create1").accordion({ header: "h3" });
	$("#acc_game").accordion({ header: "h3" });

	// Tabs
	$('#tabs').tabs();


	// 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'); }
	);
	


	$("#login-dialog").dialog({
		autoOpen: false,
		width: 500,
		modal: true,
		buttons: {
			'Create an account': function() {
				$(this).dialog('close');
			},
			Cancel: function() {
				$(this).dialog('close');
			}
		},
		close: function() {
			allFields.val('').removeClass('ui-state-error');
		}
	});

	$('#login-link').click(function() {
		$('#login-dialog').dialog('open');
		return false;
	});
	
	//Alain web site
	
	/*$('#dialog_cit1').dialog({
		autoOpen: false,
		show: 'scale',
		hide: 'scale',
		modal: true,
		width: 700,
		minHeight: 600,
		buttons: { 
			"Fermer": function() { 
				$(this).dialog("close");
			}
		},
		draggable: false
	});
	
	$('#open_dialog_cit1').click(function() {
		$('#dialog_cit1').dialog('open');
		return false;
	});*/
	
});
