$(function(){
	// Accordion
	$("#accordion").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;
	});
		//hover states on the static widgets
		$('#dialog_link, ul#icons li').hover(
			function() { $(this).addClass('ui-state-hover'); }, 
			function() { $(this).removeClass('ui-state-hover'); }
		);
	
	// Dialog			
	$(".dialogLink").click(function(){
	        $("#dialogBig_"+$(this).attr('id')).dialog({autoOpen: false, modal: true, width: 800});
	        $("#dialogBig_"+$(this).attr('id')).dialog("open");
	        $("#dialog_"+$(this).attr('id')).dialog({autoOpen: false, modal: true, width: 640});
	        $("#dialog_"+$(this).attr('id')).dialog("open");
	        $("#dialogSmall_"+$(this).attr('id')).dialog({autoOpen: false, modal: true, width: 300});
	        $("#dialogSmall_"+$(this).attr('id')).dialog("open");
	         return false;
	    });
	
	// Datepicker
	$('#datepicker').datepicker({
		inline: true,
		dateFormat: "dd-mm-yy",
	    firstDay: 1,
		showOn: "both", 
	    buttonImage: "/assets/img/calendar_small.gif", 
	    buttonImageOnly: true
	});
	
	// Slider
	$('#slider').slider({
		range: true,
		values: [17, 67]
	});
	
	// Progressbar
	$("#progressbar").progressbar({
		value: 20 
	});
		
    // Zebra tables
	$('table.zebra tr:nth-child(even)').addClass('odd');
	$('table.zebra td:nth-child(1)').addClass('first');	
	$('.zebra table tr:nth-child(even)').addClass('odd');
	$('.zebra table td:nth-child(1)').addClass('first');
		
});

