/* Start externally added code here */

/* Start code here to Protect email addresses from harvesting robots */
function asemwlink(linktext,user,domain,subject,cssstyle) {
	var numSpaces = 0
		for (var i = 0; i < subject.length; i++) {
			if (subject.charAt(i) == " ") {
				numSpaces = numSpaces + 1;
				subject = subject.substring(0,i) + "," + subject.substring(i+1,subject.length);
			}
		}
	var subj_array = subject.split(",");
	subject=""
	for (var i = 0; i < numSpaces; i++) {subject = subject + subj_array[i] + "%20";}
	subject = subject + subj_array[i]
	document.write("<a onFocus='blur()' href=" + "mail" + "to:" + user + "@" + domain + "?Subject=" + subject + " class=" + cssstyle + ">" + linktext + "</a>");
}

function asem(actinact,user,domain,subject,cssstyle) {
	var numSpaces = 0
		for (var i = 0; i < subject.length; i++) {
			if (subject.charAt(i) == " ") {
				numSpaces = numSpaces + 1;
				subject = subject.substring(0,i) + "," + subject.substring(i+1,subject.length);
			}
		}
	var subj_array = subject.split(",");
	subject=""
	for (var i = 0; i < numSpaces; i++) {subject = subject + subj_array[i] + "%20";}
	subject = subject + subj_array[i]

	if(actinact) document.write("<a onFocus='blur()' href=" + "mail" + "to:" + user + "@" + domain + "?Subject=" + subject + " class=" + cssstyle + ">" + user + "@" + domain + "</a>")
	else document.write("<span class=" + cssstyle + ">" + user + "@" + domain + "</span>");
}
/* End code here to Protect email addresses from harvesting robots */

/* Start code to determine Day, Date and Time */
function tod() {
	var today   = new Date();
	var year    = today.getYear();
	var month   = today.getMonth();
	var date    = today.getDate();
	var day     = today.getDay();
	var time    = today.getTime();
	var hours   = today.getHours();
	var minutes = today.getMinutes();
	var seconds = today.getSeconds();

	if (hours == 12) {
	  var amorpm = "p.m.";
	  } else if (hours == 0 ) {
	  hours = 12;
	  var amorpm = "a.m.";
	  } else if (hours > 12 ) {
	  hours = hours - 12;
	  var amorpm = "p.m.";
	  } else {
	  var amorpm = "a.m.";
	}

	/* These two if statements add zeroes where needed to 'sanitize' the display */
	if (minutes < 10) minutes = "0" + minutes;
	if (seconds < 10) seconds = "0" + seconds;

	var arrMonths = new Array("Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec");
	var month = arrMonths[today.getMonth()];

	var arrDays   = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	var day = arrDays[today.getDay()];

	if (year < 2000) {
	  year = year + 1900
	}
	document.write(day + " - " + month + " " + date + ", " + year + " - " + hours + ":" + minutes + " " + amorpm);
}
/* End code to determine Day, Date and Time */

/* Begin Current Year Determination */
function currentYear(){
	var today = new Date();
	var year = today.getYear();
	if (year < 2000) { year = year + 1900 }
		document.write(year);
}
/* End Current Year Determination */


/* Pop Up a new window */
var win = null;
function popup(fileName,pageName,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=1'
win = window.open(fileName,pageName,settings)
if(win.window.focus){win.window.focus();}
}

/* End externally added code here */
