function confirmation_(href_val_par,text)
{
  var flag
  flag=confirm(text)
  if (flag)
  {
    window.location.href=href_val_par;
  }
}

function getObject(obj)
{
  var theObj
  if (document.layers)
  {
    if (typeof obj == "string") return document.layers[obj]
    else return obj
  }
  if (document.all)
  {
    if (typeof obj == "string")
    {
      if (document.all(obj)!=null) return document.all(obj).style;
      else return null;
    }
    else return obj.style
  }
  if (document.getElementById)
  {
    if (typeof obj == "string")
      return document.getElementById(obj).style
    else return obj.style
  }
  return null
}

function change_visibility(obj)
{
  var theObj=getObject(obj);
  if (typeof theObj.visibility != "undefined" || typeof theObj.display != "undefined")
  {
     if (theObj.visibility == "visible" || theObj.display == "block")
     {
       hide(obj);
     }else{
       show(obj);
     }
  }
}

function show(obj)
{
  var theObj=getObject(obj);
  if (typeof theObj.visibility != "undefined")
     theObj.visibility = "visible"
  if (typeof theObj.display != "undefined") theObj.display = "block"
}

function hide(obj)
{
  var theObj=getObject(obj)
  if (typeof theObj.visibility != "undefined")
     theObj.visibility = "hidden"
  if (typeof theObj.display != "undefined") theObj.display = "none"
}

function add_to_favourites(press_ctrl_d,favourites_url,title)
{
  if(window.navigator.appName=='Netscape')
  {
      alert(press_ctrl_d);
  }else{
      window.external.addFavorite(favourites_url,title);
  }
  return false;
}

function set_home_page(obj,favourites_url)
{
  obj.style.behavior='url(#default#homepage)';
  obj.setHomePage(favourites_url);
  return false;
}

function clear_search(obj,count)
{
  if (count==1)
  {
      obj.value='';
	  count=0;
  }
  return count;
}
function return_search(obj,count,text)
{
  if(obj.value=='')
  {
  	obj.value=text;
  	count=1;
  }
  return count;
}

function getBrowserInfo()
{
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}

function bookmark(a)
{
 var url = window.document.location;
 var title = window.document.title;
 var b = getBrowserInfo();
 if (b.type == 'IE' && 7 > b.version && b.version >= 4) window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = url+','+title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
 return false;
}
