/* Menu Script*/

/* 
var posYmenu = 155;
var posXmenu = 5;
*/

var mainXoffset =0;
var mainYoffset =0;
var mainwidth=770;
var mainitems=7;
var subXoffset = 0;
var subYoffset = 26;
var rowheight = 25;
var cellspace = 1;
var cellpad = 2;
var timermilli=2000;

/*
	something: #E0CCAA;
	darkbrown: #A3&b67;
	lightbrown: #B59682;
	darkmauve: #745F97;
	lightmauve: #B1A2BC;
	darkblue: #002E62;
	midblue: #00428C;
	lightblue: #0078FF;
	accordisgrey: #888888
	orange: rgb(247,121,38);
*/
/*
var bgcolor='#ffffff';
var bgcolor2='#eeeeee';
var fontcol='rgb(247,121,38)';
var bordercol='#dddddd';
*/
var bgcolor='#eeeeee';
var bgcolor2='#ffffff';
var fontcol='rgb(247,121,38)';
var bordercol='#ffffff';



var timerid=0;

var imgPosition = imgXY('menuposition');  

document.write('<style type="text/css">');
document.write('.popper { POSITION: absolute; VISIBILITY: hidden; z-index:3; }');
document.write('A:hover.dynamenu {color:'+fontcol+'; text-decoration:none; font-weight: normal;  font-size: 9pt;}');
document.write('A.dynamenu {color:'+fontcol+'; text-decoration:none; font-weight: normal; font-size: 9pt;}');
document.write('</style>');

document.write('<DIV class=popper id=topdeck></DIV>'); 

mainopts = new Array;
mainhref = new Array;
mainopts[0]="Home";
mainhref[0]="index.htm";
mainopts[1]="About Us";
mainhref[1]="about.htm";
mainopts[2]="Systems";
mainhref[2]="systems.htm";
mainopts[3]="Software";
mainhref[3]="products.htm";
mainopts[4]="Services";
mainhref[4]="#";
mainopts[5]="Contact";
mainhref[5]="contact.htm";
mainopts[6]="Links";
mainhref[6]="links.htm";

opts = new Array; 
opts[0] = new Array; 
opts[1] = new Array; 
opts[2] = new Array; 
opts[3] = new Array; 
opts[4] = new Array; 
opts[5] = new Array; 
opts[6] = new Array; 

/*
opts[2][0] = '<A HREF="propman.htm" CLASS=dynamenu>Property Management</A>';
*/
opts[3][0] = '<A HREF="datarecruitcrm.htm" CLASS=dynamenu>for Recruitment</A>';
opts[3][1] = '<A HREF="datacarer.htm" CLASS=dynamenu>for Care Homes</A>';
opts[3][2] = '<A HREF="datastock.htm" CLASS=dynamenu>Stock Control</A>';
opts[3][3] = '<A HREF="encore.htm" CLASS=dynamenu>Accounts</A>';
opts[3][4] = '<A HREF="earnie.htm" CLASS=dynamenu>Payroll</A>';
/* opts[2][6] = '<A HREF="griffin.htm" CLASS=dynamenu>Griffin Broadband</A>'; */

opts[4][0] = '<A HREF="consult.htm" CLASS=dynamenu>Consultancy</A>';
opts[4][1] = '<A HREF="websites.htm" CLASS=dynamenu>Websites</A>';
opts[4][2] = '<A HREF="support.htm" CLASS=dynamenu>Support</A>';
opts[4][3] = '<A HREF="training.htm" CLASS=dynamenu>Training</A>';



var nava = (document.layers); 
var dom = (document.getElementById); 
var iex = (document.all); 
if (nava) { skn = document.topdeck } 
else if (dom) { skn = document.getElementById("topdeck").style } 
else if (iex) { skn = topdeck.style } 
/*
skn.top = posYmenu+subYoffset; 
*/
skn.top = imgPosition.y+subYoffset; 

document.onclick = kill;
window.onresize= reposition;

document.write('<DIV ID=topleft style="POSITION: absolute; top:'+(imgPosition.y+mainYoffset)+'px; left:'+(imgPosition.x+mainXoffset)+'px; z-index:2;">');

document.write('<TABLE WIDTH=' + mainwidth + ' BORDER=0 CELLPADDING='+cellpad+' CELLSPACING='+cellspace+' BGCOLOR='+bordercol+'>\r')
document.write('<TR>');
for (i=0;i<mainopts.length;i++) 
{
	document.write('<TD CLASS="dynamenu" HEIGHT='+rowheight+' WIDTH=' + (mainwidth/mainitems) + ' ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor2+'\';pop(opts['+i+'],'+i+')" onMouseOut="this.style.background=\''+bgcolor+'\'">&nbsp;<A CLASS="dynamenu" onMouseOver="pop(opts['+i+'],0)" href="'+mainhref[i]+'">'+mainopts[i]+'</a>&nbsp;</TD>\r')
}
document.write('</TR></TABLE></DIV>\r')

function pop(msg,pos) { 
if (timerid) clearTimeout(timerid);
skn.visibility = "hidden"; 
a=true;

skn.left = imgPosition.x+((mainwidth/mainitems)*pos);
skn.top = imgPosition.y+subYoffset;

/* - replaced for horizontal menu by

skn.left = imgPosition.x+subXoffset;
skn.top=imgPosition.y+(pos*(rowheight+cellspace))+subYoffset;

/* end replace */

var content ="<TABLE BORDER=0 CELLPADDING="+cellpad+" CELLSPACING="+cellspace+" BGCOLOR="+bordercol+" >";
for (pass=0;pass<msg.length;pass++)
	{
	content += "<TR><TD CLASS='dynamenu' HEIGHT="+rowheight+" WIDTH=" + (mainwidth/mainitems-(cellpad*2)-cellspace) + " ALIGN=center BGCOLOR="+bgcolor+" onMouseOver=\"resettimer(); this.style.background='"+bgcolor2+"'\" onMouseOut=\"this.style.background='"+bgcolor+"'\" nowrap>&nbsp;"+msg[pass]+"&nbsp;</TD></TR>";
	}
content += "</TABLE>";
if (nava)
  {
    skn.document.write(content);
	  skn.document.close();
  }
    else if (dom)
  {
	  document.getElementById("topdeck").innerHTML = content;
  }
    else if (iex)
  {
	  document.all("topdeck").innerHTML = content;
  }
/*alert("Top: "+skn.top+ "left: "+skn.left);*/
skn.visibility = "visible";
timerid=setTimeout('kill();',timermilli);
}

function resettimer()
{
if (timerid) clearTimeout(timerid);
timerid=setTimeout('kill();',timermilli);
}

function kill()
{
	skn.visibility = "hidden";
}

function imgXY(imgID) {
  /* This function returns the upperleft x,y coordinates of the specified image */
  var XY = new Object();
  var imgObj = document.images[imgID];
  if (document.layers) {
	XY.x = eval(imgObj).x;
	XY.y = eval(imgObj).y;
  } else {
	var x,y, tempEl;
	x = eval(imgObj).offsetLeft;
	y = eval(imgObj).offsetTop;
	tempEl = eval(imgObj).offsetParent;
  	while (tempEl != null) {
  		x += tempEl.offsetLeft;
		y += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	XY.x = x;
	XY.y = y;
  }
  return XY;
}

function reposition()
{
var mainstyle;
if (nava) { mainstyle= document.topleft} 
else if (dom) { mainstyle= document.getElementById("topleft").style } 
else if (iex) { mainstyle= topleft.style } 
/*mainstyle.visibility='hidden';*/
imgPosition = imgXY('menuposition');
mainstyle.left=imgPosition.x + mainXoffset;
mainstyle.top=imgPosition.y + mainYoffset;
/*mainstyle.visibility='visible';*/
}