/*
 * 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 $
 *
 */
 
 var $j = jQuery.noConflict();


$j(document).ready(function (e) {
	
		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("", function () {
			window.location.href = 'http://www.google.com.br/';
		});
});

function confirm(message, callback) {
	 var $jj = jQuery.noConflict();
	$jj('#confirm').modal({
		closeHTML:"<a href='#' title='Acessar a página' class='modal-close'><img src='imagens/btnEntrada.png' alt='Entrar' border='0' /></a>",
		position: ["0",],
		overlayId:'confirm-overlay',
		containerId:'confirm-container', 
		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();
			});
		}
	});
}
