//JavaScript file

//General display functions
function windowStatus(string)
{
   window.status=string;
}

function testOrphanedFrame()
{
  var args = testOrphanedFrame.arguments;
  var retval = false;
  var topLocation = window.top.location;
  var selfLocation = window.self.location;
  if (topLocation == selfLocation)
  {
    retval = true;
    if (args.length == 1)
    {
      redefineFrameset(args[0]);
    }
    else
    {
      redefineFrameset(args);
    }
  }
  return retval;
}
function toggleList(image,list)
{
  var listElementStyle=document.getElementById(list).style;
  if (listElementStyle.display=="none"){
  listElementStyle.display="block";
  document.getElementById(image).src="navigation/open.gif";
  document.getElementById(image).alt="Close list";
  }else{
  listElementStyle.display="none";
  document.getElementById(image).src="navigation/closed.gif";
  document.getElementById(image).alt="Open list";
  }
}
//Slideshow functions

var slides = new Array();
var slidesEntryLength = 5;//SubtitleURL,ChildrenURL,ContentURL,NotesURL,ThumbnailsURL
var slideShowEnd = 0;
var slideShowRunning = false;
var slideCursor=0;
var slidesIndex=0;
var slideShowSpeed=1;
var slideShowTimer=5000;//in milliseconds

function makeArray()
{
   var args = makeArray.arguments;
	  for(var i=0;i<args.length;i++)
	  {
		this[i]=args[i];
	  }
	  this.length=args.length;
}

function buildSlideShow()
{
   if(testOrphanedFrame() == false)
   {
	  var args = buildSlideShow.arguments;
	  slides=new Array(args.length);
	  for(var i=0;i<args.length;i++)
	  {
		slides[i]=args[i];
	  }
	  slides.length=args.length;
	  slideShowEnd = slides.length/slidesEntryLength;
   }
}

function gotoSlide(index){
   var SubtitleURL=slides[index+0];
   var ChildrenURL=slides[index+1];
   var ContentURL=slides[index+2];
   var NotesURL=slides[index+3];
   var ThumbnailsURL=slides[index+4];
   changeSubtitleChildrenContentNotesThumbnailsPages(SubtitleURL,ChildrenURL,ContentURL,NotesURL,ThumbnailsURL);
}

function onTimer(){
   if(slideShowRunning)
   {
	     advanceSlideShow();
   }
	  setTimeout('onTimer()',slideShowTimer);
}

function advanceSlideShow(){
   if(slideCursor < slideShowEnd)
   {
	     slidesIndex=slideCursor*slideShowSpeed*slidesEntryLength;
	     slideCursor++;
   }
   else
   {
	     slidesIndex=0;
	     slideCursor=1;
   }
   gotoSlide(slidesIndex);
}

function startSlideShow(){ //on button click
   if(slideShowRunning)
   {
	     slideShowRunning = false;
   }
   else
   {
	     slideShowRunning = true;
	     advanceSlideShow();
	     setTimeout('onTimer()',slideShowTimer);
   }
}

//Rollover functions

function MM_swapImgRestore(){ //v3.0
   var i,x,a=document.MM_sr;
   window.status = ' ';
   for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}

function MM_preloadImages(){ //v3.0
   var a=MM_preloadImages.arguments;   testOrphanedFrame(a);
   var d=document;   if(d.images){   if(!d.MM_p) d.MM_p=new Array();   var i,j=d.MM_p.length;   for(i=0; i<a.length; i++)   if (a[i].indexOf("#")!=0){      d.MM_p[j]=new Image;      d.MM_p[j++].src=a[i];      }   }}
function MM_findObj(n, d){ //v3.0   var p,i,x;   if(!d) d=document;   if((p=n.indexOf("?"))>0&&parent.frames.length){   d=parent.frames[n.substring(p+1)].document;   n=n.substring(0,p);}   if(!(x=d[n])&&d.all) x=d.all[n];   for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);   return x;}
function MM_swapImage(){ //v3.0   var i,j=0,x,a=MM_swapImage.arguments;   document.MM_sr=new Array;   for(i=0;i<(a.length-2);i+=3)	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;   if(!x.oSrc) x.oSrc=x.src;   x.src=a[i+2];}}
//Navigation functions
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeNavigationImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeNavigationImages.arguments.length; i+=2) {
			document[changeNavigationImages.arguments[i]].src = changeNavigationImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadNavigationImages(pathFromRoot) {
	if (document.images) {
		navigation_01_over = newImage(pathFromRoot+"navigation/navigation_01-over.gif");
		navigation_03_over = newImage(pathFromRoot+"navigation/navigation_03-over.gif");
		navigation_05_over = newImage(pathFromRoot+"navigation/navigation_05-over.gif");
		navigation_07_over = newImage(pathFromRoot+"navigation/navigation_07-over.gif");
		preloadFlag = true;
	}
}

var navigationArray = new Array();
var navigationEntryLength = 5;//type,SubtitleURL,ChildrenURL,ContentURL,NotesURL,ThumbnailsURL
var navigationEnd = 0;
var navigationCursor = 0;
var navigationInit = false;

function buildNavigationArray()
{
	var args = buildNavigationArray.arguments;
	navigationArray = new Array(args.length);
	for (var i=0; i<args.length; i++)
	{
		navigationArray[i]=args[i];
	}
	navigationArray.length = args.length;
	navigationEnd = navigationArray.length-1;
}

function navigateForward()
{
   if(navigationInit == true){;
      navigationCursor+=navigationEntryLength;
      if(navigationCursor > navigationEnd)
         {
            navigationCursor = 0;
         }
      }
   navigationInit = true;
   navigateTo(navigationCursor);
}

function navigateBackward()
{
   if(navigationInit == true){;
      navigationCursor = navigationCursor - navigationEntryLength;
      if(navigationCursor < 0)
         {
            navigationCursor = navigationEnd - navigationEntryLength+1;
         }
      }
   navigationInit = true;
   navigateTo(navigationCursor);
}

function navigateTo(index)
{
   if(navigationArray.length == 0)   {return;
   }
   var type = navigationArray[index+0];//0 == directory, 1 == file
   var SubtitleURL=navigationArray[index+1];
   var ChildrenURL=navigationArray[index+2];
   var ContentURL=navigationArray[index+3];
   var NotesURL=navigationArray[index+4];

   if(type == 0)
   {
   changeChildrenContentNotesPages(ChildrenURL,ContentURL,NotesURL);
   }
   else
   {
   changeContentNotesPages(ContentURL,NotesURL);
   }
}

//TOC navigation functions

function changeTOCImages() 
{
	if (document.images && (preloadFlag == true)) 
	{
		for (var i=0; i<changeTOCImages.arguments.length; i+=2) 
		{
			document[changeTOCImages.arguments[i]].src = changeTOCImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadTOCImages() 
{
	if (document.images) 
	{
		TOC_01_over = newImage("navigation/TOC_01-over.gif");
		TOC_02_over = newImage("navigation/TOC_02-over.gif");
		TOC_03_over = newImage("navigation/TOC_03-over.gif");
		preloadFlag = true;
	}
}

//FrameSet update functions

function redefineFrameset(args){   var TitleURL = args[0];   var TitleIconURL = args[1];   var SubtitleURL = args[2];   var ChildrenURL = args[3];   var ContentURL = args[4];   var NotesURL = args[5];   var ThumbnailsURL = args[6];   var newDoc = document.open();   var html = "<html><head><title>Jeanne McLeish</title><link rel='stylesheet' type='text/css' href='Jeanne McLeish_styleSheet.css'/><script language='javascript' type='text/javascript' src='Jeanne McLeish_script.js' ></script><meta name='description' content='Jeanne McLeish'><meta name='author' content='T. J. McLeish'><meta name='revised' content='T. J. McLeish, Thursday, June 15, 2006'><meta name='keywords' content=''></head><FRAMESET cols ='50,115,40*' frameborder=NO border='0' framespacing='0'><noframes><body class='note'><H2>Jeanne McLeish</H2><i>&quot;Anything under the sun is beautiful if you have the vision-it is the seeing of the thing that makes it so.  The world is waiting for men with vision-it is not interested in mere pictures.  What people subconsciously are interested in is the expression of beauty, something that helps them through the humdrum day, something that shocks them out of themselves and something that makes them believe in the beauty and the glory of human existence.&quot; - Charles Hawthorne</i><br><br>My paintings are an expression of my reverence for the natural world.  The certainty of its ever-changing beauty is a constant source of wonder and comfort to me.  In a time when so many peoples' lives do not allow them the luxury of spending time outdoors, I hope my paintings serve to remind them of the peace and beauty found there.<br><br>If you are viewing this text, your browser lacks the ability to read frames. Don't worry, you can still enjoy this site. All the pages can be viewed from the contents page. Please come inside!<br><br><a href='Jeanne McLeish_TOC.html' target='_blank'>Table of Contents</a></body></noframes><FRAMESET rows ='30*,85,60' frameborder=NO border='0' framespacing='0'><FRAMESET cols ='25,25*' frameborder=NO border='0' framespacing='0'><FRAME name='Title' src="+TitleURL+" frameborder='0' marginwidth='0' marginheight='0' scrolling='no'><FRAME name='Subtitle' src="+SubtitleURL+" frameborder='0' marginwidth='0' marginheight='0' scrolling='no'></FRAMESET><FRAME name='TitleIcon' src="+TitleIconURL+" frameborder='0' marginwidth='0' marginheight='0' scrolling='no'><FRAME name='SiteNavigation' src='http://www.home.earthlink.net/~burkettmcleish//Jeanne McLeish_SiteNavigation.html' frameborder='0' marginwidth='0' marginheight='0'></FRAMESET><FRAME name= 'Children' src="+ChildrenURL+" frameborder='0' marginwidth='0' marginheight='0'><FRAMESET rows = '30*,85,60' frameborder=NO border='0' framespacing='0'><FRAME name='Content' src="+ContentURL+" frameborder='0' marginwidth='0' marginheight='0'><FRAME name='Notes' src="+NotesURL+" frameborder='0' marginwidth='0' marginheight='0'><FRAME name='Thumbnails' src="+ThumbnailsURL+" frameborder='0' marginwidth='0' marginheight='0'></FRAMESET></FRAMESET></FRAMESET></html>";   newDoc.write(html);   newDoc.close();}
function changeAllPages(TitleURL,TitleIconURL,SubtitleURL,ChildrenURL,ContentURL,NotesURL,ThumbnailsURL){   parent.Title.location.href = TitleURL;   parent.TitleIcon.location.href = TitleIconURL;   parent.Subtitle.location.href = SubtitleURL;   parent.Children.location.href = ChildrenURL;   parent.Content.location.href = ContentURL;   parent.Notes.location.href = NotesURL;   parent.Thumbnails.location.href = ThumbnailsURL;}
function changeTitleIconSubtitleChildrenContentNotesThumbnailsPages(TitleIconURL,SubtitleURL, ChildrenURL,ContentURL,NotesURL,ThumbnailsURL){   parent.TitleIcon.location.href = TitleIconURL;
   parent.Subtitle.location.href = SubtitleURL;
   parent.Children.location.href = ChildrenURL;
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
   parent.Thumbnails.location.href = ThumbnailsURL;
}

function changeTitleIconSubtitleContentNotesThumbnailsPages(TitleIconURL,SubtitleURL,ContentURL,NotesURL,ThumbnailsURL){
   parent.TitleIcon.location.href = TitleIconURL;
   parent.Subtitle.location.href = SubtitleURL;
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
   parent.Thumbnails.location.href = ThumbnailsURL;
}

function changeChildrenContentNotesThumbnailsPages(ChildrenURL,ContentURL,NotesURL,ThumbnailsURL){
   parent.Children.location.href = ChildrenURL;
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
   parent.Thumbnails.location.href = ThumbnailsURL;
}

function changeChildrenContentNotesPages(ChildrenURL,ContentURL,NotesURL){
   parent.Children.location.href = ChildrenURL;
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
}

function changeSubtitleChildrenContentNotesThumbnailsPages(SubtitleURL,ChildrenURL,ContentURL,NotesURL,ThumbnailsURL){
   parent.Subtitle.location.href = SubtitleURL;
   parent.Children.location.href = ChildrenURL;
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
   parent.Thumbnails.location.href = ThumbnailsURL;
}

function changeSubtitleChildrenContentNotesPages(SubtitleURL,ChildrenURL,ContentURL,NotesURL){
   parent.Subtitle.location.href = SubtitleURL;
   parent.Children.location.href = ChildrenURL;
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
}

function changeSubtitleContentNotesThumbnailsPages(SubtitleURL,ContentURL,NotesURL,ThumbnailsURL){
   parent.Subtitle.location.href = SubtitleURL;
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
   parent.Thumbnails.location.href = ThumbnailsURL;
}

function changeContentNotesThumbnailsPages(ContentURL,NotesURL,ThumbnailsURL){
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
   parent.Thumbnails.location.href = ThumbnailsURL;
}

function changeContentNotesPages(ContentURL,NotesURL){
   parent.Content.location.href = ContentURL;
   parent.Notes.location.href = NotesURL;
}

function changeTitlePage(TitleURL){
   parent.Title.location.href = TitleURL;
}

function changeChildrenPage(ChildrenURL){
   parent.Children.location.href = ChildrenURL;
}

function changeContentPage(ContentURL){
   parent.Content.location.href = ContentURL;
}

function changeNotesPage(NotesURL){
   parent.Notes.location.href = NotesURL;
}

function changeThumbnailsPage(ThumbnailsURL){
   parent.Thumbnails.location.href = ThumbnailsURL;
}

