/*
 * SimpleModal Contact Form
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2007 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: contact.js 39 2007-10-26 20:46:32Z emartin24 $
 *
 */

var conditions_commande = {

	show: function (dialog) {

		$('.acceptBt .accepter').click(function (e) {
			e.preventDefault();
			if(!$('.acceptCheck').attr( 'checked'))
				alert('Vous devez accepter les conditions de commande.');
			else {
				$('#modalBody').fadeOut(10);
				$('.closeBt').fadeOut(10);
				$('#modalBody').html('Ajout au panier ...');
				$('#modalBody').fadeIn(400, function () {
						$.ajax({
							url: '/panier.html',
							data: $('.centre form').serialize(),
							dataType: 'html',
							complete: function (xhr) {
								$('.closeBt').attr('class', 'panierCloseBt modalClose');
								$('#modalBody').fadeOut(10, function () {
									$('#modalBody').html(xhr.responseText).fadeIn(600);
									$('.panierCloseBt').fadeIn(10);
									panier.show(dialog);
								});
							}
						});
				});
			}
		});
	}
};