function rowOver(row){
  var tds=row.getElementsByTagName("td");
  for(var i=0;i<tds.length;i++){
    tds[i].style.borderTop="1px solid #b0b0b0";
    tds[i].style.borderBottom="1px solid #b0b0b0";
    tds[i].style.color="#fff";
    tds[i].style.backgroundColor="#a30001";
  }
  tds[0].getElementsByTagName("a")[0].style.color="#fff";
  tds[0].style.borderLeft="1px solid #b0b0b0";
  tds[tds.length-1].style.borderRight="1px solid #b0b0b0";
}


function rowOut(row){
  var tds=row.getElementsByTagName("td");
  for(var i=0;i<tds.length;i++){
    tds[i].style.borderTop="1px solid #fff";
    tds[i].style.borderBottom="1px solid #fff";
    tds[i].style.color="#000";
    tds[i].style.backgroundColor=row.className.indexOf("gr")>0?"#f2f2f2":"#fff";
  }
  tds[0].getElementsByTagName("a")[0].style.color="#000";
  tds[0].style.borderLeft="1px solid #fff";
  tds[tds.length-1].style.borderRight="1px solid #fff";
}



function sicomPic(type,name,path){
  var sicwin=window.open("","sicomwin"+type,"width=640,height=480,resizable=yes,scrollbars=yes");
  sicwin.document.open();
  sicwin.document.write('<html><head><title>SICOM - Půdorys '+(type=="f"?'bytu':'podlaží')+' '+name+'</title><meta http-equiv="content-type" content="text/html; charset=iso-8859-2"></head><body style="margin:0;padding:0"><img src="'+path+'" alt="Klinutím zavřete okno" style="cursor:pointer;cursor:hand;" onclick="window.close()"></body></html>');
  sicwin.document.close();
  return !typeof(sicwin)=="object";
  
}


function picWin(path,wi,he,title,winpar){
  var sicwin=window.open("","sicomwinpicwin","width="+wi+",height="+he+",resizable=yes"+(winpar?","+winpar:""));
  sicwin.document.open();
  sicwin.document.write('<html><head><title>SICOM - '+title+'</title><meta http-equiv="content-type" content="text/html; charset=iso-8859-2"></head><body style="margin:0;padding:0"><img src="'+path+'" alt="Klinutím zavřete okno" style="cursor:pointer;cursor:hand;" onclick="window.close()"></body></html>');
  sicwin.document.close();
  return !typeof(sicwin)=="object";
}



function addTB(){
  function targetBlank(e){
    if(browser.isIE)el=event.srcElement; else el=e.target;
  		while(el.tagName.toLowerCase()!="a")el=el.parentNode;
    var hrf=el.href;
    var newwin=window.open(hrf);
    return typeof(newwin)=="object"?false:true;
  }
  var lnks=document.getElementsByTagName("a");
  for(var i=0;i<lnks.length;i++){
    if(lnks[i].className.match("\ ?targetblank\ ?")=="targetblank"){
      lnks[i].onclick=targetBlank;
      lnks[i].title="Adresa "+lnks[i].href+" bude otevřena v novém okně";
    }  
  }
}


window.onload=addTB;





