/*
 defined in ../index.html line 33 as at Saturday, 8 January 2005 4:27:15 p.m.
var openWindows = new Array;
    windowUpto = 0; */

function findWindow(windowName)
 {		

var  mainWindow = self;
 
  if (self.name != 'MainPage')
	 {
				if (opener == null) 	
					 {
					  return 'Not Present';
						}
						else
						{
						 mainWindow = opener;
						 }			 
   } // End. if (self.name != 'MainPage')
 	 
				  if ( (mainWindow == null) || (mainWindow.closed))
					             {return 'Not Present';}
				
	try{				
	 if ((mainWindow  != self) && (mainWindow.name == 'MainPage'))
	     {
			 	 
			 mainWindow.focus();
			 return 'Do Nothing More';
			 }
	    }// end try
			catch(e){return 'Not Present';}// case where opening window could be Outlook Express (from a link) !!
			finally{;}
			
	 for (i =0; i < mainWindow.openWindows.length; i++)
	    { 

			try{					
			if ( mainWindow.openWindows[i].name == windowName )
			     {
		         {return mainWindow.openWindows[i];}
					 }
					}// End. try
				catch(e){;}// case where the window has been closed
				finally {;}	 
			 }
			// alert('Open Target')
	   return null;
	  }
		
function processJump(clicked)
  {   	
			event.cancelBubble=true;
			
	 newWin = findWindow(clicked.target);

	 if (newWin =='Do Nothing More')
	      {
				return;
				}
	 
	 if (newWin == 'Not Present')
	       {
				 //alert('Not through MainPage');
				 if (top.location.href.indexOf('Apache') > 0 )
				      {top.location.href="C:/Apache/Apache/htdocs/Home Pages/New/800x600/index.html";} 
					else
					   if (top.location.href.indexOf('enry2') > 0 )		
						  {top.location.href="http://henry2/Home%20Pages/New/800x600/index.html";}
							else
							 {top.location.href="http://ie6.paulanorman.info/index.htm";}
				// was stem of  homepages.paradise.net.nz/~paulanor/trialIE6
				 return;
				  }
	 
	 if (newWin == null)
	 {
	 newWin = open(clicked.hreff, clicked.target)
	  windowUpto++;
	     openWindows[windowUpto] =newWin;  
	 }
	 

		
		/* newWin has been located, now check to see whether we have a new document to load or an existing one to display again */
		
     	var   re = /\\/g;  
	
		 oldpath = newWin.location.pathname.replace(re,'/');
		 lastSlash = oldpath.lastIndexOf('/');
		 oldpath= oldpath.substring(lastSlash, oldpath.length ); 	
		 
		 newpath = docPath+clicked.hreff.replace(re,'/');
		 lastSlash = newpath.lastIndexOf('/');
		 newpath= newpath.substring(lastSlash, newpath.length ); 		
		 
	//	  alert(oldpath +'\n\n'+ newpath)	
	
	
	// new document check	
		if (oldpath != newpath)
		     {newWin.location.href = docPath+clicked.hreff;}
	
	// now show the page	
					newWin.focus();

 }
				
		
function gotoMain(where)
 {
  
 				if (( opener != null) && (opener.closed==false))
				      {opener.focus();}
					else
					  {
						if ((where =='') || (where==null)) {where = '../index.html'}
						 location.href =	where;					
						 }		
 }		
 
function forceTop()
 {         
 
      if (location.search == '?allow'){return;}    
      
			if (top.location != self.location)
		    {
         top.location = self.location;
          return; }
			

 
     	var   re = /\\/g;  
	
		 path = location.href.replace(re,'/');

		 lastSlash = path.lastIndexOf('800x600');
		 path= path.substring(0,lastSlash ); 
     homePage = path + '800x600/index.html' ;
 
  				if (( opener == null) || (opener.closed==true) || (opener.name != 'MainPage'))
				      {
						
							alert('Welcome! \n\nRedirecting You to the Jesus Way - Main Page');
							//	alert(homePage);
							location.href =	homePage;
							location.target = '_top';
					
					}
 
 } 
 
 function releaseEntrapment()
  {
	  if (top.location != self.location)
		    {
         top.location = self.location;
           }
	}
 
 
function resize820x620()
 {
 window.resizeTo(820,620);
 } 
 
 function resizeSpecify(width, height)
 {
 window.resizeTo(width, height);
 window.moveTo(-22,-7);
 } 
 
 function closeWindows()
 {		
	 for (i =0; i < openWindows.length; i++)
	    { 

			try{					
			if ( openWindows[i].name != '' )
			     {
		         openWindows[i].close();
					 }
					}// End. try
				catch(e){;}// case where the window has been manually closed
				finally {;}	// nothing to do 
			 }// End.  for (i =0; i < openWindows.length; i++)
	  
	}