    var tOBj;
    var delay;
  var tooltip =
  {
    attr_name: "tooltip",
    blank_text: "",
    newline_entity: "   ",
    max_width: 250,
    delay: 100,

    t: document.createElement("DIV"),

    c: null,
    g: false,
    m: function(e)
    {
      tooltip.t.style.position='absolute';
      tooltip.t.style.backgroundColor='white';
      tooltip.t.style.border='1px silver solid';
      tooltip.t.style.padding='5px 5px 5px 5px';
      tooltip.t.style.fontStyle='normal';
          tooltip.t.style.textAlign='left';
      if (tooltip.g)
      {
        oCanvas = document.getElementsByTagName((document.compatMode && document.compatMode == "CSS1Compat") ? "HTML" : "BODY")[0];
        x = window.event ? event.clientX + oCanvas.scrollLeft : e.pageX;
        y = window.event ? event.clientY + oCanvas.scrollTop : e.pageY;
        tooltip.a(x, y);
        //tooltip.t.innerHTML = tooltip.t.innerHTML + 'x=' + x + 'y=' + y;

      }
    },
    d: function()
    {
      tooltip.t.setAttribute("id", "tooltip");
      document.body.appendChild(tooltip.t);
      a = document.all && !window.opera ? document.all : document.getElementsByTagName("*");
      aLength = a.length;
      for (var i = 0; i < aLength; i++)
      {
        if (!a[i])
          continue;
        tooltip_title = a[i].getAttribute("title"); // returns form object if IE & name="title"; then IE crashes; so...
        if (tooltip_title && typeof tooltip_title != "string")
          tooltip_title = "";
        tooltip_alt = a[i].getAttribute("alt");
        tooltip_blank = a[i].getAttribute("target") && a[i].getAttribute("target") == "_blank" && tooltip.blank_text;
        if (tooltip_title || tooltip_blank)
        {
          a[i].setAttribute(tooltip.attr_name, tooltip_blank ? (tooltip_title ? tooltip_title + " " + tooltip.blank_text : tooltip.blank_text) : tooltip_title);
          if (a[i].getAttribute(tooltip.attr_name))
          {
            a[i].removeAttribute("title");
            if (tooltip_alt && a[i].complete) a[i].removeAttribute("alt");
            tooltip.l(a[i], "mouseover", tooltip.s);
            tooltip.l(a[i], "mouseout", tooltip.h);
          }

        }
        else
          if (tooltip_alt && a[i].complete)
          {
            a[i].setAttribute(tooltip.attr_name, tooltip_alt);
            if (a[i].getAttribute(tooltip.attr_name))
            {
              a[i].removeAttribute("alt");
              tooltip.l(a[i], "mouseover", tooltip.s);
              tooltip.l(a[i], "mouseout", tooltip.h);
            }
          }
        if (!a[i].getAttribute(tooltip.attr_name) && tooltip_blank)
        {
        }
      }
      document.onmousemove = tooltip.m;
      window.onscroll = tooltip.h;
      tooltip.a(-99, -99);
    },
    s: function(e)
    {
      d = window.event ? window.event.srcElement : e.target;
      if (!d.getAttribute(tooltip.attr_name) && !d.parentNode.getAttribute(tooltip.attr_name) )
        return;
      s = d.getAttribute(tooltip.attr_name) || d.parentNode.getAttribute(tooltip.attr_name);
      if (tooltip.newline_entity)
      {
        s = s.replace(eval("/" + tooltip.newline_entity + "/g"), "<br />");
        tooltip.t.innerHTML = s ;
      }
      else
      {
        if (tooltip.t.firstChild) tooltip.t.removeChild(tooltip.t.firstChild);
        tooltip.t.appendChild(document.createTextNode(s));
      }
      tooltip.c = setTimeout("tooltip.t.style.visibility = 'visible';", tooltip.delay);
      tooltip.g = true;

    },
    h: function(e)
    {
      tooltip.t.style.visibility = "hidden";
      if (!tooltip.newline_entity && tooltip.t.firstChild)
        tooltip.t.removeChild(tooltip.t.firstChild);
      clearTimeout(tooltip.c);
      tooltip.g = false;
      tooltip.a(-99, -99);
    },
    l: function(o, e, a)
    {
      if (o.addEventListener)
        o.addEventListener(e, a, false); // was true--Opera 7b workaround!
      else
        if (o.attachEvent)
          o.attachEvent("on" + e, a);
        else
          return null;
    },
    a: function(x, y)
    {
      oCanvas = document.getElementsByTagName((document.compatMode && document.compatMode == "CSS1Compat") ? "HTML" : "BODY")[0];
      w_width = oCanvas.clientWidth ? oCanvas.clientWidth + oCanvas.scrollLeft : window.innerWidth + window.pageXOffset;
      w_height = window.innerHeight ? window.innerHeight + window.pageYOffset : oCanvas.clientHeight + oCanvas.scrollTop; // should be vice verca since Opera 7 is crazy!
      tooltip.t.style.width = ((tooltip.max_width) && (tooltip.t.offsetWidth > tooltip.max_width)) ? tooltip.max_width + "px" : "auto";
      t_width = tooltip.t.offsetWidth;
      t_height = tooltip.t.offsetHeight;
      tooltip.t.style.left = x + 8 + "px";
      tooltip.t.style.top = y + 8 + "px";
      if (x + t_width > w_width)
        tooltip.t.style.left = w_width - t_width + "px";
      if (y + t_height > w_height)
        tooltip.t.style.top = w_height - t_height + "px";
    }
  }
  var root = window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null;
  if (root)
  {
    if (root.addEventListener)
      root.addEventListener("load", tooltip.d, false);
    else
      if (root.attachEvent)
        root.attachEvent("onload", tooltip.d);
  }
  var  winSize, AjaxLoader;
  $(document).ready(function(){
    winSize  = getWindowSize();
    AjaxLoader  =  document.createElement('DIV');
    $(AjaxLoader).css({
      'z-index': '50',
      display:'none',
      left:(winSize.clientWidth/2 - 110),
      top:(winSize.clientHeight/2 - 10) + winSize.scroll ,
      position: 'absolute'
    });
    $(AjaxLoader).appendTo("body");
    $(AjaxLoader).append('<center><img src="/images/loader.gif" border=0></center>');


    $(".our_work_tumb").each(function(){
      var href  = $(this).parent().attr('href');
      $(this).click(function(){
        getBigPic(href);
        return false;
      })

    })


  });

  function getBigPic(href)
  {
    var newImg = new Image();
    //href  = href + '?rand=' +Math.random();  //alert(href);
    var overLay = document.createElement('DIV');
    winSize = getWindowSize();
    $(overLay).css({
      width: '100%',
      height: winSize.docHeight,
      'background-color': 'silver',
      position: 'absolute',
      'z-index': '40',
      top: '0',
      left: '0',
      display:'none'
    })
    $(overLay).appendTo("body");
    $(newImg).attr({'src':href,'title':'кликнуть, чтобы закрыть'});
    $(newImg).css({'display': 'none','z-index':'10'});
    $(AjaxLoader).css({top:(winSize.clientHeight/2 - 10) + winSize.scroll});
    $(AjaxLoader).show();
    $(overLay).fadeTo('fast',0.80);
    $(overLay).click(function(){
      $(overLay).remove();
      $(AjaxLoader).hide();
    })
    $(newImg).load(function (){
    }, function(){
      bigImgWidth = $(newImg).width();
      if(bigImgWidth==0) bigImgWidth  = $(newImg).attr('width');
      bigImgHeight = $(newImg).height();
      if(bigImgHeight==0) bigImgHeight  = $(newImg).attr('height');
      $(newImg).css({
        left:(winSize.clientWidth/2 - bigImgWidth/2),
        top:(winSize.clientHeight/2 - bigImgHeight/2) + winSize.scroll ,
        position: 'absolute',
        'z-index': '50',
        'border-width': '2px',
        'border-color': 'black',
        'border-style': 'solid'
      });
      $(newImg).click(function(){
        $(newImg).remove();
        $(overLay).remove();
        $(AjaxLoader).hide();
      })
      $(newImg).fadeTo('fast',1);
    });
    $(newImg).appendTo("body");
  }
  function getWindowSize()
  {
    var clientWidth   = $(window).width();
    var clientHeight  = $(window).height();
    var scroll        = $(window).scrollTop();
    var docHeight     = $(document).height();
    var docWidth      = $(document).width();
    return ({'clientWidth': clientWidth, 'clientHeight': clientHeight, 'scroll': scroll, 'docWidth': docWidth, 'docHeight': docHeight});
  }

