// 1k DHTML API
d=document;l=(d.layers)?1:0;op=navigator.userAgent.toLowerCase().indexOf('opera')!=-1;
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e]){return V[e]};for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){if(l)e.visibility='show';else e.style.visibility='visible';}
function hE(e){if(l)e.visibility='hide';else e.style.visibility='hidden';}
function sZ(e,z){if(l)e.zIndex=z;else e.style.zIndex=z;}
function sX(e,x){if(l)e.left=x;else if(op)e.style.pixelLeft=x;else e.style.left=x;}
function sY(e,y){if(l)e.top=y;else if(op)e.style.pixelTop=y;else e.style.top=y;}
function sW(e,w){if(l)e.clip.width=w;else if(op)e.style.pixelWidth=w;else e.style.width=w;}
function sH(e,h){if(l)e.clip.height=h;else if(op)e.style.pixelHeight=h;else e.style.height=h;}
function sC(e,t,r,b,x){if(l){X=e.clip;X.top=t;X.right=r;X.bottom=b;X.left=x;}else e.style.clip='rect('+t+' '+r+' '+b+' '+x+')';}
function wH(e,h){if(l){Y=e.document;Y.write(h);Y.close();}if(e.innerHTML)e.innerHTML=h;}

// 1k DHTML API - Extended Functions
// author:tim morgan <mailto:tim@timmorgan.info>
// modified Oct.22/2001 by tim glen <tim@javelindigital.com>
dom=(document.getElementById)?1:0;ie4=(d.all&&!dom)?1:0;ie5=(d.all&&dom)?1:0;ie=(d.all)?1:0;nn=(d.layers)?1:0;ns6=(dom&&navigator.appName=="Netscape")?1:0;
function sP(e,x,y){sX(e,x);sY(e,y)}
function sS(e,w,h){sW(e,w);sH(e,h)}
function aE(o,e,f,c){if(o.addEventListener)o.addEventListener(e,f,c);else if(o.attachEvent)o.attachEvent("on"+e,f);else eval("o.on"+e+"="+f)}
function docW(){return ie&&d.body.clientWidth||innerWidth||0}
function docH(){return ie&&d.body.clientHeight||innerHeight||0}
var ua=navigator.userAgent.toLowerCase();
if (ie && ua.indexOf("win")>-1) {
	menu_offset_x = 0;
	menu_offset_y = 8;
} else if (ie && ua.indexOf("mac")>-1) {
	menu_offset_x = 0;
	menu_offset_y = 8;
} else if (ie) {
	menu_offset_x = 10;
	menu_offset_y = 40;
} else if (nn) {
	menu_offset_x = 0;
	menu_offset_y = 8;
} else {
	menu_offset_x = 0;
	menu_offset_y = 8;
}
function getPos(p,c) {if(dom||ie){var current=(dom)?document.getElementById(p):eval('document.images["'+p+'"]');posx=0;posy=0;while(current.offsetParent!=null){posx+=current.offsetLeft;posy+=current.offsetTop;current=current.offsetParent;}}else if(nn){posx=eval('document.layers["'+c+'"].document.images["'+p+'"].x');posy=eval('document.layers["'+c+'"].document.images["'+p+'"].y');}posx+=menu_offset_x;posy+=menu_offset_y;plchld=new Array(posx, posy);return plchld;}

// 1k DHTML API - Menu System (requires 1k.js, ext.js)
// author:tim glen <tim@javelindigital.com>
var test = false;
var m_o = new Array(3); // an array to contain either null or the id of the menu(s) currently open
var m_on = false; // boolean to tell whether any menu is currently 'on'
var m_width = new Array(3); // an array to contain menu widths for positioning
m_width[0] = 169;
m_width[1] = 169;
m_width[2] = 169;
var menusloaded = false;

function cM(m,x,y) {m=gE(m);sP(m,x,y);}
function sM(){
 if(test) {str = '';for (i=0;i<sM.arguments.length;i++) {str += sM.arguments[i];if (i+1<sM.arguments.length) str += ',';}window.status = str;}
 p=sM.arguments[0];s=sM.arguments[1];t=sM.arguments[2];lvl=sM.arguments.length;
 if(menusloaded){cTM();
  if(lvl==1){hideMenu('primary');m_o[0]=p;p=gE(p);if(p)sE(p);
  }else if(lvl==2){hideMenu('secondary');m_o[1]=s;s=gE(s);if(s)sE(s);
  }else if(lvl==3){hideMenu('tertiary');m_o[2]=t;t=gE(t);if(t)sE(t);
  }else if(lvl==0){cTM();}
 }
}
function hideMenu(ctrl) {
 if(ctrl=='primary'){if (m_o[0])hM(m_o[0]);if (m_o[1])hM(m_o[1]);if (m_o[2])hM(m_o[2]);m_o[0] = null;m_o[1] = null;m_o[2] = null;
 }else if(ctrl=='secondary'){if (m_o[1])hM(m_o[1]);if (m_o[2])hM(m_o[2]);m_o[1] = null;m_o[2] = null;
 }else if(ctrl=='tertiary'){if (m_o[2])hM(m_o[2]);m_o[2] = null;
 }else if(ctrl=='all') {for(i=m_o.length-1;i>=0;i--){if (m_o[i]) hM(m_o[i]);}
 }
}
function hM(m) {m=gE(m);if(m)hE(m);}
function cTM() {clearTimeout(m_on);}
function tM() {m_on=setTimeout("hideMenu('all')", 800);}
function fixPos(posi) {if (posi[0] + m_width[0] > docW()) posi[0] = docW()-m_width[0];return posi;}
function initMenus(){
	pos=getPos('mp'+1, 'MENUBAR');pos=fixPos(pos);pos[1]-=8;
	cM('menu'+1,pos[0],pos[1]);

	pos=getPos('mp'+2, 'MENUBAR');pos=fixPos(pos);pos[1]-=8;
	cM('menu'+2,pos[0],pos[1]);

	pos=getPos('mp'+3, 'MENUBAR');pos=fixPos(pos);pos[1]-=8;
	cM('menu'+3,pos[0],pos[1]);


	menusloaded = true;
}

