function changeList(listID,my,max) {
  for(var i=1; i<=max; i++) {
    document.getElementById(listID+i).style.borderBottom='2px solid #ffffff';
    document.getElementById('t_'+listID+i).style.display='none';
  }	    
    
  document.getElementById(listID+''+my).style.borderBottom='2px solid #ff7e00';
  document.getElementById('t_'+listID+my).style.display='block';   
}

function orangeStyle(elemPointer) {
  if(elemPointer.style.borderBottomColor != '#ff7e00' && elemPointer.style.borderBottomColor != 'rgb(255,126,0)')
    elemPointer.style.borderBottom='2px solid #ffffff';
  elemPointer.style.background='#ff7e00';
  elemPointer.style.color='#ffffff';
}

function orangeSytleById(elemId) {
  document.getElementById(elemId).style.background='#ff7e00';
}

  function doNothing(timeOut) {
    setTimeout('doNothing('+timeOut+')',timeOut);
  }

function blueStyle(elemPointer) {
  if(elemPointer.style.borderBottomColor != '#ff7e00' && elemPointer.style.borderBottomColor != 'rgb(255,126,0)')
    elemPointer.style.borderBottom='2px solid #ffffff';
  elemPointer.style.background='#0d2d96';
  elemPointer.style.color='#ffffff';     
}

var ns4;
var op5;
var op6;
var mac;
var ie;
var mac_ie;

function sniffBrowsers() {
  ns4 = (document.layers) ? 1 : 0;
  op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1);
  op6 = (navigator.userAgent.indexOf("Opera 6")!=-1) ||(navigator.userAgent.indexOf("Opera/6")!=-1);
  agt=navigator.userAgent.toLowerCase();
  mac = (agt.indexOf("mac")!=-1);	
  ie = (agt.indexOf("msie") != -1); 
  mac_ie = mac && ie;
}

function showMenu(menuId,parentHandler) {
  data = document.getElementById(menuId);
  if(data == 'null') return;

  _height = getElementHeight(parentHandler.id);
  _width = getElementWidth(parentHandler.id);
  _left = getElementLeft(parentHandler.id);
  _top = getElementTop(parentHandler.id);
  if(ie) _top+=2;
  
  data.style.position='absolute';  
  moveXY(menuId,_left,(_top + _height));
  data.style.display='block';
}

function hideSubMenu(myId) {
  document.getElementById(myId).style.display='none';
}

function closeAllMenu(callObj) {
  var current = callObj.parentNode.firstChild;
  var last = callObj.parentNode.lastChild;
  while(1) {
    blueStyle(document.getElementById(current.id));
    document.getElementById(current.id+'_data').style.display='none';
    if(current.id == last.id)
      return;

    current = current.nextSibling;
  }
}

var myTimer;
var myValue;

function delValue() {
  document.getElementById('news_container').innerHTML+=''+myValue;
  myValue=0; 
}

function setValue() {
  document.getElementById('news_container').innerHTML+=' '+myValue;
  myValue=1;
}

function closeAll_() {
 if(myTimer != 0) {
   clearAll_();
 }
 myTimer=setTimeout("closeAllMenu(document.getElementById('menu_parent').lastChild)",500); 
}

function clearAll_() {
  clearTimeout(myTimer);
  myTimer=0;
}

function showMe(id) {
  document.getElementById('data_container').innerHTML = document.getElementById(id).innerHTML;
}

// changing visibility of firstID and secondID elements by caller value[0|1]
function switchDestination(caller,firstID,secondID) {
  if(caller.value == 1) {
    document.getElementById(secondID).style.display = 'block';
    document.getElementById(firstID).style.display = 'none';
    return;
  }
  document.getElementById(secondID).style.display = 'none';
  document.getElementById(firstID).style.display = 'block';
}

function switchSWUsage(caller,firstID,secondID) {
  if(caller.checked) {  
    document.getElementById(firstID).style.display = 'block';
    document.getElementById(secondID).style.display = 'none';
    return; 
  }

  document.getElementById(firstID).style.display = 'none';
  document.getElementById(secondID).style.display = 'block';
  
}





function repairForm(caller,hideID,showID,uncheckID) {
  if(caller.value == 0) { // je to robene specialne ak preklineme na hotel aby to poupratovalo formular .. napicu take speci fcie..
    showElement(showID);
    hideElement(hideID);
    uncheckElement(uncheckID);
  }
}

function showElement(id) {
  document.getElementById(id).style.display = 'block';
}

function hideElement(id) {
  document.getElementById(id).style.display = 'none';
}

function uncheckElement(id) {
  document.getElementById(id).checked = 0;
}
