isDOM=(document.getElementById)?true:false;
isOpera=isOpera5=window.opera && isDOM;
isMSIE=isIE=document.all && document.all.item && !isOpera;

function disabletext(e)
{
  if (e && e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA' ) return false;
  return;
}
 
function disableEvent()
{
  if (isDOM && !isMSIE)
  {
    document.onmousedown=disabletext;
    document.onclick=new Function("return true");
  }
  else
    document.onselectstart=new Function ("return false");
}


function popup(i)
{
  var str = new Array(2);
  str[2] = ' о подвесных потолках';
  str[1] = ' о натяжных потолках';
    
  $("div.more_text").each(
    function()
    {
      if (this.id == "more_text" + i)
      {
         if (this.style.display != 'block')
         {
            this.style.display = 'block';
            $("p#block_text"+i+" a.down").each(
               function() {
                  $(this).html('<img src="/image/layout/i-up.gif" alt="">');
               }
            );
            $("p#block_text"+i+" a.more").each(
               function() {
                  $(this).html('Свернуть');
               }
            );
            $("p#block_text" + i).each(
               function() {
                  $(this).addClass('yellow');
               }
            );
         }
         else {
            this.style.display = 'none';
            $("p#block_text"+i+" a.down").each(
               function() {
                  $(this).html('<img src="/image/layout/i-down.gif" alt="">');
               }
            );
            $("p#block_text1 a.more").each(
               function() {
                  $(this).html('Подробнее'+str[2]);
               }
            );
            $("p#block_text2 a.more").each(
               function() {
                  $(this).html('Подробнее'+str[1]);
               }
            );
            $("p#block_text" + i).each(
               function() {
                  $(this).removeClass('yellow');
               }
            );
         }
      }
      else
      {
        this.style.display = 'none';
        $("p.block_text").each(
           function()
           {
             if (this.id != "block_text"+i)
             {
              $(this).removeClass('yellow');
              $("p#" + this.id + " a.down").each(
                function()
                {
                  $(this).html('<img src="/image/layout/i-down.gif" alt="">');
                });
              $("p#" + this.id + " a.more").each(
                function()
                {
                  $(this).html('Подробнее'+str[i]);
                });
             }
           }
        );
      }
      
    } );
}

function getHeight() {
  myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && document.documentElement.clientHeight ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && document.body.clientHeight ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}
