//
// Freepages header/footer scripts
//

document.write('<link rel="stylesheet" href="http://www.havnar.org/images/styles.css" type="text/css">');

function writeHeaderHO() {
	document.write('<link REL=SHORTCUT ICON HREF=http://www.havnar.org/favicon.ico>');
	document.write('</head><body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>');
	document.write('<BR><DIV align=center><div id=container><TABLE cellSpacing=0 cellPadding=0 width=770 border=0 background=http://www.havnar.org/images/pagebg1.jpg><TR><TD>');
	document.write('<DIV align=left id=completeme><table border="0" cellpadding="0" width="770"><tr><td valign="top" align="left"><a target="_blank" href="http://www.havnar.org/"><img src="http://www.havnar.org/images/typeheader.jpg" border="0" width="770" height="90" alt=""></a></td></tr></table></DIV>');
	document.write('<table cellpadding=0 cellspacing=0 border=0 width=100% id=infobar background=http://www.havnar.org/start/images/bg_medbrown.gif><tr valign=middle><td>');
	document.write('&nbsp;<font color=\"#FDFC64\" face=\"Monotype Corsiva\" size=\"3\"><b>Welcome to Our eWorld</b></font>');
	document.write('</td><td height=19 align=right class=infobar-txt nowrap>&nbsp;&nbsp;<span id=infobar-date>&nbsp;&nbsp; <span id=clock><script language=JavaScript>window.onload=goforit </script></span></span>&nbsp;&nbsp;</td></tr></table>');
	document.write('<table cellpadding=0 cellspacing=0 border=0 width=100%><tr valign=middle><td id=taskBarContainer>');
	document.write('<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td id=taskBarContainer><img src=http://www.havnar.org/start/images/spacer.gif width=10 height=1 border=0></td><td class=taskBar-item>');
	document.write('<table cellpadding=0 cellspacing=0 border=0 height=26><tr valign=top><td class=taskbar-taskicon><a target=_top href=http://www.havnar.org/ class=taskItem-link><img src=http://www.havnar.org/start/images/icon_hav.gif hspace=5 width=19 height=19 border=0 alt=Havnar Site></a></td>');
	document.write('<td class=taskbar-tasklabel valign=top nowrap><img src=http://www.havnar.org/start/images/spacer.gif width=1 height=4 border=0><a target=_top href=http://www.havnar.org/ class=taskItem-link><font size=-2>Havnar Site</font></a></td><td id=taskBarContainer><span class=taskItem-rmargin>&nbsp;&nbsp;</span></td></tr></table></td><td class=taskBar-item><table cellpadding=0 cellspacing=0 border=0 height=26><tr valign=top>');
	document.write('<td class=taskbar-taskicon><a target=_top href=http://www.seeley-society.net/ class=taskItem-link><img src=http://www.havnar.org/start/images/icon_sgs.gif hspace=5 width=19 height=19 border=0 alt=SGS Site></a></td><td class=taskbar-tasklabel valign=top nowrap><img src=http://www.havnar.org/start/images/spacer.gif width=1 height=4 border=0><a target=_top href=http://www.seeley-society.net/ class=taskItem-link><font size=-2>SGS Site</font></a></td>');
	document.write('<td id=taskBarContainer><span class=taskItem-rmargin>&nbsp;&nbsp;</span></td></tr></table></td><td class=taskBar-item><table cellpadding=0 cellspacing=0 border=0 height=26><tr valign=top>');
	document.write('<td class=taskbar-taskicon><a target=_top href=http://www.seeley-society.org/site/ class=taskItem-link><img src=http://www.havnar.org/start/images/icon_wp.gif hspace=5 width=19 height=19 border=0 alt=My Site></a></td><td class=taskbar-tasklabel valign=top nowrap><img src=http://www.havnar.org/start/images/spacer.gif width=1 height=4 border=0><a target=_top href=http://www.seeley-society.org/site/ class=taskItem-link><font size=-2>My Site</font></a></td>');
	document.write('<td id=taskBarContainer><span class=taskItem-rmargin>&nbsp;&nbsp;</span></td></tr></table></td><td class=taskBar-item><table cellpadding=0 cellspacing=0 border=0 height=26><tr valign=top>');
	document.write('<td class=taskbar-taskicon><a target=_top href=http://www.routerlogin.net class=taskItem-link><img src=http://www.havnar.org/start/images/taskbar_btn_messenger.gif hspace=5 width=19 height=19 border=0 alt=Messenger></a></td><td class=taskbar-tasklabel valign=top nowrap><img src=http://www.havnar.org/start/images/spacer.gif width=1 height=4 border=0><a target=_top href=http://www.routerlogin.net/ class=taskItem-link><font size=-2>Our Router</font></a></td>');
	document.write('<td id=taskBarContainer><span class=taskItem-rmargin>&nbsp;&nbsp;</span></td></tr></table></td><td class=taskBar-item><table cellpadding=0 cellspacing=0 border=0 height=26><tr valign=top>');
	document.write('<td class=taskbar-taskicon><a target=_top href=http://emac2/tsweb/ class=taskItem-link><img src=http://www.havnar.org/start/images/taskbar_btn_tsweb.gif hspace=5 width=19 height=19 border=0 alt=Terminal Server></a></td><td class=taskbar-tasklabel valign=top nowrap><img src=http://www.havnar.org/start/images/spacer.gif width=1 height=4 border=0><a target=_top href=http://emac2/ class=taskItem-link><font size=-2>Our Server</font></a></td>');
	document.write('<td id=taskBarContainer><span class=taskItem-rmargin>&nbsp;&nbsp;</span></td></tr></table></td><td class=taskBar-item><table cellpadding=0 cellspacing=0 border=0 height=26><tr valign=top>');
	document.write('<td class=taskbar-taskicon><a target=_top href=http://www.havnar.org/angry-info/ class=taskItem-link><img src=http://www.havnar.org/start/images/taskbar_btn_cup.gif hspace=5 width=19 height=19 border=0 alt=Angry Havnar></a></td><td class=taskbar-tasklabel valign=top nowrap><img src=http://www.havnar.org/start/images/spacer.gif width=1 height=4 border=0><a target=_top href=http://www.havnar.org/angry-info/ class=taskItem-link><font size=-2>Angry Havnar</font></a></td>');
	document.write('<td id=taskBarContainer><span class=taskItem-rmargin>&nbsp;&nbsp;</span></td></tr></table></td><td id=taskBarContainer width=100%><img src=http://www.havnar.org/start/images/spacer.gif width=16 height=1 border=0></td></tr></table></td></tr></table>');
	document.write('<DIV align=center><div id=containme><TABLE border=0 cellSpacing=0 cellPadding=0 width=770><TR><TD align=right valign=top width=140>');
	document.write('<TABLE border=0 cellSpacing=0 cellPadding=5 width=140><tr><td align=right valign=top>');
	document.write(" " +
	"<A title=\"Home Page\" href=\"http://www.havnar.org/\">Home</A><BR>" +
	"<A title=\"Squirrel WebMail\" href=\"http://www.havnar.org/webmail.html\">We Use WebMail</A><BR>" +
	"<A title=\"More About Us\" href=\"http://www.havnar.org/about.html\">Its All About Us</A><BR>" +
	"<A title=\"Just Contact Us\" href=\"http://www.havnar.org/contacts.html\">Just Contact Us</A><BR>" +
	"<A title=\"Genealogy by Chris\" href=\"http://www.havnar.org/chris/\">Genealogy by Chris</A><BR>" +
	"<A title=\"The Family Guide\" href=\"http://www.havnar.org/family.html\">The Family's Guide</A><BR>" +
	"<A title=\"The Foods Guide\" href=\"http://www.havnar.org/foods/\">The Foods Guide</A><BR>" +
	"<A title=\"Our Photo Gallery\" href=\"http://photos.havnar.org\">Our Family Gallery</A><BR>" +
	"<A title=\"Just For Fun\" href=\"http://www.havnar.org/fun.html\">Just For Fun</A><BR>" +
	"<A title=\"Just Find-It\" href=\"http://find-it.havnar.org/\">Find-It!</A><BR>" +
	"<A title=\"AI Chat Elders\" href=\"http://www.havnar.org/grans/\">Ol' Grans Chats</A><BR>" +
	"<A title=\"AI Chat Services\" href=\"http://www.havnar.org/chuck/\">Try Chuck Chat</A><BR>" +
	"<BR>");
	document.write('</td></tr></table>');
	document.write('</td><td width=440 valign=top>');
	document.write('<TABLE cellSpacing=0 cellPadding=10 width=440 height=100% border=0><tr><td align=left valign=top>');
}

function writeFooterHO() {
	document.write('</td></tr></table>');
	document.write('</td><td width=130 align=right valign=top>');
	document.write('<TABLE cellSpacing=0 cellPadding=5 width=135><tr><td align=left valign=top>');
	document.write(" " +
	"<A title=\"Just Contact Us\" href=\"contact.html\">e Contact Us</A><BR>" +
	"<A title=\"Survey 4 Us\" href=\"survey.html\">Survey 4 Us</A><BR>" +
	" " +
	"<TABLE cellSpacing=0 cellPadding=3 width=\"100%\" border=0>" +
	"<TR><TD bgColor=gold height=4><img src=\"http://www.havnar.org/start/images/spacer.gif\" width=130 height=1></TD></TR>" +
	"<TR><TD bgColor=#336633 height=25 background=\"http://www.havnar.org/start/images/bg_medbrown.gif\">" +
	"<B><FONT color=yellow>Growth Project</FONT></B></TD></TR>" +
	"<TR><TD bgColor=#eeeeee><P><STRONG>Foundation&nbsp;</STRONG>" +
	"&nbsp; Our Growth Project&nbsp;is a Website-wide effort to replace our " +
	"site's current TP (That's Pretty) system, which is coming to the end of " +
	"its life cycle.&nbsp; <A href=\"found.html\" target=_self>more</A>" +
	"<BR></P></TD></TR><TR><TD bgColor=#ffffff height=7></TD></TR>" +
	"<BR>" +
	"<TR><TD bgColor=#336633 height=25 background=\"http://www.havnar.org/start/images/bg_medbrown.gif\">" +
	"<B><FONT color=yellow>Security</FONT></B></TD></TR>" +
	"<TR><TD bgColor=#eeeeee><P></P>" +
	"<P align=center><A href=\"security.html\" target=_self><IMG alt=\"\" hspace=0 src=\"images/logos/safenet_130.gif\" border=0></a></P>" +
	"<P>Protect yourself and your confidential data. If you haven't changed your passwords recently, please change them now. Never send confidential or personal information over email or give it to anyone you didn't initiate contact with. Don't share your passwords with anyone. For more information, please visit the web sites linked below.</P>" +
	"<P><A href=\"security.html\" target=_self>Security Info</A>" +
	"<BR><A href=\"security_virus.html\" target=_self>Virus Info</A>" +
	"<BR></P></TD></TR><TR><TD bgColor=#ffffff height=7></TD></TR>" +
	"</table>");
	document.write('</td></tr></table>');
	document.write('</td></tr></table><BR>');
	document.write('<TABLE cellSpacing=0 cellPadding=0 width=770><tr><td height=10 width=100% valign=top><FONT size=-2 face=Helvetica, Arial, sans-serif>&nbsp;For technical web site problems only please contact the <a style="text-decoration:none;" href="mailto:webmaster@havnar.org"><font size="-2">Webmaster</font></a></font></td></tr></table>');
	document.write('<TABLE cellSpacing=0 cellPadding=0 width=770><tr><td height=19 width=100% valign=top align=center id=infobar><FONT size=-1 color=#FDFC64 face=Helvetica, Arial, sans-serif>&nbsp;</font></td></tr>');
	document.write('</table><table width=100% border=0>');
	document.write('<tr><td vAlign=top align=middle width=100% background=http://www.havnar.org/start/images/pagebg2.jpg>');
	document.write('<BR><center>- &copy; 2009 <A href="http://www.havnar.org/serv/">Havnar Production Service</A> - powered by <A href="http://www.bluehost.com/"><font face="Comic Sans MS" color="black"><i><b>Bluehost.Com</font></b></i></A> - <A href="http://www.havnar.org/angry/">angry</A> -</center><br>');
	document.write('</TD></TR></TABLE>');
	document.write('</TD><TD width=1 bgcolor=#898989><img src=http://www.havnar.org/start/images/spacer.gif height=1 width=1></TD></TR>');
	document.write('<TR><TD colspan=1 height=1 bgcolor=#898989><img src=http://www.havnar.org/start/images/spacer.gif height=1 width=1></TD></TR></table></DIV>');
	document.write('</td></tr></table></div></div><p><br></p>');
}

//  NOTE that the numeric month in Javascript is from 0-11

var newimage='<img src="http://www.seeley-society.net/images/new.gif">'
var today=new Date()
function whatsnew(yr,mon,day){
	var expire=new Date(yr,mon,day)
	if (today.getTime()<=expire.getTime())
	document.write(newimage)
}

var upimage='<img src="http://www.seeley-society.net/images/updated.png">'
var today=new Date()
function whatsup(yr,mon,day){
	var expire=new Date(yr,mon,day)
	if (today.getTime()<=expire.getTime())
	document.write(upimage)
}

var thetune='<img src="http://www.seeley-society.net/media/seasonsgreetings.wav">'
var thetunes='<EMBED src="http://www.seeley-society.net/media/seasonsgreetings.wav" width=128 height=128 hidden=true type=audio/midi loop="-l" autostart="true">'
var today=new Date()
function whattune(yr,mon,day){
	var expire=new Date(yr,mon,day)
	if (today.getTime()<=expire.getTime())
	document.write(thetunes)
}

/* ===== Show Todays Date ===== */
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
function getthedate(){
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
	year+=1900
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
		daym="0"+daym
		var hours=mydate.getHours()
		var minutes=mydate.getMinutes()
		var seconds=mydate.getSeconds()
		var dn="AM"
		if (hours>=12)
		dn="PM"
		if (hours>12){
			hours=hours-12
		}
	{
 	d = new Date();
	Time24H = new Date();
	Time24H.setTime(d.getTime() + (d.getTimezoneOffset()*60000) + 3600000);
	InternetTime = Math.round((Time24H.getHours()*60+Time24H.getMinutes()) / 1.44);
	if (InternetTime < 10) InternetTime = '00'+InternetTime;
	else if (InternetTime < 100) InternetTime = '0'+InternetTime;
	}
	if (hours==0)
		hours=12
	if (minutes<=9)
		minutes="0"+minutes
	if (seconds<=9)
		seconds="0"+seconds
	//change font size here
	var cdate=dayarray[day]+", "+montharray[month]+" "+daym+" "+year+" | "+hours+":"+minutes+":"+seconds+" "+dn+" "
	if (document.all)
		document.all.clock.innerHTML=cdate
	else if (document.getElementById)
		document.getElementById("clock").innerHTML=cdate
	else
	document.write('<div class=clock> cdate </div>')
}

if (!document.all&&!document.getElementById) getthedate()
function goforit(){
	if (document.all||document.getElementById)
	setInterval("getthedate()",1000)
}
window.onload=goforit

/* ===== styleswitcher ===== */

function fontsizeup() {
  active = getActiveStyleSheet();
  switch (active) {
    case 'A--' : 
      setActiveStyleSheet('A-');
      break;
    case 'A-' : 
      setActiveStyleSheet('A');
      break;
    case 'A' : 
      setActiveStyleSheet('A+');
      break;
    case 'A+' : 
      setActiveStyleSheet('A++');
      break;
    case 'A++' :
      break;
    default :
      setActiveStyleSheet('A');
      break;
  }
}

function fontsizedown() {
  active = getActiveStyleSheet();
  switch (active) {
    case 'A++' : 
      setActiveStyleSheet('A+');
      break;
    case 'A+' : 
      setActiveStyleSheet('A');
      break;
    case 'A' : 
      setActiveStyleSheet('A-');
      break;
    case 'A-' : 
      setActiveStyleSheet('A--');
      break;
    case 'A--' : 
       break;
    default :
      setActiveStyleSheet('A--');
      break;
  }
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  return ('A-');
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
if (title == 'null') {
  title = getPreferredStyleSheet();
}

setActiveStyleSheet(title);


