/*
 * SimpleModal Confirm Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2009 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: confirm.js 185 2009-02-09 21:51:12Z emartin24 $
 *
 */
/**放到front.js中
$(document).ready(function () {
	confirm("欢迎您上网学习！请您马上注册并登陆，登陆后学分银行开始记录您的学分?", function () {
			window.location.href = 'register.jsp';
	//$('#confirmDialog input.confirm, #confirmDialog a.confirm').click(function (e) {
	//	e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
			
	//	});
	});
	
});
*/

function confirm(message, callback) {
	$('#confirm').modal({
		close:false,
		position: ["20%",],
		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();
			});
		}
	});

}

function confirm1(message, callback) {
	$('#confirm1').modal({
		close:false,
		position: ["20%",],
		overlayId:'confirmModalOverlay1',
		containerId:'confirmModalContainer1', 
		onShow: function (dialog) {
			dialog.data.find('.message_1').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();
			});
		}
	});

}