//alert(document.location);
/*
s=document.location;
if (s.substr(0,5)=="http://") i=s.indexOf('/',7); else if (s.substr(0,5)=="http://") i=s.indexOf('/',7); 

alert(s.substr(0,i);
//s=parent.location; if (s.substr(0,5)=="http:")
}
*/

// Defaults
if (window.libflags===undefined) libflags=0;
if (window.pathdepth===undefined) pathdepth=0;
if (window.menuflags===undefined) menuflags=0;
if (window.styletype===undefined) styletype='std';
clickedtag=undefined;clickedtagstyle=undefined;
if (window.submenucolor===undefined) {submenucolor=(styletype=='rev')?'white':'black';}
	
//Styles
s="\
<style type=\"text/css\">\
img {-ms-interpolation-mode:bicubic;}\
\
 @media screen {\
 .Menu{display:inline;padding:.25em;border-left-width:1px;border-left-style:solid;border-left-color:#808080;cursor:pointer;width:auto;height:1em;left:auto;height:auto; text-align:center; font-family:Verdana; font-style:normal; font-size:13px;color:#000000; text-decoration:none; text-decoration:none;}\
 .MenuH:hover{background-color:#cccc66}\
.MenuY {border-bottom: 2px solid #cc6600}\
.MenuNew{ text-align:center; font-family:Verdana; font-style:normal; font-size:13px; color:#000000; text-decoration:none; background-color:#d8d830; padding:3px; border-style:outset; border-color:#e8e8ff; border-width:3px}\
.MenuNew:hover{color:#ffffff; background-color:#3366CC; border-style:inset; border-color:#3366CC; border-width:3px }\
.Menu A {text-decoration:none;color:#000000;}\
.Icon {width:1em;height:1em;border-style:none}\
.Icon150 {width:1.5em;height:1.5em;border-style:none}\
.PrintOnly{display:none;}"
+((styletype=='std')?"\
 Body {background:#ffffff; color:#000000; font-size:13px; margin-left:30px; margin-right:30px; font-family:Arial; text-align:justify;}\
 A:link {color:#0000ff}\
 A:visited {color:#000080}\
 A:active {color:#800000}\
 A.AddMenu {color:white; font-weight:bold; border:1; border-color:blue; border-style:solid; text-decoration:none; background-color:blue;}\
":'')
+((styletype=='res')?"\
 Body {background:#ffffff; color:#000000; font-size:13px; margin-left:30px; margin-right:30px; font-family:Arial; text-align:justify;}\
 A:link {color:#0000ff}\
 A:visited {color:#000080}\
 A:active {color:#800000}\
 H2 {color:#000080}\
 A.AddMenu {color:white; font-weight:bold; border:1; border-color:blue; border-style:solid; text-decoration:none; background-color:blue;}\
":'')
+((styletype=='rev')?"\
 Body {background:#002000; font-size:13px; margin-left:30px; margin-right:30px; color:#ffff60; text-align:justify;}\
 A:link {color:#33ccff}\
 A:visited {color:#9933cc}\
 A:active {color:#ffcc33}\
 H1 {color:#ccff99}\
 H2 {color:#000080}\
 .H1 {font-size:150%;color:#ccff99;font-weight:bold;padding-top:6px;text-align:center}\
 .H2 {font-size:150%;font-weight:bold;padding-top:6px;color:#99ffff}\
 A.AddMenu {color:white; font-weight:bold; border:1; border-color:blue; border-style:solid; text-decoration:none; background-color:blue;}\
":'')
+"\
}\
\
 @media print {\
 .ScreenOnly{display:none;}\
 .PrintOnly{display:inline;}\
 Body {margin-left:0px; margin-right:0px}\
 A.AddMenu {font-weight:bold;}\
 A:link {color:#000000}\
 A:visited {color:#000000}\
 A:active {color:#000000}\
}\
</style>";

//alert(s);
document.write(s);

function libtest() {
alert('Library Loaded!');
}

function dosubmenu() {
if (self===self.top) {menuflags|=4;domenu();}
return (self===self.top)?1:0;
}

function domenu() {
// menuflags: 1 indexM.htm?  2 Target=Show    4 [Glue Menu]
pfx='';for(i=1;i<=pathdepth;i++) pfx+='../';

s=document.URL;i=s.indexOf('?');if (i>=0) s=s.substring(0,i);
h='';
if ((menuflags&2)>0) {h=' Target=Show';}
h+=' HRef="';
if ((menuflags&1)>0) {h+=pfx+'indexM.htm?';}
h+=pfx;
if ((menuflags&4)>0) h=" style='color:"+submenucolor+"'"+h;
td="<td class='Menu MenuH' onmousedown='clicked(this)'>";

document.write("\
<table id='Menu' border='0' cellspacing='0' cellpadding='0' style='padding-top:.25em;padding-bottom:.25em;left:auto;height:auto;width:auto;height:auto;'><tr valign=middle>"+
(((menuflags&4)>0)?"\
<td class=ScreenOnly><a href=\""+pfx+"indexM.htm?"+document.location+"\" style='color:white;  font-size:10px;  font-weight:bold;  border:0; padding:1px; text-decoration:none;  background-color:#993366; margin-right:3px' title='Fix menu to the top of the screen'>GLUE&nbsp;MENU</a></td>"
:'')+
td+"<a style='color:"+submenucolor+"' onclick=\"self.top.location='index.htm'\" Title=\"Home Page\">Home</a></td>"+
td+"<a"+h+"Contact.htm\" Title=\"Contact Details for different CED Depots\">Contact</a></td>"+
td+"<a"+h+"SuppliesWebProductsIndex.htm\" Title=\"Online Product Brochure Browser, Searcher and Datasheets\">Products</a></td>"+
td+"<a"+h+"SuppliesWebProjects.php\" Title=\"Online Project Exhibition and Searcher\">Projects</a></td>"+
td+"<a"+h+"Gallery.php\" Title=\"Stone Gallery\">Gallery</a></td>"+
td+"<a"+h+"Resources.htm\" Title=\"Useful Documents and Resources for Downloading or Printing\">Resources</a></td>"+
td+"<a"+h+"Brochure1.htm\" Title=\"Request a Brochure in the Post\">Brochure</a></td>"+
td+"<a"+h+"Ced.htm\" Title=\"Description of CED and its History\">C.E.D.</a></td>"+
td+"<a"+h+"Vacancies.htm\" Title=\"Current Vacancies Available\">Vacancies</a></td>"+
td+"<a"+h+"links/index.htm\" Title=\"Useful Links to the Web\">Links</a></td>"+
td+"<a style='color:"+submenucolor+"' target=CEDOnlineStore HRef=\"http://ced.ltd.uk/acatalog/\" Title=\"Online Store\">eStore</a></td>"+
td+"<a"+h+"MenuFull.htm\" Title=\"Help and Expanded Menu\">Help</a></td>\
</tr></table>");
// inline div within inline div fails in internet explorer when zoom is changed
}

function clicked(tag) {
if (clickedtag!==undefined) clickedtag.className='Menu MenuH';
tag.className='Menu MenuH MenuY';
clickedtag=tag;//clickedtagstyle=tag.style.backgroundColor;
}

function domenubckgrd() {
document.write("<img id='MenuBack' src='buttonm.png' alt='' style='position:absolute;z-index:1;display:none;'>");
domenubckgrdsize();
if ((libflags&1)==0) window.onresize=domenubckgrdsize;
}

function domenubckgrdsize() {
var oMenu=document.getElementById('Menu');
var oBack=document.getElementById('MenuBack');
var oMenuBase=oMenu.offsetParent;
oBack.style.top=(oMenuBase.offsetTop+oMenu.offsetTop)+'px';
oBack.style.left=(oMenuBase.offsetLeft+oMenu.offsetLeft)+'px';
oBack.style.width=oMenu.offsetWidth+'px';oBack.style.height=oMenu.offsetHeight+'px';
oBack.style.display='';
}

function doback() {
document.write("<div style='color:blue;text-decoration:underline;cursor:pointer' onclick='history.back()'>Back</div>");
}

function dofooter() {
document.write("<span Class=PrintOnly><br /><hr /><Small>CED Ltd, 728 London Road, West Thurrock, Grays, Essex RM20 3LU &bull; Tel:&nbsp;+44&nbsp;(0)1708&nbsp;867&nbsp;237 &bull; sales"+'@'+"ced.ltd.uk &bull; www.ced.ltd.uk &bull; Registered&nbsp;Company&nbsp;624843 (Eng & Wales)</Small></span>");
}

/*
<script language='javascript' type='text/javascript' src='lib.js'></script>
<script language='javascript' type='text/javascript'>dosubmenu();</script>
<script language='javascript' type='text/javascript'>dofooter();</script>

<script language='javascript' type='text/javascript' src='../lib.js'></script>
<script language='javascript' type='text/javascript'>pathdepth=1;dosubmenu();</script>
<script language='javascript' type='text/javascript'>dofooter();</script>

<script language='javascript' type='text/javascript'>styletype='res';</script>
*/

// MOUSE
function mouseX(e,t) {
if (!document.all)  return e.pageX-t.offsetParent.offsetLeft;else return e.clientX-t.offsetParent.offsetLeft;
}
function mouseY(e,t) {
if (!document.all)  return e.pageY-t.offsetParent.offsetTop;else return e.clientY-t.offsetParent.offsetTop;
}

// EMAIL
function Emailf(s) {
s=s.substring(0,s.indexOf('#'))+'@'+s.substring(s.indexOf('#')+1,s.length);
document.write('<a href="mailto:'+s+'">'+s+'<\/a>');
}

function emailf(d,u,t) {s=u+unescape('%40')+d;document.write('<a href="mailto:'+s+'">'+((t>'')?t:toHtml(1,s))+'<\/a>');}

function toHtml(iFlags,s) { // consider using node.textContent=
if ((iFlags&2)>0) {if (s.substr(0,1)=='=') return s.substr(1);}
if ((iFlags&7)>0) s=s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\r\n/g,'<br>');
if ((iFlags&4)>0) s=s.replace(/'/g,'&#39;').replace(/"/g,'&#34;');
return s;
}

function WriteMail(flags,to,cc,subj,body,xtrattribs,title) {
// 1 Open <A   2 HREF PreEpi   4 >      8 Use Email for Title if no title   16 </A>
to=DecodeMail(to);
qry=(
((cc>'')?'&cc='+DecodeMail(cc):'')
+((subj>'')?'&Subject='+encodeURIComponent(subj):'')
+((body>'')?'&Body='+encodeURIComponent(body):'')
).substr(1);
document.write(
(((flags&1)>0)?'<a ':'')
+' '+xtrattribs
+(((flags&2)>0)?'href="mailto:':'')
+to
+((qry>'')?'?'+qry:'')
+(((flags&2)>0)?'"':'')
+(((flags&4)>0)?'>':'')
+((title>'')?title:(((flags&8)>0)?to:''))
+(((flags&16)>0)?'<\/a>':'')
);
}

function DecodeMail(s) {
return s.substring(0,s.indexOf('#'))+'@'+s.substring(s.indexOf('#')+1,s.length);
}

// ========================== TIPS ==========================

// <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="tips.js"></SCRIPT>
// maketip('Index','Hauptseite','Zurück zu Knopper.Net');
// <a class="subnav" href="/knoppix-links/" onMouseOver="tip('knoppix-links'); return true;" onMouseOut="untip(); return true;">Links</a>
// Bubblehelp infoboxes, (C) 2002 Klaus Knopper <infobox@knopper.net>
// You can copy/modify and distribute this code under the conditions
// of the GNU GENERAL PUBLIC LICENSE Version 2.
//
var IWIDTH=250  // Tip box width
var ns4         // Are we using Netscape4?
var ie4         // Are we using Internet Explorer Version 4?
var ie5         // Are we using Internet Explorer Version 5 and up?
var kon         // Are we using KDE Konqueror?
var x,y,winW,winH  // Current help position and main window size
var idiv=null   // Pointer to infodiv container
var px="px"     // position suffix with "px" in some cases

function nsfix(){setTimeout("window.onresize = rebrowse", 2000);}

function rebrowse(){window.location.reload();}

function hascss(){ return gettip('infodiv')?true:false }

function infoinit(){
 ns4=(document.layers)?true:false, ie4=(document.all)?true:false;
 ie5=((ie4)&&((navigator.userAgent.indexOf('MSIE 5')>0)||(navigator.userAgent.indexOf('MSIE 6')>0)))?true:false;
 kon=(navigator.userAgent.indexOf('konqueror')>0)?true:false;
 x=0;y=0;winW=800;winH=600;
 idiv=null;
 document.onmousemove = mousemove;
 if(ns4&&document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
 // Workaround for just another netscape bug: Fix browser confusion on resize
 // obviously conqueror has a similar problem :-(
 if(ns4||kon){ nsfix() }
 if(ns4) { px=""; }
}

function untip(){
 if(idiv) idiv.visibility=ns4?"hide":"hidden";
 idiv=null;
}

function gettip(name){return (document.layers&&document.layers[name])?document.layers[name]:(document.all&&document.all[name]&&document.all[name].style)?document.all[name].style:document[name]?document[name]:(document.getElementById(name)?document.getElementById(name).style:0);}

// Prepare tip boxes, but don't show them yet
function maketip(name,title,text){
 if(hascss()) document.write('<div id="'+name+'" name="'+name+'" style="position:absolute; visibility:hidden; z-index:20; top:0'+px+'; left:0'+px+';"><table width='+IWIDTH+' border=0 cellpadding=2 cellspacing=0 bgcolor="#333399"><tr><td class="tiptd"><table width="100%" border=0 cellpadding=0 cellspacing=0><tr><th><span class="ptt"><b><font color="#FFFFFF">'+title+'</font></b></span></th></tr></table><table width="100%" border=0 cellpadding=2 cellspacing=0 bgcolor="#CCCCFF"><tr><td><span class="pst"><font color="#000000">'+text+'</font></span></td></tr></table></td></tr></table></div>'+"\n");
}

function tip(name){
 if(hascss()){
  if(idiv) untip();
  idiv=gettip(name);
  if(idiv){
   winW=(window.innerWidth)? window.innerWidth+window.pageXOffset-16:document.body.offsetWidth-20;
   winH=(window.innerHeight)?window.innerHeight+window.pageYOffset  :document.body.offsetHeight;
   if(x<=0||y<=0){ // konqueror can't get mouse position
    x=(winW-IWIDTH)/2+(window.pageXOffset?window.pageXOffset:0); y=(winH-50)/2+(window.pageYOffset?window.pageYOffset:0); // middle of window
   }
   showtip();
  }
 }
}

function showtip(){
  idiv.left=(((x+260)<winW)?x+12:x-255)+px; idiv.top=(((y+90)<winH)?y+12:y-90)+px;
  idiv.visibility=ns4?"show":"visible";
//  window.status="idiv="+idiv+"X:"+(idiv.left?idiv.left:"NAN")+", Y:"+(idiv.top?idiv.top:"NAN")+", x:"+x+", y:"+y;
}

function mousemove(e){
 if(e)   {x=e.pageX?e.pageX:e.clientX?e.clientX:0; y=e.pageY?e.pageY:e.clientY?e.clientY:0;}
 else if(event) {x=event.clientX; y=event.clientY;}
 else {x=0; y=0;}
 if((ie4||ie5) && document.documentElement) // Workaround for scroll offset of IE
  {
    x+=document.documentElement.scrollLeft;
    y+=document.documentElement.scrollTop;
  }
 if(idiv) showtip();
}

// Initialize after loading the page
window.onload=infoinit;

// EOF infobox.js
