$(document)
		.ready(
				function() {
					$("#dialog_video_presentation").dialog({
							bgiframe: true,
							height: 500,
							width: 830,
							modal: true		
					});
					$("#accordion").accordion();
					$('#boutton_etape2').click( function() {
						$('#tabs').data('disabled.tabs', [ 2, 3, 4 ]);
						$('#tabs').tabs("select", 1);
					});
					$('#boutton_etape3').click(
							function() {
								xajax_create_session('alacarte',
										document.form_alacarte.alacarte.value);
								$('#tabs').data('disabled.tabs', [ 3, 4 ]);
								$('#tabs').tabs("select", 2);
							});
					$('#boutton_etape4')
							.click(
									function() {
										if (document.form_code_reduction.code_reduction.value == "") {
											$('#tabs').data('disabled.tabs',
													[ 4 ]);
											$('#tabs').tabs("select", 3);
										} else {
											xajax_create_session(
													'code_reduction',
													document.form_code_reduction.code_reduction.value);
										}

									});

					$( function() {
						$("#tabs").tabs();
						$('#tabs').data('disabled.tabs', [ 1, 2, 3, 4 ]);
					});
					
					

					$('#finder')
							.finder(
									{
										title : 'Prestations',
										onInit : function(finderObj) {

											//debug('Finder initialised',arguments)

											$('.ui-finder-action-refresh')
													.click(
															function() {
																$(
																		'[name="refresh"]')
																		.click();
															});

											$('.ui-finder-action-open').click(
													function() {
														$('[name="select"]')
																.click();
													});

											$('.ui-finder-action-current')
													.click(
															function() {
																$(
																		'[name="getCurrent"]')
																		.click();
															});

											$('.ui-finder-action-destroy')
													.click(
															function() {
																$(
																		'[name="createFinder"]')
																		.click();
															});

										},
										onItemSelect : function(listItem,
												eventTarget, finderObject) {
											var anchor = $('a', listItem), href = anchor
													.attr('rel');

											// By returning false, the url
											// specified is not fetched
											// ie. Do not display new column if
											// selected item is not an image
											if (href.indexOf('.jpg') == -1) {
												return false;
											}

										},
										onFolderSelect : function(listItem,
												eventTarget, finderObject) {
											var anchor = $('a', listItem), href = anchor
													.attr('rel');

										},
										onItemOpen : function(listItem,
												newColumn, finderObject) {
											var anchor = $('a', listItem), href = anchor
													.attr('href');

										},
										onFolderOpen : function(listItem,
												newColumn, finderObject) {
											var anchor = $('a', listItem), href = anchor
													.attr('href');

										}

									});

				});