/*
 * SimpleModal Confirm Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2008 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: confirm.js 132 2008-05-23 16:05:17Z emartin24 $
 *
 */

$(document).ready(function () {
	$('#confirmDialog input:eq(0)').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Do you want to accept invitation?", function () {
		document.frm.submit();
		});
	});
});
$(document).ready(function () {
	$('#confirmDialog2 input:eq(0)').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Do you want to reject invitation?", function () {
			document.frm.submit();
		});
	});
});


$(document).ready(function () {
	$('#confirmDialog4 input:eq(0)').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Do you want to block invitation?", function () {
			document.frm.submit();
		});
	});
});


$(document).ready(function () {
	$('#confirmDialog5 input:eq(0)').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Do you want to move message(s) to trash?", function () {
			document.form1.submit();
		});
	});
});

$(document).ready(function () {
	$('#confirmDialog6 input:eq(0)').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Are you want Delete selected mail?", function () {
			document.delform.submit();
		});
	});
});





$(document).ready(function () {
	$('#confirmDialog3 input:eq(0)').click(function (e) {


		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		//confirm("Do you want to join this group?", function () {

			document.frm.submit();

		//});
	});
});
function confirm(message, callback) {
	$('#confirm').modal({
		close:false, 
		overlayId:'confirmModalOverlay',
		containerId:'confirmModalContainer', 
		onShow: function (dialog) {
			dialog.data.find('.message').append(message);

			// if the user clicks "yes"
			dialog.data.find('.yes').click(function () {
				// call the callback
				if ($.isFunction(callback)) {
					callback.apply();
				}
				// close the dialog
				$.modal.close();
			});
		}
	});
}