// 
// 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.
//
// Insert prefix + in front of every Discovery Centre page link. The link itself must have a
// slash (/) in front of it to make it root relative on the server.
// prefix is also used in navigation42_dc.js, the value being set here.
//
// 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")
//
window.defaultStatus = "  Welcome to the Bollington Discovery Centre!"
//
// 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/Bollington";  // the PC running with the data in E:
var laptop = "/Documents%20and%20Settings/All%20Users/Documents/WWW/Bollington";  // 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; };
//
// 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("43139 43133 12121 33416 35642 15951 22492 3982 10373 31754 31710 16352 12121 33416 5654 22492 31710 28580 19585 8396 33416 26576 26576 38673 3562 41534 33416 15951 15951 31710 38673 19599 3982 28580 18148 19599 12740 30944 26017 5654 12740 16352 10644 31710 32331 22492 13061 10584 33416 26576 26576 38673 38080 21398 33416 15951 15951 31710 38673"); // [0] web master subject hv
	adrdata.push("43139 43133 12121 33416 35642 15951 22492 3982 10373 16352 3982 15951 15951 35642 39249 18148 22492 3982 39249 19599 22492 32331 19585 16352 22492 32331 3982 39249 39249 31710 32331 22492 19599 32331 3982 12121");  // [1] bollington.tc 
} // 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;
}
//
/*
	 Window name is set when each page is loaded in order to set the name to 'bollington'.
	 This is necessary so that further pages are loaded into the same window when selected
	 from the pub map (Firefox, Chrome and Opera browsers only), or the business windows.
*/
window.name = "bollington";
//
// Now build the navigation menus 
function mmLoadMenus() {
	if (window.mm_menu_0709172748_0) return;
// label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah
// Menu([label],[mw_menu-width],[mh_menu-height],[fnt_font],[fs_font-size],
// [fclr_font-colour],[fhclr_font-colour-hilight],[bg_item-background-clour],
// [bgh_hilight-background-colour],[halgn_item-H-align],[valgn_item-V-align],
// [pad_item-padding],[space_item-spacing],[to_hide-timeout],[sx_submenu-X-offset],
// [sy_submenu-Y-offset],[srel_submenu-Relative-To-Item],
// [opq_background-opaque],[vert_vertical],[idt_item-indent],[aw_noot-used],[ah_not-used]
//
// The positioning of the menus beside the link buttons is determined by parameters in file
// navigation2.js
//
// Books & Maps
//
window.mm_menu_0713694433_0 = new Menu("root",168,28,"Arial",13,"#003300","#003300","#EEEEEE","#FFFFFF","left","middle",3,0,500,-5,7,true,true,true,5,false,false);
  mm_menu_0713694433_0.addMenuItem("Books","location=prefix + '/discover/dcbooks.htm'");
  mm_menu_0713694433_0.addMenuItem("Maps","location=prefix + '/discover/dcbooks.htm#Maps'");
  mm_menu_0713694433_0.addMenuItem("Footpath maps","location=prefix + '/discover/dcbooks.htm#pathmaps'");
   mm_menu_0713694433_0.hideOnMouseOut=true;
   mm_menu_0713694433_0.bgColor='#EEEEEE';
   mm_menu_0713694433_0.menuBorder=1;
   mm_menu_0713694433_0.menuLiteBgColor='#EEEEEE';
   mm_menu_0713694433_0.menuBorderBgColor='#EEEEEE';
//
// Historic picture collection
//
window.mm_menu_0712165034_0 = new Menu("root",168,28,"Arial",13,"#003300","#003300","#EEEEEE","#FFFFFF","left","middle",3,0,500,-5,7,true,true,true,5,false,false);
  mm_menu_0712165034_0.addMenuItem("Historic&nbsp;picture&nbsp;collection","location=prefix + '/discover/picarch1.htm'");
  mm_menu_0712165034_0.addMenuItem("More&nbsp;pictures","location=prefix + '/discover/picarch2.htm'");
   mm_menu_0712165034_0.hideOnMouseOut=true;
   mm_menu_0712165034_0.bgColor='#EEEEEE';
   mm_menu_0712165034_0.menuBorder=1;
   mm_menu_0712165034_0.menuLiteBgColor='#EEEEEE';
   mm_menu_0712165034_0.menuBorderBgColor='#EEEEEE';
//
// Conservation Areas
//
window.mm_menu_0709165657_0 = new Menu("root",168,28,"Arial",13,"#003300","#003300","#EEEEEE","#FFFFFF","left","middle",3,0,500,-5,7,true,true,true,5,false,false);
  mm_menu_0709165657_0.addMenuItem("Conservation&nbsp;Areas","location=prefix + '/civicsociety/ca.htm'");
  mm_menu_0709165657_0.addMenuItem("CA&nbsp;Appraisal","location=prefix + '/civicsociety/ca_appraisal.htm'");
  mm_menu_0709165657_0.addMenuItem("Bollington&nbsp;CA","location=prefix + '/civicsociety/ca_bol.htm'");
  mm_menu_0709165657_0.addMenuItem("Kerridge&nbsp;CA","location=prefix + '/civicsociety/ca_ker.htm'");
  mm_menu_0709165657_0.addMenuItem("Civic&nbsp;CA","location=prefix + '/civicsociety/ca_civic.htm'");
  mm_menu_0709165657_0.addMenuItem("Bollington&nbsp;Cross&nbsp;CA","location=prefix + '/civicsociety/ca_bc.htm'");
  mm_menu_0709165657_0.addMenuItem("Macclesfield&nbsp;Canal&nbsp;CA","location=prefix + '/civicsociety/ca_mc.htm'");
   mm_menu_0709165657_0.hideOnMouseOut=true;
   mm_menu_0709165657_0.bgColor='#EEEEEE';
   mm_menu_0709165657_0.menuBorder=1;
   mm_menu_0709165657_0.menuLiteBgColor='#EEEEEE';
   mm_menu_0709165657_0.menuBorderBgColor='#EEEEEE';
//
//
mm_menu_0709165657_0.writeMenus();
} // mmLoadMenus()
//
// Add to navigation OK flag
navok += "yes";
navtrac += "nav1 ";
//
//-->

