var message			= "Please be advised that you are leaving First State Bank's website. This link is provided as a courtesy.  First State Bank does not endorse or control the content of third party websites.";

var alertMsg		= "You are now being re-directed to a First State Bank Partner.";

function warn() {
	return(alert(alertMsg));
}
function popup() {
	return(alert("Please be advised that all insurance products listed on First State Bank's website are provided by First State Insurance. This link is provided as a courtesy.  First State Bank does not sell or manage any insurance products."));
}
window.addEvent('domready', function() {


	var alertLinks 		= $$( "a.warn" );
	var confirmLinks 	= $$( "a.confirm" );
	var insuranceLinks = $$( "ul#primaryNav li.nthChild-3 a" );

	//alertLinks.each(function(element, i) {
		//element.addEvent('click', warn);
	//});
	
	alertLinks.each(function(element, i) {
		element.addEvent('click', function( event ){
    	event = new Event(event);
			if( confirm(alertMsg) ) {
				return true;
			} else {
				event.stop();
				return false;
			}

		});
	});

	confirmLinks.each(function(element, i) {
		element.addEvent('click', function( event ){
    	event = new Event(event);
			if( confirm(message) ) {
				return true;
			} else {
				event.stop();
				return false;
			}

		});
	});
 	
	insuranceLinks.each(function(element,i) {
		element.addEvent('click',popup);
	});
 
});
