function change(which){
   which.style.background='568DD5'
}

function unchange(which){
   which.style.background='366DB6'
}

function gotoURL(which){
   location.href = which
}

function random(){
  quotes = ["We must educate our children as there are important positions awaiting them.","The seeds we are planting today will grow and become mighty oaks, and their branches will run over the earth.","You never can foretell the consequences of a dollar invested in education. It goes on multiplying itself. It becomes not an expenditure, but an investment which pays returns far and wide and through generations to come...","This school will yet grow and surprise the world with its great men and women, because it was conceived in righteousness and dedicated to the service of God.","It is an effort on the part of the Church to extend the opportunity of secular education within the framework of a Church school, where is taught faith in the Living God and in His divine Son, our Lord."]
  author = ["President Thomas E. Ricks, Bannock Stake Quarterly Conference, April 1884","Jacob Spori, at the dedication of the Bannock Stake Academy, November 12, 1888","President Gordon B. Hinckley, &quot;Lighting the Way&quot; public announcement, April 4, 1996","Principal Douglas M. Todd, upon his resignation in 1901","Gordon B. Hinckley, &quot;This Great Millennial Year,&quot; <i>Ensign</i>, Nov. 2000, 67"]
  rand = Math.floor( Math.random()*quotes.length)
  document.write("<table cellpadding=0 cellspacing=0 width=90% align='center'><tr><td colspan=2 style='background-image: url(image/topline.gif)' valign=top><img src='image/darkgray.gif' width=1 height=2></td></tr><tr><td rowspan=2 style='background-image: url(image/leftline.gif)'><img src='image/clear.gif' width=2 height=1></td><td width='100%'><table cellpadding=5 cellspacing=0><tr><td style='font-style:italic;text-align:left;font-size:10pt'>&quot;" + quotes[rand] + "&quot;</td></tr></table></td></tr><tr><td style='text-align:right;font-size:10pt'>&#8212;" + author[rand] + "</td></tr></table>")
}

function menu(which){
names = ["Home","Purpose","Giving Options","Benefits","Make a Gift","Contact Us"]
urls =  ["default.htm","purpose.htm","options.htm","benefits.htm","gift.htm","contact.htm"]
output = '<TABLE cellPadding=0 cellspacing="0" border=0><tr><td colspan="2"><img src="image/clear.gif" width="1" height="10"></td></tr>'
for(i=0; i<names.length; i++){
  if (which == i)
    output += '<tr><td height="24" noWrap class="menu" style="background-color:F2F2F2;cursor:hand" onClick=gotoURL("'+ urls[i] +'") width="100%"><span class="menuhead">&nbsp;&nbsp;&nbsp;<a href="'+ urls[i] +'">'+ names[i] +'</a>&nbsp;&nbsp;</span></td><td><img src="image/pointer.gif" width="25" height="22"></td></tr>'
  else
    output += '<tr><td height="24" noWrap class="menu" style="cursor:hand" onmouseover="change(this)" onmouseout="unchange(this)" onClick=gotoURL("'+ urls[i] +'") width="100%"><span class="menu">&nbsp;&nbsp;&nbsp;<a href="'+ urls[i] +'">'+ names[i] +'</a></span></td><td>&nbsp;</td></tr>'
  output += '<tr><td colspan="2"><img height="2" src="image/clear.gif" width="140"></td></tr>'
}
output += '</TABLE>'
document.write(output)
}



function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function createCookie(name, rem, day){
 var now = new Date();
 fixDate(now);
 now.setTime(now.getTime() + day * 24 * 60 * 60 * 1000);
 setCookie(name, rem, now)
}


