// Confirmation Jquery, boite de dialogue pour le module d'évaluation
$(document).ready(function () {
	$('#confirmDialog a.OK').click(function (e) {
		e.preventDefault();

		confirm(function () {

		});
	});
});

function confirm(callback) {
	$('#OK').modal({
		close:false,
		position: ["40%",],
		overlayId:'confirmModalOverlay',
		containerId:'confirmModalContainer', 
		onShow: function (dialog) {		
			// if the user clicks "yes"
			dialog.data.find('.yes').click(function () {			
				// call the callback
				$('#f').submit();
			    // close the dialog
				$.modal.close();
			});
		}
	});
}

// Confirmation Jquery, boite de dialogue pour le Comparateur de prix
function validateForm()
	{
    $(".formContainer input[type=text]").each(function(){
    var text = $(this).attr("value");
    	if (text == "")
        {	
        $('#Recherche').modal({
		close:false,
		position: ["40%",],
		overlayId:'confirmModalOverlay',
		containerId:'confirmModalContainer', 
		onShow: function (dialog) {
		// if the user clicks "yes"
		dialog.data.find('.yes').click(function () {
		// close the dialog
		$.modal.close();
			});
		}
	});
         } else {
			$('#search').submit();
				}
            });
	}
