function setWindow() {
    imgx = document.img.width;
    imgy = document.img.height;
    if(document.img.width > 984)  { imgx = 1024; } else { imgx += 40; }
    if(document.img.height > 723) { imgy = 768; }  else { imgy += 55; }
    window.resizeTo(imgx, imgy)
}

function popup(href) {
window.open(href);	
}

function getE(objectID) {
	return document.getElementById(objectID);
}

function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Kliketjte prosím pouze levým tlačítkem.");
return false;
}
return true;
}


function showFaktAdr(objChb)
{
	if (getE(objChb).checked)
		getE('tblFakt').style.display = "";
	else
		getE('tblFakt').style.display = "none";
}


document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;


function setSelectedIndex(object, position){
  var o = getE(object);
  //window.alert('nastavuji depo: '+object+' na index: '+position);
  o.selectedIndex = position;
  o.focus();
}

function setByVal(obj,val){
   for (var idx=0;idx<getE(obj).options.length;idx++) {
     if (val==getE(obj).options[idx].value) {
         getE(obj).options[idx].selected=true;
     }
   }
   getE(obj).focus();
}

function changeImage(who){
  var i = getE('im1');
  var x = getE(who);
  var t = getE('im1txt');
  
  i.src = x.src;
  t.innerHtml = x.alt;
}

