function GetObj(obj){if (document.getElementById) return document.getElementById(obj); else if (document.all) return document.all[obj]}
function IntToSomething(iValue)
{
  var iMinute=1;
  var iSecond=1;
  iMinute = (iValue / 60)|0; if (iMinute<10) iMinute="0"+iMinute;
  iSecond = iValue % 60    ; if (iSecond<10) iSecond="0"+iSecond;
  return iMinute + "'" + iSecond+ "''";
}
function ShowThis(iLink)
{
 document.getElementById(iLink).style.display == "block" ? document.getElementById(iLink).style.display = "none": document.getElementById(iLink).style.display = "block";
}
function ShowLink(iLink,iCount)
{
   for (i=1;i<=iCount;i++) 
   {
     //alert(document.getElementById(iLink).value);
     var aValue="news_"+i;
     if (aValue==iLink)
//          document.getElementById(aValue).style.display = "block" ;
          document.getElementById(aValue).style.display == "block" ? document.getElementById(aValue).style.display = "none": document.getElementById(aValue).style.display = "block";
     else document.getElementById(aValue).style.display = "none";
   }
}
function ShowAll(bShow,iCount)
{
   for (i=1;i<=iCount;i++) 
   {
     var aValue="news_"+i;
     bShow==false ? document.getElementById(aValue).style.display = "none": document.getElementById(aValue).style.display = "block";
   }
}

function SelectAll(checked){
    for (var i = 0; i<document.form_news.elements.length; i++) {
         if ((document.form_news.elements[i].type == "checkbox")) {
                 document.form_news.elements[i].checked = checked;
         }
     }
}
function combo_change(index)
{
//  document.getElementById("search_favorites").style.display = "none";
//  document.getElementById("search_where").style.display = "none";
//  if (index==3)
//  {
//    document.getElementById("search_where").style.display = "block";  
//    document.getElementById("search_favorites").style.display = "block" ;
//    return;
//  }
}
function fav_del(page)
{
  var message="Doriti sa stergeti locatia favorita?";
  if(window.confirm(message)) location.href="public/favorites.php?o=1&i="+page;
}

function scroll_show()
{
  GetObj("scroll_list").innerHTML=scroll_data[scroll_mesage]
  scroll_prev=(scroll_mesage==0)? scroll_data.length-1 : scroll_mesage-1
  GetObj("expand"+scroll_prev).className=""
  GetObj("expand"+scroll_mesage).className="scroll_red"
  scroll_mesage=(scroll_mesage==scroll_data.length-1)? 0 : scroll_mesage+1
  setTimeout("scroll_show()",5000)
}

function scroll_start()
{
  for (i=0;i<scroll_data.length;i++) scroll_total+='<div id="expand'+i+'">- '+scroll_data[i]+'</div>'
  GetObj("scroll_full").innerHTML=scroll_total
  scroll_show()
}

function scroll_expand(e)
{
  scroll_parent=document.all? scroll_full.parentElement : document.getElementById("scroll_full").parentNode
  scroll_parent.style.display=(scroll_parent.style.display=="none")? "" : "none"
}