// JavaScript Document
function init(){
//natažení menu podle velikosti obsahu
  if (document.getElementById('Middle').clientHeight > 850)
    {
      var height = document.getElementById('Middle').clientHeight;
      document.getElementById('Left').style.height = height+ "px";
      document.getElementById('Right').style.height = height+ "px";
    }
    else
    {
      var height = 900;
      document.getElementById('Left').style.height = height+ "px";
      document.getElementById('Right').style.height = height+ "px";    
    } 
}       

function windowWidth() {
	if (window.innerWidth) return window.innerWidth;
	else if (document.documentElement && document.documentElement.clientWidth)
		return document.documentElement.clientWidth;
	else if (document.body && document.body.clientWidth)
		return document.body.clientWidth;
	else return null;
	}

function windowHeight() {
	if (window.innerHeight) return window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight)
		return document.documentElement.clientHeight;
	else if (document.body && document.body.clientHeight)
		return document.body.clientHeight;
	else return null;
	}
	
var catSwitchVisibleCat=true;	
function catSwitch(){
  if (catSwitchVisibleCat){
    document.getElementById('producerMenu').style.display="block";
    document.getElementById('categoryMenu').style.display="none";
    document.getElementById('catSwitch').innerHTML="<span style=\"color: #AAAAAA;\">VÝROBCI </SPAN>| <span style=\"color: #FFFFFF;\">KATEGORIE</SPAN>";
  }
  else{
    document.getElementById('categoryMenu').style.display="block";
    document.getElementById('producerMenu').style.display="none";
    document.getElementById('catSwitch').innerHTML="<span style=\"color: #FFFFFF;\">VÝROBCI </SPAN>| <span style=\"color: #AAAAAA;\">KATEGORIE</SPAN>";
  }
  catSwitchVisibleCat=!catSwitchVisibleCat;
  init();
  
}

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function show_big_img(name){
  open_window('img_big', ('img/products/big/'+name), 10, 10, 1024, 768);
}

function showCalc(url){
  open_window("EssoxCalc", url, 10, 10, 650, 460);
}

function showEssox(url){
  open_window("Essox", url, 10, 10, 840, 640);
}


