document.btn_img = new Array();

function PopupWindow( url, width, height )
{
	window.open( url, "", "noresize,height=" + height + ",width=" + width + ",location=no,directories=no,menubar=no,toolbar=no,scrollbars=yes" )
}
function PrintPage( url )
{
	window.open( url, 'print', 'toolbar=no,scrollbars=1,menubar=yes,resizable=1,width=630,height=500' );
}
function PicturePopup( url, width, height )
{
	window.open( url, "PicturePopup", "resizable=1,height=" + ( ( height <= 600) ? height : "600" ) + ",width=" + ( ( width <= 800 ) ? width : "800" ) + ",location=no,directories=no,menubar=no,toolbar=no,scrollbars=" + ( ( height <= 600 && width <= 800 ) ? "no" : "yes" ) )
}

var Timeout;
var Pause=200;
var Items = 8

function n_GetX(El) {
 var X = 0;
 do {X += El.offsetLeft} while ((El = El.offsetParent) != null);
 return X;
}

function n_GetY(El) {
 var Y = 0;
 do { Y += El.offsetTop } while ((El = El.offsetParent) != null);
 return Y;
}

function ShowItem(num) {
 HideAll();
 LeftCoord=n_GetX(document.getElementById('bg'+num));
 TopCoord=n_GetY(document.getElementById('bg'+num))

 document.getElementById('menu'+num).style.left = LeftCoord-11 + "px";
 document.getElementById('menu'+num).style.top = TopCoord+24 + "px";
 document.getElementById('menu'+num).style.visibility = 'visible';
}

function HideAll() {
 for(var i = 1; i <= Items; i++)
  HideItem(i)
}

function HideItem(num) {
if (document.getElementById('menu'+num)!=null) { document.getElementById('menu'+num).style.visibility = 'hidden'; }
}

function ShowHideBlock(elm) {
  var srcElement = document.getElementById(elm);
    if(srcElement) {
    if(srcElement.style.display == "block") {
      srcElement.style.display= 'none';
    }
    else {
      srcElement.style.display='block';
    }
  }
}
