//функция для подсчета числа оставшихся символов в поле ввода textarea
function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

function confirm_dez(name){
  return confirm('Вы действительно хотите удалить запись?');}
  

//Contador de caracteres.
function Contar(entrada,salida,texto,caracteres) {
  var entradaObj=getObject(entrada);
  var salidaObj=getObject(salida);
  var longitud=caracteres - entradaObj.value.length;
  if(longitud <= 0) {
    longitud=0;
    texto='<span class="disable"> '+texto+' </span>';
    entradaObj.value=entradaObj.value.substr(0,caracteres);
  }
  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}

//функция для добавления в избранное
var bookmarkurl="http://www.gymnasia8.kz"
var bookmarktitle="Gymnasia8.kz - Гимназия №8, Шымкент, Казахстан"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

//функции для подсветки баннеров
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",30)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=40
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=5,left=100,scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}

   function ShowHide(id_layer)
{
 if (id_layer != '')
 {
  var itm = null;
  if (document.getElementById) { itm = document.getElementById(id_layer); }
  else if (document.all) { itm = document.all[id_layer]; }
  else if (document.layers) { itm = document.layers[id_layer]; }

  if (!itm) { /* do nothing */ }
  else if (itm.style)
  {
   if (itm.style.display == "none") { itm.style.display = ""; }
   else { itm.style.display = "none"; }
  }
  else { itm.visibility = "show"; }
 }
}

function HideMenu(id_layer)
{
 if (id_layer != '')
 {
  var itm = null;
  if (document.getElementById) { itm = document.getElementById(id_layer); }
  else if (document.all) { itm = document.all[id_layer]; }
  else if (document.layers) { itm = document.layers[id_layer]; }

  if (!itm) { /* do nothing */ }
  else if (itm.style)
  {
   if (itm.style.display = "") { itm.style.display = "none"; }
   else { itm.style.display = ""; }
  }
  else { itm.visibility = "show"; }
 }
}


