<!--
isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
 isMSIE=document.all && document.all.item //Microsoft Internet Explorer 4+
 isNetscape4=document.layers //Netscape 4.*
 isOpera=window.opera //Opera
 isOpera5=isOpera && isDOM //Opera 5+
 isMSIE5=isDOM && isMSIE //MSIE 5+
 isMozilla=isNetscape6=isDOM && !isMSIE && !isOpera //Mozilla или Netscape 6.*

 ns = isMozilla || isNetscape4 || isNetscape6
 ns4 = isNetscape4
 ie = isMSIE || isMSIE5

 op = isOpera || isOpera5     


function getAppVersion() { return ns || ie || op; }


function ChangeImg(Ind, NewSrc) {
 if (getAppVersion()) {
  if (isNetscape4) {
     document.Info.document.images['i'+Ind].src = '/images/' + NewSrc + '.gif'; 
   } else {
    document.images['i'+Ind].src = '/images/' + NewSrc + '.gif'; }
 }
}                  

var MenuOpen = 0;

function HideMenu(Obj) {
 if (!MenuBuildDone) { return }

 var ref = GetLayer(Obj)

 if (isNetscape6 || ie) ref.style.visibility = "hidden"
  else if (ns4) ref.visibility = "hide"

 MenuOpen = 0
}

function ShowMenu(Obj) {
// Obj - 'Menu0', or 'Menu1' etc.

 if (!MenuBuildDone) { return }

 var cObj = Obj.replace(/^Menu/, '')

 GetLayer(Obj).style.top = getPageXY(GetLayer('mi' + cObj)).y + GetLayer('mi' + cObj).height + 2;
 GetLayer('Menu' + cObj).style.left = getPageXY(GetLayer('mi' + cObj)).x;
 if (ie) GetLayer(Obj).style.width = 0

  if (MenuOpen == Obj) { HideMenu(MenuOpen) }
  else {
   if (MenuOpen != 0) { HideMenu(MenuOpen) }
   var ref = GetLayer(Obj)

   if (isNetscape6 || ie) ref.style.visibility = "visible"
   else if (ns4) ref.visibility = "show"

   MenuOpen = Obj
  }
}

function HiItem(Obj) {
 var ref = GetLayer(Obj)

 if (ref) {
  ref.style.background = "#CEEBFF"
  ref.style.color = "#006699";
 }
}


function LoItem(Obj) {
 var ref = GetLayer(Obj)
 if (ref) {
  ref.style.background = "#B5CFDE"
  ref.style.color = "#003063"
 }
}

function GetLayer(Obj) {
if (isNetscape6) return document.getElementById(Obj)
else
if (ns4) return document.layers[Obj]
else if (ie) return document.all[Obj]
}

function getPageXY(elm) {
  var point = { x: 0, y: 0 };
  if (ns4) {
	point.x = document.layers[which].pageX;
	point.y = document.layers[which].pageY;
 } else {
  while (elm) {
    point.x += elm.offsetLeft;
    point.y += elm.offsetTop;
    elm = elm.offsetParent;
  }
 }

 return point;
}

function setPageXY(elm, x, y) {
  var parentXY = {x: 0, y: 0 };

  if (elm.offsetParent) {
    parentXY = getPageXY(elm.offsetParent);
  }

  elm.style.left = (x - parentXY.x) + 'px';
  elm.style.top  = (y - parentXY.y) + 'px';
}

 var Menu = new Array()
 var MenuBuildDone = 0;

 Menu[0] = new Array()
 Menu[0][0] = new Array("Аккумуляторы&nbsp;CSB&nbsp;серии&nbsp;GP", "http://www.csb-battery.com.tw")
 Menu[0][1] = new Array("Аккумуляторы&nbsp;Powerman", "http://www.powerman.ru/shablon.php?bat/")

 Menu[1] = new Array()
 Menu[1][0] = new Array("Директорские&nbsp;кресла", "http://www.taipit.ru/html/tprice/catalog/index.html?ok&2")
 Menu[1][1] = new Array("Операторские&nbsp;кресла", "http://www.taipit.ru/html/tprice/catalog/index.html?ok&1")
 Menu[1][2] = new Array("Кресла&nbsp;для&nbsp;посетителей", "http://www.taipit.ru/html/tprice/catalog/index.html?ok&3")

 for (i=0; i<Menu.length; i++) {
  document.write("<div id=\"Menu" + i + "\" style=\"position:absolute; top:0; "+ 
    "left:0; visibility:hidden;\" OnMouseOver=\"ShowMenu('Menu" + i + "');\"" + 
    " OnMouseOut=\"HideMenu('Menu" + i + "');\">" +
    "<table BGCOLOR=\"#003063\" CELLSPACING=1 CELLPADDING=0 BORDER=0>" +
    "<tr><td><table BGCOLOR=\"#B5CFDE\"  CELLSPACING=1 CELLPADDING=1 BORDER=0 style=\"cursor:hand;\">")

  for (j=0; j<Menu[i].length; j++) {
   document.write('<tr><td class=popMenu BGCOLOR="#B5CFDE" ID="ri' + i + '_' + j + 
      '" OnMouseOver="HiItem(\'ri' + i + '_' + j + '\');' +
      ' window.status=\'Goto:' + Menu[i][j][1] + '\';"' + 
      ' OnMouseOut="LoItem(\'ri' + i + '_' + j + '\');' +
      ' window.status=\'\'; "' + 
      ' onClick="HideMenu(\'Menu' + i + '\');' + 
      ' location.href = \'' + Menu[i][j][1] + '\';">' + Menu[i][j][0] + '</td></tr>')
  }
  document.write('</table></td></tr></table></div>')
  MenuBuildDone = 1
 }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadimages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadimages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//-->
