function ShowProjectImages(section,page)
{
  jQuery('#portfolio').append('<div class="ajax_loader"></div>');

  var docWidth = document.documentElement.clientWidth;
  var wideWidthSite = 1250;
  var isWidehSite =(docWidth > wideWidthSite) ? true : false;

  if (isWidehSite)
  {
    widehsite = 1;
  }
  else
  {
    widehsite = 0;
  }

  if (section =='')
    razdel = '';
  else
    razdel = "/"+section;

  jQuery.ajax
  ({
    type: "post",
    url:  "/portfolio"+razdel+"/show/"+page+"?widehsite="+widehsite,
    data: "test",
    success: function(msg)
    {
      document.getElementById("portfolio").innerHTML = msg;
      jQuery('.ajax_loader').hide();
      initDocumentStructure();
    }
  });
}

function ShowFlash(a,w,h)
{
  if (document.getElementById(a).style.display == "none")
  {
    document.getElementById("overlay_popap").style.display = "block";
    document.getElementById(a).style.display = "block";
    document.getElementById(a).style.marginLeft = -w/2 + "px";
    document.getElementById(a).style.marginTop = -h/2 + "px";

  }
}

function DisplayClose(a)
{
  if (a == 'flash_popup')
  {
    document.getElementById('flash_popup').style.display = "none";
    document.getElementById("overlay_popap").style.display = "none";
  }

}

jQuery(document).keydown(function(event){
  if (event.keyCode == 27) {
    $("#flash_popup").hide();
    $("#overlay_popap").hide();
  }
});
