// Swap image function 
  function ChangeImage (ImageName, FileName) {
    if (document.images) {
      document[ImageName].src = eval(FileName + ".src");
    }
  }


// OPEN WINDOW SCRIPT - CENTERED
var win = null;
function openWindow(mypage,myname,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=no'
win = window.open(mypage,myname,settings)
}



// SET COOKIE
var expiration = new Date();
expiration.setYear(3000);

function setCookie(name, value, expires, path, domain) 
{ document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null)    ? "" : "; path=" + path) +
  ((domain == null)  ? "" : "; domain=" + domain);
  window.location="rectors_welcome.html";
}



// CHECK FOR COOKIE
 function checkCookie (CookieName) {
	var lf = "\n";
    var CookieString = document.cookie;
    var CookieSet = CookieString.split (';');
    var SetSize = CookieSet.length;
    var CookiePieces
    var ReturnValue = "";
    var x = 0;
    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {
      CookiePieces = CookieSet[x].split ('=');
      if (CookiePieces[0].substring (0,1) == ' ') {
        CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
      }
      if (CookiePieces[0] == CookieName) {
        ReturnValue = CookiePieces[1];
      }
     }
     if(ReturnValue=="visited")
	 	window.location="rectors_welcome.html";
         //alert('A cookie was not set. '+lf+'Please ensure that your browser is accepting cookies.');
 }
   
// RANDOM QUOTES
var Quotation=new Array()

Quotation[0] = "Welcome to St. James where we proclaim Christ crucified and risen, and invite you to join with us in ministry together in his name.";
Quotation[1] = "We know that all things work together for good for those who love God, who are called according to his purpose.<br><br><i>Romans 8:28</i>";
Quotation[2] = "Whoever is thirsty, let him come; and whoever wishes, let him take the free gift of the water of life.<br><br><i>Rev.22:17</i>";
Quotation[3] = "We are servants of Christ and stewards of God's mysteries<br><br><i>1 Cor. 4:1</i>";
Quotation[4] = "I am here on Earth for just a little while; do not hide your commands from me.<br><br><i>Psalm 119:1-24</i>";
Quotation[5] = "Let the little children come to me; do not stop them; for it is such as these that the Kingdom of God belongs.<br><br><i>Mark 10:14</i>";
Quotation[6] = "Make a joyful noise to the Lord, all the Earth; break forth into joyous song and sing praises.<br><br><i>Psalm 98</i>";
Quotation[7] = "For behold, you look for truth deep within me, and will make me understand wisdom secretly.<br><br><i>Psalm 51:7</i>";
Quotation[8] = "Whoever does not carry the cross and follow me can not be my disciple.<br><br><i>Luke 14:33</i>";
Quotation[9] = "Those who have served well gain an excellent standing and great assurance in their faith in Christ Jesus.<br><br><i>1 Tim 3:13</i>";

// ======================================
// Do not change anything below this line
// ======================================
var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(Quotation[whichQuotation]);}

   
/// NAV Image preloader
if (document.images) {
  n1a = new Image(1,1);
  n1a.src = "images/n1a.gif";
  n1b = new Image(1,2);
  n1b.src = "images/n1b.gif";

  n2a = new Image(1,3);
  n2a.src = "images/n2a.gif";
  n2b = new Image(1,4);
  n2b.src = "images/n2b.gif";
  
  n3a = new Image(1,5);
  n3a.src = "images/n3a.gif";
  n3b = new Image(1,6);
  n3b.src = "images/n3b.gif";
  
  n4a = new Image(1,7);
  n4a.src = "images/n4a.gif";
  n4b = new Image(1,8);
  n4b.src = "images/n4b.gif";
  
  n5a = new Image(1,9);
  n5a.src = "images/n5a.gif";
  n5b = new Image(1,10);
  n5b.src = "images/n5b.gif";
  
  n6a = new Image(1,11);
  n6a.src = "images/n6a.gif";
  n6b = new Image(1,12);
  n6b.src = "images/n6b.gif";
  
  n7a = new Image(1,13);
  n7a.src = "images/n7a.gif";
  n7b = new Image(1,14);
  n7b.src = "images/n7b.gif";
}