function getDocumentSize(doc) { // getting a real size document with scrolling etc.
  var r = { width: 0, height: 0 };
  var height1=0, height2=0, height3=0, height4=0, maxHeight=0;

  if (doc.height) maxHeight = doc.height;
  if (doc.body) {
	if (doc.body.scrollHeight) height1 = doc.body.scrollHeight;
	if (doc.body.offsetHeight) height2 = doc.body.offsetHeight;
  }
  if (doc.documentElement) {
	height3 = doc.documentElement.scrollHeight;
	height4 = doc.documentElement.clientHeight;
  }
  maxHeight = Math.max(Math.max(Math.max(height1, height2), Math.max(height3, height4)),maxHeight);
  r.height = maxHeight;
  
  return r;
}
function setelem () {
	var c = 0;
	var e;
	c = getDocumentSize(document).height - 426;
	e = document.getElementById('leftmenu');
	e.style.height = c + "px";
	
}
function showdiv (elem) {
	if (elem == "products") setTimeout("closer('montaj')",100);
	if (elem == "montaj") setTimeout("closer('products')",100);
	setTimeout("opener('"+elem+"')",100);

}
function opener(elem) {
	var d;	
	d = document.getElementById(elem);
	if (d.style.display == "none") d.style.display = "block";
}
function closer(elem) {
	var d;	
	d = document.getElementById(elem);
	if (d.style.display == "block") d.style.display = "none";
}
var myWindow;
function openCenteredWindow(url) {
    var width = 482;
    var height = 323;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,left=" + left + ",top=" + top + 
        "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
	}
