var d = document;
function GetById(id) { return d.all ? d.all[id] : d.getElementById(id); }
function formCheck2(form_name) {
   if (!form_name.query.value.match(/.+/) || form_name.query.value == 'Поиск по сайту') {
     alert("Укажите текст для поиска.");
     form_name.query.focus();
     return false;
   }
}

function fnShowClip(divdescr) {
if (!divdescr) divdescr = 'show_movie';
fnShowOverlay();
var w = $(window);
  $("#"+divdescr+"").css("top",(w.height()-$("#"+divdescr+"").height())/4.5+w.scrollTop() + 100 + "px");
  $("#"+divdescr+"").css("left",(w.width()-$("#"+divdescr+"").width())/2+w.scrollLeft() + "px");
  if ($("#multi_content").html() == '') {
    $.ajax({
      type: "POST",
      url: '/ajax/multi.htm',
      cache:false,
      success: function(page) {
        $("#multi_content").empty().html(page);
      }
    });

  }

  //$("#"+divdescr+"").css("width","10px");
  //$("#"+divdescr+"").animate({ width: 350 }, 1000 );

}

function fnFormClose(obj_id) {
  $("#"+obj_id+"").css("left", "-950px");
  $("#multi_content").empty();
  fnHideOverlay();
}

function fnCreateOverlay() {
   $('<div id="site_wrap"></div>').appendTo("body");
   $("#site_wrap").prepend('<div id="site_overlay"></div>');
   $("#site_overlay").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': 0.7});

   if ($.browser.msie) {
    $("#site_wrap").prepend('<iframe id="site_bigIframe" scrolling="no" frameborder="0"></iframe>');
    $("#site_bigIframe").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': 0});
   }

   $("#site_overlay, #site_bigIframe").hide();

//   $("#site_overlay").click();
}

function fnShowOverlay() {
  $("#site_overlay,#site_bigIframe").fadeIn("fast").show();
}

function fnHideOverlay() {
  $("#site_overlay,#site_bigIframe").fadeOut("fast").hide();
}

function fnCloseOverlay() {
  $("#site_overlay,#site_bigIframe").fadeOut("fast").remove();
}
