// Copyright © Kelta Systems 2002-2005 - All rights reserved
// The following code is used under license from Kelta Systems - www.kelta.co.uk
// compressed
/* 20050701 Licensed to The Whitehart Inn for use on www.whitehartinnbodmin.co.uk */
window.zMapsetsByName = new Object();
window.zMapsets = new Array();
window.zMapdefsByName = new Object();
window.zMapdefs = new Array();
window.zMap_default = "";
window.zCategories = new Object();
window.zDebug = false;
window.zRunOnLoad = new Array();
window.zScriptsLoaded = new Object();
if (document.all) {
 var docObj = "document.all.";
 var styleObj = ".style";
}
else {
 var docObj = "document.";
 var styleObj = "";
}
if (screen.height > '600') {var screen_res = 'xga'}
else {
if (screen.height > '480') {var screen_res = 'svga'}
 else {var screen_res = 'vga'}
}
// Credit: Jason Cranford Teague
isDHTML = 0; isLayers = 0; isAll = 0; isID = 0; isNN = 0; isIE = 0; isOther = 0;
if (document.getElementById) {isID = 1; isDHTML = 1}
else {
 if (document.all) {isAll = 1; isDHTML = 1}
 else {
  browserVersion = parseInt(navigator.appVersion);
  if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1}
 }
}
if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1) {isIE = 1}
else {
 if (navigator.appName.indexOf('Netscape') != -1) {isNN = 1}
 else {isOther = 1}
}
function findDOM(o,s) {// Credit: Jason Cranford Teague
 if (s == 1) {
  if (isID) {return (document.getElementById(o).style)}
  else {
   if (isAll) {return (document.all[o].style)}
   else {
    if (isLayers) {return (document.layers[o])}
   }
  }
 }
 else {
  if (isID) {return (document.getElementById(o))}
  else {
   if (isAll) {return (document.all[o])}
   else {
    if (isLayers) {return (document.layers[o])}
   }
  }
 }
}
function findTop(o) {// Credit: Jason Cranford Teague
 var domStyle = findDOM(o,1);
 if (domStyle.top) return domStyle.top;
 if (domStyle.pixelTop) return domStyle.pixeltop;
 var dom = findDOM(o,0);
 if (dom.offsetTop) return dom.offsetTop;
}
function findLeft(o) {// Credit: Jason Cranford Teague
 var domStyle = findDOM(o,1);
 if (domStyle.left) return domStyle.left;
 if (domStyle.pixelLeft) return domStyle.pixelLeft;
 var dom = findDOM(o,0);
 if (dom.offsetLeft) return dom.offsetLeft;
}

// Classes and functions -------------------------------------------------------

function KStitle(title) {
 if (title != null) {
  document.writeln('<DIV ALIGN="center" CLASS="KStitle">' + title.replace(/%20/g," ") + '<\/DIV>')
 }
}
function get_url_parameters(delimiter) {
 if (!delimiter) delimiter = "?";
 if (document.location.href) {
  var url = document.location.href
  if (url.indexOf(delimiter) != -1) {
   var parameters = url.substring(url.indexOf(delimiter)+1,url.length).split(delimiter); //alert("zTech - parameters=" + parameters);
   for (i = 0; i < parameters.length; i++) {
    if (parameters[i].indexOf("=") != -1) { // keyword=value found
     parameters[i] = parameters[i].split("=")
    }
   }
  }
  else {var parameters = new Array()}
 }
 return parameters
}
function htmlx(prologue,value,epilogue){
 var html = "";
 if (value != null) {
 	if (arguments[0] != null) {html = arguments[0] + value}
 	if (arguments[2] != null) {html = html + arguments[2]}
 }
  return html
}
function load_script(script) { //alert('script=' + script);
 var html = '<SCRIPT LANGUAGE="javascript1.1" TYPE="text\/javascript" SRC="' + script + '.js"><\/SCRIPT>';
 document.writeln(html); //alert(html);
}
function parse_parameters(o,parameters){
 if (o != null && parameters != null) {
 	o.parameters = parameters; //	alert('Obj=' + o + ' parameters=' + parameters);
  var args = parameters.split(',');
  for (var argn = 0; argn < args.length; argn++) {
   var parameter = args[argn].substring(0,args[argn].indexOf('='));
   var v = args[argn].substring(args[argn].indexOf('=')+1,args[argn].length);
   if (isNaN(parseInt(v*1)) == false) v = parseInt(v); /* Ensure that numeric values have correct data type */
    switch(parameter) {
     case "align":    if (v != null) {o.align = v} break;
     case "background": if (v != null) {o.background = v} break;
     case "bgcolor":   if (v != null) {o.bgcolor = v} break;
     case "bullet":   if (v != null) {o.bullet = v} break;
     case "border":   if (v != null) {o.border = v} break;
 // showcaption: controls display of captions on graphics: true | false
     case "showcaption": if (v != null) {o.showcaption = v} break;
 // caption: overiddes graphics caption: null | text
     case "caption": if (v != null) {o.caption = v} break;
     case "cssclass":  if (v != null) {o.cssclass = v} break;
 // controls: controls (sic) the display of controls on graphics
     case "controls":  if (v != null) {o.controls = v} break;
     case "coords":   if (v != null) {o.coords = v} break;
 // showdelay: number of seconds delay before display of graphic: 0 | n microseconds
     case "showdelay":  if (v != null) {o.showdelay = v} break;
 // showspeed: number of seconds delay before display of next graphic: 7000 | n microseconds
     case "showspeed":  if (v != null) {o.showSpeed = v} break;
     case "showspeedinitial":  if (v != null) {o.showSpeedInitial = v} break;
     case "showloop":  if (v != null) {o.showLoop = v} break;
 // seq: controls the position that aparticular list item will be displayed:
     case "seq":     if (v != null) {o.seq = v} break;
 // order: controls the order in which list items are displayed: default | sequence
     case "order":    if (v != null) {o.order = v} break;
     case "dir":     if (v != null) {o.dir = v} break;
     case "fill":    if (v != null) {o.fill = v} break;
     case "height":   if (v != null) {o.height = v} break;
     case "href":    if (v != null) {o.href = v} break;
     case "html":    if (v != null) {o.html = v} break;
     case "img":     if (v != null) {o.img = v} break;
     case "imgborder":  if (v != null) {o.imgborder = v} break;
     case "name":    if (v != null) {o.name = v} break;
     case "mode":    if (v != null) {o.mode = v} break;
     case "onclick":   if (v != null) {o.onclick = v} break;
     case "orientation": if (v != null) {o.orientation = v} break;
     case "overlay":   if (v != null) {o.overlay = v} break;
 // position: popups display position to: relative - relative to click
 //                    maximise - maximised relative to click
     case "position":  if (v != null) {o.position = v} break;
 // resolve: images should be extracted from resoltion dependent directory
     case "resolve":   if (v != null) {o.resolve = v} break;
 // retain: popups to be retained until next popup
     case "retain":   if (v != null) {o.retain = v} break;
 // rollover: image to be displayed ONMOUSEOVER
     case "rollover":  if (v != null) {o.rollover = v} break;
 // shape: <AREA> shape
     case "shape":    if (v != null) {o.shape = v} break;
     case "status":   if (v != null) {o.status = v} break;
     case "style":    if (v != null) {o.style = v} break;
     case "target":   if (v != null) {o.target = v} break;
     case "text":    if (v != null) {o.text = v} break;
     case "trace":    if (v != null) {o.trace = v} break;
     case "title":    if (v != null) {o.title = v} break;
     case "width":    if (v != null) {o.width = v} break;
 // xpos: popup position x-coord -
     case "xpos":    if (v != null) {o.xpos = v} break;
 // ypos: popup position y-coord -
     case "ypos":    if (v != null) {o.ypos = v} break;
 // following for zDirectory
     case "parent":   if (v != null) {o.parent = v} break;
     case "entries":   if (v != null) {o.entries = v} break;
     case "subcategories":   if (v != null) {o.subcategories = v} break;
     case "pad":     if (v != null) {o.pad = v} break;
     case "valign":   if (v != null) {o.valign = v} break;
     case "preload":   if (v != null) {o.preload = v} break;
     case "debug":    if (v != null) {o.debug = true} break;
     case "lowsrc":   if (v != null) {o.lowsrc = v} break;
     case "controlpos":   if (v != null) {o.controlpos = v} break;
    default:
     alert('Invalid parameter \'' + o + '.' + parameter + '\' specified')
    break;
   }
 	}
 }
}
function resolution(v) {
 if (v != null) { if (screen.width < 1024) var r = Math.round(v * screen.width / 1024); else r = v; }
 else { r = 'xga'; if (screen.width < '1024') r = 'svga'; else { if (screen.width < '800') r = 'vga'; } }
 return r;
}
function resolve(args){var result = null; for (var a = 0; a < arguments.length; a++) {if (arguments[a] != null) {result = arguments[a]}}	return result;}
function resolve_coords(parameters) {
 var res = ''
 var args = parameters.split(',');
 for (var a = 0; a < args.length; a++) {
  var coord = Math.round(args[a] * screen.width / 1024);
  res = res + coord;
  if (a < args.length - 1) res = res + ','
 }
 return res;
}
function KSimage(name,src,height,width,other) {
 if (name != '') {name = ' NAME="' + name + '"'}
 if (src != '') {src = ' SRC="' + src + '"'}
 if (height != '') {height = ' HEIGHT="' + Math.round(screen.height / 768 * height) + '"'}
 if (width != '') {width = ' WIDTH="' + Math.round(screen.width / 1024 * width) + '"'}
 document.write('<IMG' + name + src + height + width + ' ' + other + '>');
 return ''
}
function zPreload(file) {var preload = new Image; preload.src = file;}
function zBounce(url) {if ((url != null) && (url != '')) {if (top.location == self.location) top.location.href = url;}}
function zSearch(arg) { listPropertiesXyz(arg);
 var sarg = arg.toLowerCase()
 window.zDirectory = top.frames['directory'].window
 var nodeset = zDirectory.zNodesets[0];
 var cnode = nodeset.zNodesByName['root'];
 var sbu = new Array();
 for (var i = 0; i < cnode.subscribers.length; i++) {
  var sub = nodeset.zSubsByName[cnode.subscribers[i]]; listPropertiesXyz(sub.name);
  var found = '';
  if (sub.description.toLowerCase().indexOf(sarg) > -1) found = sub.description;
  else {
   if (sub.title.toLowerCase().indexOf(sarg) > -1) found = sub.title;
   else {
    if (sub.pd) {
     if (sub.pd.toLowerCase().indexOf(sarg) > -1) found = sub.pd;
    }
   }
  }
  if (found != '') { listPropertiesXyz(sub);
   var j = sbu.length;
   sbu[j] = sub
  }
 }
 var sbus = sbu.sort(); //listPropertiesXyz(sbus);
 if (sbus.length > 0) {
 }
 return true;
}
function zRoll(name,image,layer) {if (document.images) {var dom = findDOM(name,1); if (dom.zIndex == 1000) dom.zIndex = layer; else dom.zIndex = 1000; document[name].src = image;}}
function zListP(o,t) {
 if (typeof t == 'undefined') t = '';
 w = window.open('','console','toolbar=yes,location=yes,scrollbars=yes,resizable=yes,menubar=yes');
 w.document.write('<html><head><title>zListP<\/title><\/head><body bgcolor=#FFFF99><h3>zListP(typeof=' + typeof o + ' ' + t + ' ' + o + '\)<\/h3>');
 if (typeof o != 'undefined') {
  if (typeof o != 'string') {
   if (typeof o.length != 'undefined') {
     w.document.write('length=' + o.length + '<br>')
   }
   else {
    for (var i in o) {
     if (eval('typeof o.' + i) != 'unknown') w.document.write(i + '=' + eval('o.' + i) + '<br>');
    }
   }
  }
 }
 w.document.write('<\/body><\/html>');
 w.focus()
}
function zOnLoad() {if (zRunOnLoad.length > 0) { for (var i = 0; i < zRunOnLoad.length; i++) { eval(zRunOnLoad[i]) } } }
function zAddRunOnLoad(p) {zArray('zRunOnLoad',p)}
function zArray(a,v,x,k,o) { if (typeof o == 'undefined') o=1; var i = a.length; if ((typeof x != 'undefined') && (typeof k != 'undefined')) { if ((o==1) && (x[k])) {i = x[k]; } x[k] = i; } a[i] = v;}
function zParse(o,p,vk,vka){
 if (o != null && p != null) {
  o.parameters = p
  var args = p.split(',');
  for (var i = 0; i < args.length; i++) {
   var ka = args[i].substring(0,args[i].indexOf('='));
   var v = args[i].substring(args[i].indexOf('=')+1,args[i].length);
   if ((ka == '') && (v !='')) {ka = v; v = 1;}
   if (v == '') ;
   else if (isNaN(parseInt(v*1)) == false) v = parseInt(v);
   if (vk[ka] != null) {
    eval('o.' + vk[ka] + '= v');
   }
   else {
    if (vka[ka] != null) {
     if (!eval('o.' + vka[ka])) eval('o.' + vka[ka] + ' = new Array()');
     var j = eval('o.' + vka[ka] + '.length');
     eval('o.' + vka[ka] + '[j] = v');
    }
    else alert('Invalid parameter \'' + ka + '\' in parameters \'' + p + '\'');
   }
  }
 }
}
function zDefineValidKeywords(k){
 vk = new Object();
 if (k != null) {
  var ka = k.split('!');
  for (var i = 0; i < ka.length; i++) {
   if (ka[i].indexOf(',') > -1) {
    kas = ka[i].split(',');
    vk[kas[0]] = kas[1];
   }
   else vk[ka[i]] = ka[i];
  }
 }
 return vk;
}
function zLoadScript(n){
 zScriptLoaded[n] = false;
 var html = '<scr' + 'ipt language="Javascript1.1" type="text\/javascript" src="' + n + '.js"><\/scr' + 'ipt>';
 document.writeln(html);
}
function zScriptLoaded(n){
 if (window.zScriptsLoaded) {
  window.zScriptsLoaded[n] = true;
 }
}
function zCheckScriptLoaded(n){
 if (window.zScriptsLoaded) {
  if (window.zScriptsLoaded[n] == true) return true;
 }
 return false;
}
zScriptLoaded('zTech');