//---------------------------------------------------------------------
function load_img(id, h, w)
{
	var l = (screen.width  - w)/2;
 	var t = (screen.height - h)/2;
	window.open('/img.php?img='+id, '', 'resizable=yes,scrollbars=yes,height='+h+',width='+w+',top='+t+',left='+l);
}
//---------------------------------------------------------------------
	hs.graphicsDir = '/highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.outlineType = 'rounded-white';
	hs.fadeInOut = true;
	hs.dimmingOpacity = 0.75;

	// define the restraining box
	hs.useBox = true;
	hs.width = 640;
	hs.height = 480;

	// Add the controlbar
	hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: 1,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});

function MenuInit(){
  var res;
  var tmp=null;
  var url;
  var kastyl;
  url = document.URL;      
  url =url.substr(10);
  url =url.substr(url.indexOf('/'));
  res=document.getElementsByTagName('div');
  for(var a=0;a<res.length;a++){
    if(res[a].className=='divoff') {
         if(url=='/') kastyl='"'; else kastyl=''; 
         is_opened=res[a].innerHTML.indexOf('"'+url+kastyl);
         if(is_opened>=0) {
          res[a].className='divon';
          res[a].onmouseout='';
         }
  }
  }
}


//--------------------------------------------------------
function findOffsetTop (o) {
  var x = o.offsetLeft, y = o.offsetTop;
  while (o = o.offsetParent) {
     x += o.offsetLeft;
     y += o.offsetTop;
  }
  return {left:x, top:y};
};
//--------------------------------------------------------
function showRegion(id, ww, hh, display)
{
	for (i = 0; ;i++)
	{
		if (!document.getElementById('regionDiv'+i))
			break;
		document.getElementById('regionDiv'+i).style.display = 'none';
	}
	obj = document.getElementById('regionDiv'+id);
	if (!display)
		display = 'block';
	LeftTop = findOffsetTop(document.getElementById('MapRegions'));
	obj.style.left = LeftTop['left']+ww+'px';
	obj.style.top = LeftTop['top']+hh+'px';
	obj.style.display = display;
}
