function thinLine(color,width, align) {
/************************************************************
Purpose: inserts an html thin line into the document
arguments: "color" as text 
                "number" as a number width (percentage)
                "align" as text for alignment
*************************************************************/
            var html = '<table BORDER="0" CELLSPACING="0" cellpadding="0" WIDTH="';
            html += width;
            html += '%" align="'
            html += align;
            html += '"><tr><td BGCOLOR="'
            html += color;
            html += '"><table BORDER="0" CELLSPACING="0" CELLPADDING="0"><tr>';
               html +='<td HEIGHT="1"></td></tr></table></td></tr></table>';
               document.write (html);
} //end function thinLine()
function checkPasswords(p1,p2) {
//purpose: check whether two passwords are equal
//p1 & p2 appear to be input boxes
  if (p1.value==p2.value) {
    //alert("p1=" + p1.value\n + "ps= " + p2.value\n);
    return true;}
  else {
    alert("Your passwords are not the same. Please re-enter."); 
    p2.focus();
    return false;

  }
} //end function checkPasswords()

//the following scripts are used for the photo gallery pages
function changeLink(objname,txt, flag,jsfunc) {
//add (flag=0) or remove (flag=1) the link (with function call jsfunc) from span id=name and text=txt
  //get the document object
  x = new getObj(objname);
  if (flag==1) {
    x.obj.innerHTML=txt;
  } else {
    x.obj.innerHTML="<a href='javascript:" + jsfunc + "'>" + txt + "</a>";
  }

} //end function changeLink(...)

function updateCount(num) {
//update div="count" with the current page x of y
  var x=new getObj("count");
  x.obj.innerHTML=num + " of " + numberofPics;
}

function changeCaption(text) {
//update the caption div='caption' to 'text'  
  var x = new getObj('caption');
  x.obj.innerHTML=text;
}

function invi(flag,objname)
{
//make objname invisible (flag=1) or visible (flag=0)
	//if (!DHTML) return;
	var x = new getObj(objname);
	x.style.visibility = (flag) ? 'hidden' : 'visible';
} //end function invi(flag,objname)

function previousPicture(){
  if(picNumber > 1){
    changeLink("last","(Last) &gt;&gt; ",0,"lastPicture()");
    //invi(0,"last");
    changeLink("next","(Next) &gt;",0,"nextPicture()");
    invi(0,"next");
    if ((picNumber-1)==1) {
      //make the first and previous links dissappear
      //invi(1,"first");
      changeLink("first","&lt;&lt; (First)",1,"firstPicture()");
      changeLink("previous","&lt; (Previous)",1,"previousPicture()");
    } //end if 
    picNumber--
     }    
   document.myPicture.src=picture[picNumber-1]
   changeCaption(picCaption[picNumber-1]);
   updateCount(picNumber);
   }//end function previousPicture()
  
 function nextPicture(){
   if(picNumber < numberofPics){
    changeLink("first","&lt;&lt; (First)",0,"firstPicture()");
     //invi(0,"first");
    changeLink("previous","&lt; (Previous)",0,"previousPicture()");
     //invi(0,"previous");
     if (picNumber+1==picture.length) {
       //make next and last links dissappear
    changeLink("last","(Last) &gt;&gt;",1,"lastPicture()");
    changeLink("next","(Next) &gt;",1,"nextPicture()");
         //invi(1,"last");
         //invi(1,"next");
     }
     picNumber++;
     }
   document.myPicture.src=picture[picNumber-1]
   changeCaption(picCaption[picNumber-1]   );
   updateCount(picNumber);
   } //end function nextPicture()
function firstPicture() {
  picNumber=1;
   document.myPicture.src=picture[0];
   updateCount(1);
  changeCaption(picCaption[0]);
   changeLink("first","&lt;&lt; (First)",1,"firstPicture()");
   //invi(1,"first");
   changeLink("previous","&lt; (Previous)",1,"previousPicture()");
   //invi(0,"last");
   changeLink("last","(Last) &gt;&gt;",0,"lastPicture()");
   //invi(0,"next");
   changeLink("next","(Next) &gt;",0,"nextPicture()");
} //end function firstPicture()

function lastPicture() {
  //invi(1,"last");
  changeLink("last","(Last) &gt;&gt;",1,"lastPicture()");
  //invi(1,"next");
  changeLink("next","(Next) &gt;",1,"nextPicture()");
  //invi(0,"first");
  changeLink("first","&lt;&lt; (First)",0,"firstPicture()");
  //invi(0,"previous");
  changeLink("previous","&lt; (Previous)",0,"previousPicture()");
  picNumber=picture.length;
   document.myPicture.src=picture[picture.length-1];
   changeCaption(picCaption[picture.length-1]);
   updateCount(numberofPics);
}

//end photo gallery scripts

//the following function is a crossbrowser dom script
//that returns the proper html element for each browser
//url: http://www.xs4all.nl/~ppk/js/index.html
//usage: x = new getObj("html element")
//returns the object x which has two properties that are useful
//x.obj and x.style
//example 1: alert(x.obj.id) or x.obj.innerHTML="html"
//example 2: x.style.top = '20px';
function getObj(name)
{
  if (document.getElementById)
  {
  	//alert(name);
  	this.obj = document.getElementById(name);
  	//alert(this.obj);
  	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
} //end function getObj(name)
/*
the following scripts are for time clocks
working example at...
*/
function time_clock(date,message) {
	//alert(event_date);
  if (!document.layers && !document.all && !document.getElementById)
  return;
  //really the next var should read begin lent 
  //but i will recycle for the end lent countdown, so who cares
  var date=new Date(date);
  var millisecs_to_date= date.getTime();
  var today=new Date();
  var millisecs_today=today.getTime();
  var millisecs_diff=millisecs_to_date-millisecs_today;
  var secs_to_date=roundOff((millisecs_diff/1000),0);
  var mins_to_date=roundOff((millisecs_diff/60000),0);
  var hours_to_date=roundOff((millisecs_diff/3600000),0);
  var days_to_date=roundOff((millisecs_diff/(3600000*24)),0);
  if (secs_to_date<0){
    hours_to_date=message;
    secs_to_date=message;
    mins_to_date=message;
    days_to_date=message;
  }
  x = new getObj("secs_clock");
  x.obj.innerHTML = secs_to_date;
  x = new getObj("mins_clock");
  x.obj.innerHTML = mins_to_date;
  x = new getObj("hours_clock");
  x.obj.innerHTML = hours_to_date;
  x = new getObj("days_clock");
  x.obj.innerHTML = days_to_date;  
}//end function time_clock()
//  End -->
//the next function takes a numeric value and rounds it off
//pass it the value and the number of decimals	  
function roundOff(value, precision) {
  value = "" + value //convert value to string
  precision = parseInt(precision);
  var whole = "" + Math.round(value * Math.pow(10, precision));
  var decPoint = whole.length - precision;
  if(decPoint != 0){
    result = whole.substring(0, decPoint);
    if (precision!=0) {
      result += ".";
    } //end if(precision!=0)
    result += whole.substring(decPoint, whole.length);
  } //end if (decPoint != 0)
  else {
    result = whole;
  }//end else
  return result;
} //end function roundOff



