//----------------------------------------------------------------------
//----------------------------------------------------------------------
//	             E D R E S S    O B F U S K A T O R
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//
//	Written by Christian Hankel
archibald  = "&#108;&#96;&#104;&#109;&#117;&#110;&#59;&#96;&#115;&#98;&#105;"
           + "&#104;&#99;&#96;&#109;&#101;&#65;&#96;&#109;&#96;&#98;&#96;&#115;"
           + "&#117;&#110;&#110;&#111;&#96;&#47;&#98;&#110;&#108;&#62;&#114;"
           + "&#116;&#99;&#107;&#100;&#98;&#117;&#60;&#117;&#105;&#100;&#33;"
           + "&#96;&#98;&#98;&#110;&#115;&#101;&#104;&#96;&#111;&#33;&#108;"
           + "&#96;&#106;&#100;&#114;&#33;&#108;&#100;&#33;&#105;&#110;&#117;";
          
bachelor   = "&#108;&#96;&#104;&#109;&#117;&#110;&#59;&#99;&#96;&#98;&#105;"
           + "&#100;&#109;&#110;&#115;&#65;&#96;&#109;&#96;&#98;&#96;&#115;"
           + "&#117;&#110;&#110;&#111;&#96;&#47;&#98;&#110;&#108;&#62;&#114;"
           + "&#116;&#99;&#107;&#100;&#98;&#117;&#60;&#104;&#33;&#118;&#96;"
           + "&#111;&#117;&#33;&#117;&#110;&#33;&#103;&#100;&#100;&#109;&#33;"
           + "&#120;&#110;&#116;&#115;&#33;&#108;&#116;&#114;&#98;&#109;&#100;"
           + "&#114;";

mail       = "&#108;&#96;&#104;&#109;&#117;&#110;&#59;&#96;&#109;&#96;&#98;&#96;"
           + "&#115;&#117;&#110;&#110;&#111;&#96;&#65;&#96;&#109;&#96;&#98;&#96;"
           + "&#115;&#117;&#110;&#110;&#111;&#96;&#47;&#98;&#110;&#108;&#62;&#114;"
           + "&#116;&#99;&#107;&#100;&#98;&#117;&#60;&#104;&#33;&#98;&#96;&#111;"
           + "&#38;&#117;&#33;&#109;&#104;&#119;&#100;&#33;&#118;&#104;&#117;"
           + "&#105;&#110;&#116;&#117;&#33;&#120;&#110;&#116;";

matt       = "&#108;&#96;&#104;&#109;&#117;&#110;&#59;&#108;&#96;&#117;&#117;"
           + "&#108;&#96;&#120;&#103;&#104;&#100;&#109;&#101;&#48;&#65;&#105;"
           + "&#110;&#117;&#108;&#96;&#104;&#109;&#47;&#98;&#110;&#108;"

providence = "&#108;&#96;&#104;&#109;&#117;&#110;&#59;&#113;&#115;&#110;&#119;&#104;"
           + "&#101;&#100;&#111;&#98;&#100;&#65;&#96;&#109;&#96;&#98;&#96;&#115;"
           + "&#117;&#110;&#110;&#111;&#96;&#47;&#98;&#110;&#108;&#62;&#114;&#116;"
           + "&#99;&#107;&#100;&#98;&#117;&#60;&#120;&#110;&#116;&#33;&#114;&#98;"
           + "&#96;&#115;&#100;&#33;&#108;&#100;&#33;&#96;&#111;&#101;&#33;&#104;"
           + "&#33;&#109;&#110;&#119;&#100;&#33;&#104;&#117;";
           
ruby       = "&#108;&#96;&#104;&#109;&#117;&#110;&#59;&#115;&#116;&#99;&#120;&#65;"
           + "&#96;&#109;&#96;&#98;&#96;&#115;&#117;&#110;&#110;&#111;&#96;&#47;&#98;"
           + "&#110;&#108;&#62;&#114;&#116;&#99;&#107;&#100;&#98;&#117;&#60;&#120;"
           + "&#110;&#116;&#33;&#96;&#115;&#100;&#33;&#108;&#120;&#33;&#102;&#110;"
           + "&#101;&#101;&#100;&#114;&#114;";

overton	   = "&#108;&#96;&#104;&#109;&#117;&#110;&#59;&#110;&#119;&#100;&#115;&#117;"
		   + "&#110;&#111;&#65;&#96;&#109;&#96;&#98;&#96;&#115;&#117;&#110;&#110;"
           + "&#111;&#96;&#47;&#98;&#110;&#108;&#62;&#114;&#116;&#99;&#107;&#100;&#98;"
           + "&#117;&#60;&#120;&#110;&#116;&#33;&#114;&#105;&#104;&#111;&#100;&#33;&#109;"
		   + "&#104;&#106;&#100;&#33;&#96;&#33;&#114;&#105;&#96;&#103;&#117;&#33;&#110;"
		   + "&#103;&#33;&#102;&#110;&#109;&#101;";
         
vault = new Array(" ", "!", "4", "5", "H", "I", "Z",  "[", "l", "m", 
                 "\"", "#", "6", "7", "J", "K", "\\", "]", "n", "o", 
                  "$", "%", "8", "9", "L", "M", "^",  "_", "p", "q", 
                  "&", "'", ":", ";", "N", "O", "`",  "a", "r", "s", 
                  "(", ")", "<", "=", "P", "Q", "b",  "c", "t", "u", 
                  "*", "+", ">", "?", "R", "S", "d",  "e", "v", "w", 
                  ",", "-", "@", "A", "T", "U", "f",  "g", "x", "y", 
                  ".", "/", "B", "C", "V", "W", "h",  "i", "z", "{", 
                  "0", "1", "D", "E", "X", "Y", "j",  "k", "|", "}", 
                  "2", "3", "F", "G", "~");

//----------------------------------------------------------------------
function isNumeric(oneChar)
{
   var nums = "0123456789";
   if (nums.indexOf(oneChar)==-1){
      return false;
   }else{
      return true;
   }
}

//----------------------------------------------------------------------
function GoToTheVault(vaultKey)
{
   var intChar = "";
   for( var i = 0; i < vault.length; i++){
      if( vaultKey == vault[i]){      	 
         intChar = vault[i].charCodeAt(0);
         if( i % 2 == 0){
            intChar += 1;
         }else{
            intChar -= 1;
         }
         i = 95;
      }
   }
   return  String.fromCharCode(intChar);
}

//----------------------------------------------------------------------
function Unencrypt(encryptedString)
{
   var oneChar = "";
   var intString = "";
   var outString = "";
  
   for( var i = 0; i < encryptedString.length; i++){
      oneChar = encryptedString.substr(i,1);
      if(oneChar == ";"){
      	 oneChar = String.fromCharCode(intString);
         if(oneChar == "~"){
            outString += "~";
         }else{
            outString += GoToTheVault(oneChar);
         }
         intString = "";
      }else if(isNumeric(oneChar)){
         intString += oneChar;
      }
   }
   return outString
}

//----------------------------------------------------------------------
function NewLink(code)
{
   window.location = Unencrypt(code);
}

//----------------------------------------------------------------------
function sendTo(myform, code){
   myform.action = Unencrypt(code);
}


//----------------------------------------------------------------------
//----------------------------------------------------------------------
//	      I M A G E   D I S P L A Y   F U N C T I O N S
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//
//	Written by Christian Hankel (unless otherwise noted)
//	

//----------------------------------------------------------------------
function newSlideWin(loc, w, h){
   var winStr = "width=" + w + ",height=" + h +",left=0,top=0,toolbar=no,scrollbars=no,resizable=no"
   var largeWin = window.open(loc, "largeWindow", winStr) 
}

//----------------------------------------------------------------------
//opens a window to show an enlarged photo
//img is the relative path/name of the enlarged image
//the 'open, close, open' kludge explained:
//  The original code (commented out) would open a window with the proper image.
//  However, if the user clicked on another image link, the image in the largeWin
//  wouldn't change.  The current code looks silly but it works.  (The first time
//  largeWin is opened, there's an annoying flicker but this will do for now.)
function newEnlargeWin(img, ttl, w, h){
   var winStr = "width=" + w + ",height=" + h +",left=0,top=0,toolbar=no,scrollbars=no,resizable=no"
   var largeWin = window.open("", "largeWindow", winStr)
   largeWin = largeWin.close()
   largeWin = window.open("", "largeWindow", winStr)
   largeWin.document.write("<html><head><title>" + ttl + "</title></head>"
                           + "<body onload='self.focus()' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
                           + "<img src='" + img + "'></body></html>")
   largeWin = largeWin.focus()
}

//original version
//function newEnlargeWin(img, ttl, w, h){
//   var winStr = "width=" + w + ",height=" + h +",left=0,top=0,toolbar=no,scrollbars=no,resizable=no"
//   var largeWin = window.open("", "largeWindow", winStr)
//   largeWin.document.write("<html><head><title>" + ttl + "</title></head>"
//                           + "<body onload='self.focus()' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
//                           + "<img src='" + img + "'></body></html>")
//   largeWin = largeWin.focus()
//}

//----------------------------------------------------------------------
//opens a window to show a lyrics page
//loc is the name of the page
function lyrics(loc){
   var winStr = "width=500,height=600,left=0,top=0,toolbar=no,scrollbars=yes,resizable=no"
   var largeWin = window.open("../../words/" + loc, "largeWindow", winStr)
   largeWin = largeWin.focus() 
}

//----------------------------------------------------------------------
//opens a window to show a lyrics page
//Poor planning on my part (let's hard code the path into the function!) has
//made this version necessary.  I apologize to all my coding brothers and sisters.
//loc is the name of the page
function soundslyrics(loc){
   var winStr = "width=500,height=600,left=0,top=0,toolbar=no,scrollbars=yes,resizable=no"
   var largeWin = window.open("../words/" + loc, "largeWindow", winStr)
   largeWin = largeWin.focus() 
}

//----------------------------------------------------------------------
//opens a window to show a lyrics page
//Poor planning on my part (let's hard code the path into the function!) has
//made this version necessary.  I apologize to all my coding brothers and sisters.
//loc is the name of the page
function wordslyrics(loc){
   var winStr = "width=500,height=600,left=0,top=0,toolbar=no,scrollbars=yes,resizable=no"
   var largeWin = window.open(loc, "largeWindow", winStr)
   largeWin = largeWin.focus() 
}

//----------------------------------------------------------------------
//use to add a status bar description of the current link
//onmouseover="linkDescription('this is my description');return true"
//onmouseout="linkDescription('');return true;"
function linkDescription( descriptionStr ){
   window.status = descriptionStr
}

function alacartoona_loves_you(){
	//do nothing
}


//----------------------------------------------------------------------
//----------------------------------------------------------------------
//	                   S L I D E S H O W
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//
//	Written by Christian Hankel using Ricocheting (ricocheting@hotmail.com) as reference
//	Web Site:  http://www.ricocheting.com
//
//	Provided here as documentation.  Until I can solve the array declaration/definition
//	problem, I will have to include all of this code on every page that has a slide show.


//var imgArray = new Array()
//var thisImg = 0
//var imgCnt
//var rotate_delay = 4000; // delay in milliseconds (4000 = 5 secs)
//
////----------------------------------------------------------------------
////show the image in the array at index img
//function showImage(img){
//   document.images.show.src = imgArray[img];
//}
//
////----------------------------------------------------------------------
////show the next image in the queue
////if there is a next image, show it, else show the first image
//function next() {
//   if (thisImg < imgCnt){
//      //document.images.show.src = imgArray[++thisImg];
//      showImage(++thisImg)
//   }
//   else first();
//}
//
////----------------------------------------------------------------------
////show the previous image in the queue
////if there is a previous image, show it, else show the last image
//function previous() {
//   if (thisImg > 0) {
//      showImage(--thisImg)
//      //document.images.show.src = imgArray[--thisImg];
//   }
//   else last();
//}
//
////----------------------------------------------------------------------
////show the first image in the queue
//function first() {
//   thisImg = 0;
//   //document.images.show.src = imgArray[thisImg];
//   showImage(thisImg)
//}
//
////----------------------------------------------------------------------
////show the last image in the queue
//function last() {
//   thisImg = imgCnt
//   //document.images.show.src = imgArray[thisImg];
//   showImage(thisImg)
//}
//
////----------------------------------------------------------------------
////write text to the activation button
////if the text currently reads "stop", write "start", else write "stop"
////start or stop the slideshow via the activation button
//function ap(text) {
//   document.slideform.slidebutton.value = (text == "stop") ? "start" : "stop";
//   rotate();
//}
//
////----------------------------------------------------------------------
////controls the actions that make up a slideshow
////if the activation button reads "stop", the slideshow is running
////if this is the last image, show the first, else show the next
//function rotate() {
//   if (document.slideform.slidebutton.value == "stop") {
//      next();
//      window.setTimeout("rotate()", rotate_delay);
//   }
//}
