// 
// File containing variable items for placement in the head of the page
// NOTE that location addresses are constructed as absolute addresses using a variable 
// This enables the navigation stack to be used in any folder relative to the root and 
// in test on the home PC as well as on the operational server.
//
// NOTE! The call to this file must come after any coded email entries in the page!!!
//
<!--
// First comes the Netscape resize fix from Dreamweaver (must come first)
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//
// Next disable right mouse click (stops copying of pictures)
var temp="";
function clickStop1() {
	if (document.all) {
		(temp);return false; } }
function clickStop2(a) {
	if (document.layers||(document.getElementById&&!document.all)) {
		if (a.which==2||a.which==3) {
			(temp);return false; } 	} }
if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickStop2;}
else{document.onmouseup=clickStop2;document.oncontextmenu=clickStop1;}
document.oncontextmenu=new Function("return false")
//
// Now determine whether we are running on the PC or on the live server
var prefix = "";  // for the live server add nothing
var local  = "file:///E:/WWW/Boddington";  // the PC running with the data in E:
var laptop = "/Documents%20and%20Settings/All%20Users/Documents/WWW/Boddington";  // the laptop
//
var source = parent.location.href.substring(0,4);
if (source == "file") {prefix = local; };
var source = parent.location.href.substring(39,43);
if (source == "Users") {prefix = laptop; };
//
// Copyright years
var copyrightyears = "2000-2009";
//
// Default family name
var family = "Boddington"; // so we don't have to reload whole Boddington site!
//
// Now the email crypt fix
/*
   Default email addresses. On any page having more than webmaster (and town hall) there 
  	will be a full set of coded addreses. Any page having only webmaster (and town hall) 
  	will rely on this default set of addresses.
  
   In navigation1.js the data setting is conditional. The special needs are provided for 
  	in the pages themselves prior to the call to navigation1.js (which is template driven). 
  	In these cases the data from navigation1.js will be ignored and not loaded. The test is 
  	to see if adrdata already exists
*/
if(!adrdata) {
	var adrdata = new Array(); // for email addresses
	adrdata.push("3379 3373 1744 2837 365 1852 2478 1652 1255 987 2172 563 1744 2837 641 2478 2172 135 500 563 1652 1671 1671 365 2399 1539 2478 1652 2399 1135 2645 2837 1744 365 1852 324 1790 1652 135 1539 1790 2297 1073 63 641 2297 563 456 2172 2610 2478 867 16 1652 1671 1671 365 2399 1539 2478 1652 2399 1985 2645 2837 1744 365 1852 324");  // [0] webmaster - at - boddington-family.org.uk
} // Must follow all adrdata entries
//
// This script is (c) copyright 2008 by Dan Appleman under the
// GNU General Public License (http://www.gnu.org/licenses/gpl.html)
// This script is modified from an original script by Jim Tucek
// For more information, visit www.danappleman.com 
// Leave the above comments alone!
//
var decryption_cache = new Array();
function decrypt_string(crypted_string,n,decryption_key,just_email_address) {
	var cache_index = "'"+crypted_string+","+just_email_address+"'";
	if(decryption_cache[cache_index])	
		return decryption_cache[cache_index];	
	if(adrdata[crypted_string])	
		var crypted_string = adrdata[crypted_string];	
	if(!crypted_string.length)	
		return "Error, not a valid index.";
	if(n == 0 || decryption_key == 0) {	
		var numbers = crypted_string.split(' ');	
		n = numbers[0];	decryption_key = numbers[1];	
		numbers[0] = ""; numbers[1] = "";	
		crypted_string = numbers.join(" ").substr(2);
		}
	var decrypted_string = '';
	var crypted_characters = crypted_string.split(' ');
	for(var i in crypted_characters) {
		var current_character = crypted_characters[i];
		var decrypted_character = exponentialModulo(current_character,n,decryption_key);
		if(just_email_address && i < 7) 
			continue;
		if(just_email_address && decrypted_character == 63) 
			break;
		decrypted_string += String.fromCharCode(decrypted_character);
		}
	decryption_cache[cache_index] = decrypted_string; 
	return decrypted_string;
}
function sendmsg(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;
	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,false);
	parent.location = decrypted_string;
}
function decrypt_and_echo(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;
	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,true);
	document.write(decrypted_string);
	return true;
}
function exponentialModulo(base,exponent,y) {
	if (y % 2 == 0) {
		answer = 1;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	} else {
		answer = base;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	}
	return answer;
}
//
// Add to navigation OK flag
navtrac += "nav1 ";
//
//-->
