/*
 * 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 212 2009-09-03 05:33:44Z emartin24 $
 *
 */


function confirm(message, callback) {
	$('#confirm').modal({
		closeHTML:"<a href='#' title='Close' class='modal-close'>X</a>",
		position: ["30%",],
		overlayId:'confirm-overlay',
		containerId:'confirm-container', 
		onShow: function (dialog) {
			$('.confirm_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();
			});
		}
	});
}

function alert_msg(message) {
		$('#confirm').modal({
		closeHTML:"<a href='#' title='Close' class='modal-close'>X</a>",
		position: ["20%",],
		overlayId:'confirm-overlay',
		containerId:'confirm-container', 
		onShow: function (dialog) {
			$('.non').css("display","none");
			$('.confirm_message', dialog.data[0]).append(message);

			// if the user clicks "yes"
			$('.yes', dialog.data[0]).click(function () {
				// close the dialog
				$.modal.close();
			});
		}
	});	
}

function popup(message) {
		$('#alert').modal({
		closeHTML:"<a href='#' title='Close' class='modal-close'>X</a>",
		position: ["15%",],
		overlayId:'alert-overlay',
		containerId:'alert-container', 
		onShow: function (dialog) {
			$('.no').css("display","none");
			$('.alert_message', dialog.data[0]).append(message);

			// if the user clicks "yes"
			$('.yes', dialog.data[0]).click(function () {
				// close the dialog
				$.modal.close();
			});
		}
	});	
}




