/* Menu Script*/

/* 
var posYmenu = 155;
var posXmenu = 5;
*/

var mainXoffset =-4;
var mainYoffset =-4;
var subXoffset = 98;
var subYoffset = 0;
var rowheight = 25;
var cellspace = 1;
var cellpad = 1;
var timermilli=2000;

/*
	something: #E0CCAA;
	darkbrown: #A3&b67;
	lightbrown: #B59682;
	darkmauve: #745F97;
	lightmauve: #B1A2BC;
	darkblue: #4B2D6D;
*/

var bgcolor='#4B2D6D';
var bgcolor2='#745F97';
var fontcol='#FFFFFF';
var bordercol='#B1A2BC';
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('#topleft { POSITION: absolute; top:'+posYmenu+'px; left:'+posXmenu+'px; z-index:2; }');
*/
/*
document.write('#topleft { POSITION: absolute; top:'+imgPosition.y+'px; left:'+imgPosition.x+'px; z-index:2; }');
*/

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]="Property Search";
mainhref[1]="search.htm";
mainopts[2]="Our Services";
mainhref[2]="#";
mainopts[3]="Useful Links";
mainhref[3]="links.htm";
mainopts[4]="Contact Us";
mainhref[4]="contact.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[2][0] = '<A HREF="propman.htm" CLASS=dynamenu>Property Management</A>';
opts[2][1] = '<A HREF="rentrev.htm" CLASS=dynamenu>Rent Reviews</A>';
opts[2][2] = '<A HREF="salelet.htm" CLASS=dynamenu>Sales & Lettings</A>';
opts[2][3] = '<A HREF="invest.htm" CLASS=dynamenu>Investments</A>';
opts[2][4] = '<A HREF="appeal.htm" CLASS=dynamenu>Rating Appeals</A>';
opts[2][5] = '<A HREF="dilap.htm" CLASS=dynamenu>Dilapidations</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+mainXoffset+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 BORDER=0 CELLPADDING='+cellpad+' CELLSPACING='+cellspace+' BGCOLOR='+bordercol+'>\r')
for (i=0;i<mainopts.length;i++) 
{
	document.write('<TR><TD CLASS="dynamenu" HEIGHT='+rowheight+' 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></TR>\r')
}
document.write('</TR></TABLE></DIV>\r')

function pop(msg,pos) { 
if (timerid) clearTimeout(timerid);
skn.visibility = "hidden"; 
a=true;
/* skn.left = posXmenu+2+pos;  - replaced for horizontal menu by*/
skn.left = imgPosition.x+mainXoffset+subXoffset;

skn.top=imgPosition.y+(pos*(rowheight+cellspace))+mainYoffset+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+" 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';*/
}