/*
 * SimpleModal Confirm Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2010 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: confirm.js 238 2010-03-11 05:56:57Z emartin24 $
 *
 */

jQuery(function ($) {
	$('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("This website is designed and intended solely for consenting adults - people who are at least 18 years old. All materials, picture and other communications accessible through the website are intended for display exclusively to consenting adults and may be offending to any person not wishing to be exposed to such material. Enter this website only if you accept each and every provision of the following agreement:<br><br>By accepting this Agreement and thereby entering this adult website, I hereby swear and affirm under oath, represent and warrant that the following statements are true:<br><br> I am at least 18 (21 in some areas) years old.<br>I am not visiting this website from the jurisdiction of any municipality, city, state, country, or other governmental entity where viewing adult content is prohibited by law. I understand the standards and laws of the community from whence I am visiting this adult website, and I have made every reasonable effort to determine whether viewing adult content is legal - I have determined that it is not illegal for me to visit this adult website.<br> I will not allow any person under 18 (21 in some areas) years old to view any adult content from this website. I will not allow any person who is under the jurisdiction of any municipality, city, state, country, or other governmental entity where viewing adult content is prohibited by law, view any adult content on or from this website.<br><br> By entering this website, I agree to release, discharge, and hold harmless the providers, owners and creators of this website from any and all liability which might arise from viewing or reading the adult content on this website.<br> Bookmarking or directly accessing any other page on this website and bypassing this Agreement shall constitute an implicit acceptance of this Agreement.<br>If I use these services in violation of this Agreement, I understand I may be in violation of local, state, federal, international or other laws and I therefore admit my full legal responsability.<br>I have read this agreement thoroughly and I hereby give my solemn agreement to its terms by clicking on the YES button.", function () {
			window.location.href = 'erotiques.php';
		});
	});
});

function confirm(message, callback) {
	$('#confirm').modal({
		closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
		position: ["20%",],
		overlayId: 'confirm-overlay',
		containerId: 'confirm-container-en', 
		onShow: function (dialog) {
			$('.message', dialog.data[0]).append(message);

			// if the user clicks "yes"
			$('.yes', dialog.data[0]).click(function () {
				// call the callback
				if ($.isFunction(callback)) {
					callback.apply();
				}
				// close the dialog
				$.modal.close();
			});
		}
	});
}
