

// javascript file updated by Mat for corp version of this web builder

mWidth = 130
pad = 2
//
function mainWrite(){
document.write('<table border=0 cellspacing="0" cellpadding="0" style="border:1px; width:'+mWidth+'px">')
for(i=0;i<m_menu.length;i++){
	document.write('<tr>')
	if(isExp || isOpera){
		document.write('<td style="color:'+selectMainMenu+';" bgcolor="'+selectMainMenuBack+'" onMouseOver="this.style.backgroundColor=\'')
		document.write(selectMainMenuBackO) // rollover bg colour for main menu
		document.write('\';document.all.mm'+i+'.style.color=\'')
		document.write(selectMainMenu0) // rollover text colour for main menu
		document.write('\';style.cursor=\'hand\';showSub('+i+');" ')
		document.write('onMouseOut="this.style.backgroundColor=\'')
		document.write(selectMainMenuBack) // original bg colour for main menu
		document.write('\';document.all.mm'+i+'.style.color=\'')
		document.write(selectMainMenu) // original text colour for main menu
		document.write('\'" ')
	}else{
		document.write('<td onMouseOver="this.style.backgroundColor=\'')
		document.write(selectMainMenuBackO) // rollover bg colour for main menu
		document.write('\';document.getElementById(\'mm'+i+'\').style.color=\'')
		document.write(selectMainMenu0) // rollover text colour for main menu
		document.write('\';style.cursor=\'pointer\';showSub('+i+');" ')
		document.write('onMouseOut="this.style.backgroundColor=\'')
	document.write(selectMainMenuBack) // original bg colour for main menu
		document.write('\';document.getElementById(\'mm'+i+'\').style.color=\'')
		document.write(selectMainMenu) // original text colour for main menu
		document.write('\'" ')	
	}

document.write('onMouseDown="window.location=\''+m_menu[i][1]+'\';"')
	document.write(' style="background:')
	document.write(selectMainMenuBack) // original bg colour for main menu
	document.write(';')
	if(i==0){
	//alert(i)
		document.write(' border-top: ')
		document.write(selectBorderColor) // border colour
		document.write(' solid 1px;')
	}
	document.write(' border-bottom:')
	document.write(selectBorderColor) // border colour
	document.write(' solid 1px; ')
	document.write() // border colour
	document.write(' solid 1px;')
	document.write(' padding:'+pad+'px">')
	document.write('<div id="mm'+i+'" style="position:relative; width:'+mWidth+'px; text-align:left; font-size:14px; font-variant :;  font-weight: ; color:')
	document.write(selectMainMenu) // original text colour for main menu
	document.write(';">')
	document.write(m_menu[i][0])
	//document.write(' <img src="images/arrow.gif" border=0" align="middle">')
	document.write('</div>')
	document.write('</td>')
	document.write('</tr>')
}
document.write('</table>')

document.write('<div id="subLayer" style="position:absolute; width:'+mWidth+'px; left:'+mWidth+'px; top:0px; visibility: hidden;">nowt</div>')
}

// display sub menu's

function showSub(which){
	if (isExp || isOpera){
		eval('myPos = document.all.mm'+which+'.offsetTop')
	}else{
		eval('myPos = parseInt(document.getElementById(\'mm'+which+'\').offsetTop)')
	}
	curMenu = eval('s_menu'+which)
	myText = ('<table cellspacing="0" cellpadding="0" style="border:0px; width:'+mWidth+'px">')
	for(i=0;i<curMenu.length;i++){
		myText += ('<tr>')
		if(isExp || isOpera){
			myText += ('<td onMouseOver="this.style.backgroundColor=\'')
			myText += (selectSubMenuBackO) // rollover bg colour for sub menu
			myText += ('\';document.all.sm'+i+'.style.color=\'')
			myText += (selectSubMenu0) // rollover bg colour for sub menu
			myText += ('\';style.cursor=\'hand\';" ')
			myText += ('onMouseOut="this.style.backgroundColor=\'')
			myText += (selectSubMenuBack) // original bg colour for sub menu
			myText += ('\';document.all.sm'+i+'.style.color=\'')
			myText += (selectSubMenu) // original text colour for sub menu
			myText += ( '\';" ')
		}else{
			myText += ('<td onMouseOver="this.style.backgroundColor=\'')
			myText += (selectSubMenuBackO) // rollover bg colour for sub menu
			myText += ('\';document.getElementById(\'sm'+i+'\').style.color=\'')
			myText += (selectSubMenu0) // rollover bg colour for sub menu
			myText += ('\';style.cursor=\'pointer\';" ')
			myText += ('onMouseOut="this.style.backgroundColor=\'')
			myText += (selectSubMenuBack) // original bg colour for sub menu
			myText += ('\';document.getElementById(\'sm'+i+'\').style.color=\'')
			myText += (selectSubMenu) // original text colour for sub menu
			myText += ('\';" ')
		}
		myText += ('onMouseDown="window.location=\''+curMenu[i][1]+'\';"')
		myText += ('style="background:')
		myText += (selectSubMenuBack) // original bg colour for sub menu
		myText += (';')
		if(i==0){
			myText += (' border-top:') 
			myText += (subMenuBorderColor) // border colour 
			myText +=(' solid 1px;')
		}
		myText += (' border-bottom:')
		myText += (subMenuBorderColor) // border colour 
		myText += (' solid 1px; border-left:')
		myText += (subMenuBorderColor) // border colour
		myText += (' solid 1px; border-right:')
		myText += (subMenuBorderColor) // border colour 
		myText += (' solid 1px; padding:'+pad+'px;">')
		myText += ('<div id="sm'+i+'" style="position: relative: text-align:left; width:'+mWidth+'px; font-size:14px; text-indent:0px;  color:')
		myText += (selectSubMenu ) //original text colour for sub menu
		myText += (';">')
		myText += (curMenu[i][0])
		//myText += (' <img src="images/arrow.gif" border="0" align="middle">')
		myText += ('</div>')
		myText += ('</td>')
		myText += ('</tr>')
	}
	myText += ('</table>')
	goNow(myText,myPos)
}
//
function goNow(text,yPos){
	yPos -= 1+pad
	xPos = mWidth+(pad*2)
	writeLayer('subLayer',text)
	layerVis('subLayer','visible')
	moveLayer('subLayer',xPos,yPos)
	startMC()
	hideSub()
}
//
mc = null
function hideSub(){
	if(isExp){
		mct	= document.all.mm0.offsetTop
		mcr	= document.all.subLayer.offsetLeft + document.all.subLayer.offsetWidth
		mcb	= document.all.subLayer.offsetTop + document.all.subLayer.offsetHeight
	}else{
		mct	= document.getElementById('mm0').offsetTop
		mcr	= document.getElementById('subLayer').offsetLeft + document.getElementById('subLayer').offsetWidth
		mcb	= document.getElementById('subLayer').offsetTop + document.getElementById('subLayer').offsetHeight
	}
	if(mouseX > mcr || mouseY < mct || mouseY > mcb ){
		layerVis('subLayer','hidden')
		clearTimeout(mc)
	}else{
		mc = setTimeout('hideSub()',20)
	}
	
	
}
//
mainWrite()