var active = '';

function trychange(id,i,top_id,sid)
{
	active = sid
//alert(id)
var myid=document.getElementById(id)
if (!myid){return} // whoyouare
var mysrc = myid.id
//alert(mysrc)
//alert(mysrc.indexOf('c'+top_id+'b.gif'))
if( typeof(top_id) != 'undefined' )
{if (mysrc.indexOf(top_id) > 0)
{return}}
if (i == 1)
{
myid.style.cursor = 'hand';
myid.style.cursor = 'pointer';
myid.style.backgroundColor = '#9CAEDE';
	//activateMenu(sid)

}

else
{
myid.style.cursor = 'default';
myid.style.backgroundColor = '#D6DFEF';
}


}


function change1(id)
{
var myid=document.getElementById(id)
myid.style.backgroundColor = '#9CAEDE';
}

function change2(id)
{
var myid=document.getElementById(id)
myid.style.backgroundColor = '#D6DFEF';
}


var isIE = (document.all)?true:false
var isNN = (document.getElementById && !isIE)?true:false
var isMAC = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?true:false

var layerRef = (isNN) ? 'document.getElementById("' : 'document.all.';
var styleRef = (isNN) ? '").style' : '.style';
var topRef = (isNN) ? '.top' : '.pixelTop';
var leftRef = (isNN) ? '.left' : '.pixelLeft';
var activeMenu = 0;
var buble = false;


if (isNN) var topPixel = 575;
else var topPixel = 199;

if (isNN)
{
 document.captureEvents(Event.MOUSEMOVE);
 document.onmousemove = checkUp;
}
 else document.onmouseover = killMenu;


function activateSelected(menuLayerRef){
 buble = true;
 activateMenu(menuLayerRef);
 buble = false;
}

function getRealPos(i,which) {
  iPos = 0
  while (i!=null) {
    iPos += i["offset" + which]
    i = i.offsetParent
  }
  return iPos - 0
}

function activateMenu(menuLayerRef){
//alert(menuLayerRef)
 var left1 = 0;
 var left2 = 0;
 if (menuLayerRef == 2)
 {left1 = 100}
 var i = window.event.srcElement
 if (activeMenu != menuLayerRef)
 {
  if (activeMenu) 
   hideMenu("menua" + activeMenu);
  menuID = "menua" + menuLayerRef;
  activeMenu = menuLayerRef;	
  eval(layerRef + menuID + styleRef + topRef + ' = ' + topPixel);
  left2 = getRealPos(i,"Left") - left1
//  alert(left2)
  eval(layerRef + menuID + styleRef + leftRef + ' = ' + left2);
  showMenu(menuID);
 }
 if (!isNN && !buble) window.event.cancelBubble = true;
}

function showMenu(menuID) {
//alert(menuID)
 eval(layerRef + menuID + styleRef + '.visibility = "visible"');
 if (selectedSection != activeMenu){
}
}

function hideMenu(menuID){
 eval(layerRef + menuID + styleRef + '.visibility = "hidden"');
 if (selectedSection != activeMenu){

	 }
}

function killMenu(){
 if (selectedSection > 0) 
  activateSelected(selectedSection)
 else
 {
  if (activeMenu)
  {
   menuID = "menua" + activeMenu;
   hideMenu(menuID);
   activeMenu = 0;
  }
 }  
}

function checkUp(e){
 if (isNN && (activeMenu != 0))
 {
  var x = e.pageX;
  var y = e.pageY;
  var x1 = eval('document.getElementById("menu' + activeMenu + '").style.width') + leftPixel+x;
  var y1 = topPixel[activeMenu]-19;
  var y2 = eval('document.getElementById("menu' + activeMenu + '").style.height') + topPixel;
  if ((y < y1) || (y > y2) || (x < leftPixel) || (x > x1)) setTimeout("killMenu()", 5000);
 }
}


function spanIn(theSpan){
 theSpan.className='overSpan';
}

function spanOut(theSpan){
 theSpan.className='outSpan';
}

