$(function() {
	$("#datepicker").datepicker();
});

$(function() {
	$("#tabs").tabs();
});

$(function() {

	function runEffect(){
		//get effect type from 
		var selectedEffect = $('#effectTypes').val();
		
		//most effect types need no options passed by default
		var options = {};
		//check if it's scale, transfer, or size - they need options explicitly set
		if(selectedEffect == 'scale'){  options = {percent: 0}; }
		else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; }
		
		//run the effect
		$("#effect").toggle(selectedEffect,options,500);
	};
		
	//set effect from select menu value
	$("#button").click(function() {
		runEffect();
		return false;
	});
		
});

$(document).ready(function(){


	var $tabs = $('#tabs').tabs(); // first tab selected

	$('#recherche-projet').click(function() { // bind click event to link
		$tabs.tabs('select', 1); // switch to third tab
		return false;
	});
	$('#new-projet').click(function() { // bind click event to link
		$tabs.tabs('select', 0); // switch to third tab
		return false;
	});
	
	$('#tabs').bind('tabsselect', function(event, ui) {

		// Objects available in the function context:
		//ui.tab     // anchor element of the selected (clicked) tab
		//ui.panel   // element, that contains the selected/clicked tab contents
		//ui.index   // zero-based index of the selected (clicked) tab
		//alert('test');
		//alert("Tab ui " + ui.tab +" Tab panel " + ui.panel +"Tab with index " + ui.index + " clicked!");
		//return false;
	});
	

	$('#tabs').tabs({
		select: function(event, ui) {
			alert("Tab with index " + ui.index + " clicked!");
			return true;
		}
	});

	
	
	$(document).ready(function () {
		$("#effect").toggle(false); 
	}); 

});
/*
$("#demo5").paginate({
		count 		: 10,
		start 		: 1,
		display     : 7,
		border					: false,
		text_color  			: '#79B5E3',
		background_color    	: 'none',	
		text_hover_color  		: '#2573AF',
		background_hover_color	: 'none', 
		images					: false,
		mouse					: 'press',
		onChange     			: function(page){
									$('._current','#paginationdemo').removeClass('_current').hide();
									$('#p'+page).addClass('_current').show();
								  }
	});
*/

