/*
 * base.js
 * k. walters
 * ken@lostghost.com
 */

window.onload = init;

var confirm_external_message="You are now leaving Seacoast National Bank's Website. Seacoast National Bank has provided this link for your convenience, but does not endorse and is not responsible for the content, links, privacy policy, or security policy of this Website. If you do not wish to leave Seacoast National Bank's Website, please select 'cancel'.";

function init() {
	doLinkBehaviors();
}

function doLinkBehaviors() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].rel.match("externalaffiliate")) {
			attachLinkAction_externalaffiliate(links[i]);
		} else if (links[i].rel.match("externalfnb")) {
			attachLinkAction_externalfnb(links[i]);
		} else if (links[i].rel.match("externalresource")) {
			attachLinkAction_externalresource(links[i]);
		} else if (links[i].rel.match("pdf")) {
			attachLinkAction_pdf(links[i]);
		}
	}
}

function attachLinkAction_externalaffiliate(elem) {
	elem.onclick = function() {
		if (confirm(confirm_external_message)) {
			window.open(this.href);	
		}
		return false;
	}
}

function attachLinkAction_externalresource(elem) {
	elem.onclick = function() {
		window.open(this.href);
		return false;
	}
}

function attachLinkAction_externalfnb(elem) {
	elem.onclick = function() {
		window.open(this.href);
		return false;
	}
}

function attachLinkAction_pdf(elem) {
	elem.onclick = function() {
		window.open(this.href);
		return false;
	}
}

function jumpMenu(selObj){
	var valueArray = selObj.options[selObj.selectedIndex].value.split("--->");
	if (valueArray[0]=="external") {
		if (confirm(confirm_external_message)) {
			window.open(valueArray[valueArray.length-1]);
		}
	} else {
		window.location=valueArray[valueArray.length-1];
	}
	selObj.selectedIndex=0; 
}

//Name:TicToc
//Creation Date: 5/10/2001
//Last edited:  08/07/2002 - BA
//Description:  Gets the month, date and time, returns it in this format:
//Day of Week , Month Date, Year 
//Example:  Thur, June 14, 2001 
//@author Ben Arcisewski 
function ticToc(){  
   var day = new Array();
	day[0] = "Sunday";
	day[1] = "Monday";
	day[2] = "Tuesday";
	day[3] = "Wednesday";
	day[4] = "Thursday";
	day[5] = "Friday";
	day[6] = "Saturday";
	var mo = new Array();
	mo[0] = "January";
	mo[1] = "February";
	mo[2] = "March";
	mo[3] = "April";
	mo[4] = "May";
	mo[5] = "June";
	mo[6] = "July";
	mo[7] = "August";
	mo[8] = "September";
	mo[9] = "October";
	mo[10] = "November";
	mo[11] = "December";
	
	var now = new Date();
	var dom = now.getDate();
	var dow = now.getDay();
	var year = now.getFullYear();
	//var hours = now.getHours();
	//var ampm = "am"
	/*if( hours == 12 ){
				ampm = "pm";
	}
   	else if( hours > 12 && hours != 24)
   	{  hours = hours - 12;
      	   ampm= "pm";
   	}
       
	var minutes = now.getMinutes();
	if (minutes < 10){
		minutes = "" + "0" + minutes;
	}*/
	var month = now.getMonth(); 
	//var theEnd = ("" + day[dow] + ", " + mo[month] + " " + dom + ", " + year + " " + hours + ":" + minutes + ampm);
	var theEnd = ("" + day[dow] + ", " + mo[month] + " " + dom + ", " + year );
	
   return theEnd;
}



