
// то что будет открываться без кукисов
// - 1 - новости сервера (всегда показывать)
// - 2 - опрос
// - 3 - потоки
// то что всегда показывается без кукисов
//var cv_cnst = "99";//,1,2,3";
//var cv = "99";//,1,2,3";

// блок функций для меню с "постеменным проявлением"
function high(which2)
{
  theobject=which2
  highlighting=setInterval("highlightit(theobject)",30)
}
function low(which2)
{
  theobject=which2
  clearInterval(highlighting)
  document.images[which2].filters.alpha.opacity=60
}
function highlightit(cur2)
{
  if (document.images[cur2].filters.alpha.opacity<100)
    document.images[cur2].filters.alpha.opacity+=5
     else if (window.highlighting)
   clearInterval(highlighting)
}
//-------

// функции для работы с кукисами
function GetCookie (name)
{
    var arg  = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i    = 0;

    while (i < clen)
    {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
          return getCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return '';
}

function getCookieVal( offset )
{
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}
//-----

// показать спрятать необходимый пункт и запись в кукисы изменений
function showmenu(id_tab,id)
{
        cv="";
        var tbl = document.all(id_tab);
        if (tbl!=null)
{
        if(tbl.style.display!="none")
        {
                cv = "1";
                tbl.style.display = "none";
        }
        else
        {
                tbl.style.display = "block";
        }
}
        document.cookie = id+"="+cv+"; expires=Thu, 31 Dec "+(cv!=""?"2030":"1980")+" 23:59:59 GMT; path=/;";
}


function question_block(vop)
{
 if (confirm(vop))
 {
  document.post_1.submit();
 }
}

function question(vop,lock)
{
 if (confirm(vop))
 {
 self.location=lock
 }
}


function ou(d)
{
d.style.backgroundColor='#F5F6F5';
}

function ov(d)
{
d.style.backgroundColor='#E4E4E4';//#E6F2FF';
d.style.cursor= 'hand';
}

function cl(d)
{
d.children.tags('a')[0].click();
}


function ou_a(d)
{
//d.style.backgroundColor='#88B3E2';
d.style.backgroundColor='';
}

function ov_a(d)
{
d.style.backgroundColor='#88B3E2';//#E6F2FF';
d.style.cursor= 'hand';
}

function cl_a(d)
{
d.children.tags('a')[0].click();
}




function ReDir(url)
{
 if ((url!='')&(url!=' '))
 {
  self.location=url
 }
}

function ShowError(s)
{
 msg = "____________________________________________________\n\n";
 msg += "Форма неправильно заполнена.\n";
 msg += "Пожалуйста, откорректируйте форму и отошлите её снова.\n";
 msg += "____________________________________________________\n";
                
 alert(msg + s + "\n\n");
}

function ShowErrorEng(s)
{
 msg = "____________________________________________________\n\n";
 msg += "The form is incorrectly filled.\n";
 msg += "Please, modify the form and send her(it) again.\n";
 msg += "____________________________________________________\n";

 alert(msg + s + "\n\n");
}

// генерация url
function GenLink(url,frm,txt,insfrm)
{
 // проверим чтобы ссылка не была пустой
 if (url.value=="")
  {
   window.alert("Не заполнено поле с сылкой");
   url.focus();
   return;
  };
 // проверим чтобы текст ссылки не был пустым
 if (txt.value=="")
  {
   window.alert("Не заполнено поле с текстом ссылки");
   txt.focus();
   return;
  };
 s="<a href=\""+url.value+"\"";
 if (frm.value!=="")
 {
  s=s+" target=\""+frm.value+"\""
 };
 s=s+">"+txt.value+"</a>";
 insfrm.value=s;
 insfrm.select();
 insfrm.focus();
// window.alert(s);
};

function Open(U,N,F) {
        window.open(U,N,F);
}

