$(document).ready(function(){
	
//	var $dd = $('dd.wpp_stat_dd_view_more');
//	var ddhref = $dd.text();
//	$dd.replaceWith('<dd class="wpp_stat_dd_view_more"><h2><a class="ext" target="_blank" href="'+ddhref+'">Click Here for More Info &raquo;</a></h2></dd>');
	
	
	$('.ext-no-no').click(function(ev){
		ev.preventDefault();
		var $self=$(this);
		var elem = $(this).closest('a.ext-no-no');
		var exturl = $self.attr('href');
		
		window.open(exturl);
		
		$.confirm(function() {
  			return false;
		});
		
	});
	
	$('.ext-no').click(function(ev){
		ev.preventDefault();
		var $self=$(this);
		var elem = $(this).closest('a.ext');
		var exturl = $self.attr('href');
		
		$.confirm({
			'title'		: 'Terms and Conditions',
			'message'	: 'You must accept the terms and conditions before continuing. <a target="_blank" href="https://web1.secureinternetbank.com/pbi_pbi1961/webb/ct054T/disclosure.html">Click here to review the terms and conditions.</a>',
			'buttons'	: {
				'Accept'	: {
					'class'	: 'blue',
					'action': function(){
						window.open(exturl);
					}
				},
				'Decline'	: {
					'class'	: 'gray',
					'action': function(){}	// Nothing to do in this case. You can as well omit the action property.
				}
			}
		});
		
	});
	
	$('.ext').click(function(ev){
		ev.preventDefault();
		var $self=$(this);
		var elem = $(this).closest('.ext');
		var exturl = $self.attr('href');
		
		$.confirm({
			'title'		: 'Third Party Disclaimer!',
			'message'	: 'You are being redirected to a third party website. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Severn Savings Bank, FSB. We encourage you to read and evaulate the privacy and securities policies of the site you are entering.',
			'buttons'	: {
				'Continue'	: {
					'class'	: 'blue',
					'action': function(){
						window.open(exturl);
					}
				},
				'Close'	: {
					'class'	: 'gray',
					'action': function(){}	// Nothing to do in this case. You can as well omit the action property.
				}
			}
		});
		
	});
	
	$('.extform').click(function(ev){
		ev.preventDefault();
		var elem = $(this).closest('.ext');
		
		$.confirm({
			'title'		: 'Third Party Disclaimer!',
			'message'	: 'You are being redirected to a third party website. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Severn Savings Bank, FSB. We encourage you to read and evaulate the privacy and securities policies of the site you are entering.',
			'buttons'	: {
				'Continue'	: {
					'class'	: 'blue',
					'action': function(){
						$('#atmform').submit();
					}
				},
				'Close'	: {
					'class'	: 'gray',
					'action': function(){}	// Nothing to do in this case. You can as well omit the action property.
				}
			}
		});
		
	});
	
	
});
