//функция для подсчета числа оставшихся символов в поле ввода 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;
}

//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);
}

//функция для показа карты в pop-up окне
function ShowMap(url)
          {
           var pup = window.open(url, 'renterinfo','status=no,resizable=no,menubar=no,toolbar=no,scrollbars=no,height=378,width=400,left=200,top=50');
           if (window.focus)
             {
              pup.focus();
             }
          }

//функция для показа закачки файла в pop-up окне
function ShowURL(url)
          {
           var pup = window.open(url, 'renterinfo','status=no,resizable=no,menubar=no,toolbar=no,scrollbars=no,height=267,width=400,left=100,top=5');
           if (window.focus)
             {
              pup.focus();
             }
          }

//функция для показа фотографий в pop-up окне
function ShowPHOTO(url)
          {
           var pup = window.open(url, 'renterinfo','status=no,resizable=no,menubar=no,toolbar=no,scrollbars=no,height=375,width=500,left=100,top=5');
           if (window.focus)
             {
              pup.focus();
             }
          }

//функция для показа фотографий в pop-up окне
function ShowPHOTO2(url)
          {
           var pup = window.open(url, 'renterinfo','status=no,resizable=no,menubar=no,toolbar=no,scrollbars=no,height=500,width=375,left=100,top=5');
           if (window.focus)
             {
              pup.focus();
             }
          }		  

//функция для добавления в избранное
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 ShowWindow(url)
   {
    var pup = window.open(url, 'renterinfo',
    'status=no,resizable=no,menubar=no,toolbar=no,scrollbars=no,height=300,width=225,left=100,top=5');
    if (window.focus)
      {
       pup.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"; }
 }
}


