/*
 * 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 254 2010-07-23 05:14:44Z emartin24 $
 */

jQuery(function ($) {
	$('#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("Your opening a webpage NOT associated with MetroBank.<br/> Do you want to continue?", function () {
			window.open( 'http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Metro+Bank,+Douglasville,+GA&sll=33.849818,-84.438272&sspn=2.06881,4.059448&gl=us&g=Metro+Atlanta,+GA&ie=UTF8&hq=Metro+Bank,&hnear=Douglasville,+Douglas,+Georgia&ll=33.723412,-84.769564&spn=0.062964,0.126858&z=14&iwloc=A','_blank');
		});
	});
});

jQuery(function ($) {
	$('#confirm-dialog2 a.confirm2').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Your opening a webpage NOT associated with MetroBank.<br/> Do you want to continue?", function () {
			window.open( 'http://maps.google.com/maps?q=2454+Kennesaw+Due+West+Road,+Kennesaw,+GA+30144&hl=en&sll=34.007948,-84.61957&sspn=0.008351,0.015965&vpsrc=0&gl=us&hnear=2454+Kennesaw+Due+West+Rd,+Kennesaw,+Georgia+30152&t=m&z=17&iwloc=A','_blank');
		});
	});
});

jQuery(function ($) {
	$('#confirm-dialog2 a.confirm-production-office').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Your opening a webpage NOT associated with MetroBank.<br/> Do you want to continue?", function () {
			window.open( 'http://maps.google.com/maps?q=1606+Maple+Street+Carrollton,+GA+30116&hl=en&sll=34.007948,-84.61957&sspn=0.008351,0.015965&vpsrc=0&gl=us&hnear=1606+Maple+St,+Carrollton,+Georgia+30117&t=m&z=17','_blank');
		});
	});
});


//HomePage confirm//

jQuery(function ($) {
	$('#confirm-dialog3 a.confirm3').click(function (e) {
		e.preventDefault();

		// example of calling the confirm function
		// you must use a callback function to perform the "yes" action
		confirm("Your opening a webpage NOT associated with MetroBank.<br/> Do you want to continue?", function () {
			window.open( 'http://www.fdic.gov/','_blank');
		});
	});
});

//HomePage confirm//

function confirm(message, callback) {
	$('#confirm').modal({
		closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
		position: ["20%",],
		overlayId: 'confirm-overlay',
		containerId: 'confirm-container', 
		onShow: function (dialog) {
			var modal = this;

			$('.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(); // or $.modal.close();
			});
		}
	});
}
