
function lotListCheckBoxClick(id)
{
  chbObj = document.getElementById('lot_' + id + '_id');
  btnCheckedImgObj = document.getElementById('checkedBtn_' + id + '_id');
  btnNotCheckedImgObj = document.getElementById('notCheckedBtn_' + id + '_id');
  
  if(chbObj.checked)
  {
    chbObj.checked = false;
    btnCheckedImgObj.style.display = 'none';
    btnNotCheckedImgObj.style.display = 'inline';
  }
  else
  {
    chbObj.checked = true;
    btnCheckedImgObj.style.display = 'inline';
    btnNotCheckedImgObj.style.display = 'none';
  }
}

var lotDetailSetBig2PhotoUrl = ''
function lotDetailSetBigPhoto($big1URL, $big2URL)
{
  lotDetailSetBig2PhotoUrl = $big2URL;
  $('#big1PanelShadowIMGdiv_id').css('background-image', "url('"+$big1URL+"')");
}

function showBig2ImagePage()
{
  if(lotDetailSetBig2PhotoUrl !== undefined && lotDetailSetBig2PhotoUrl != '')
  {
    showBB();

    code  = "<div style='position:absolute;z-index:1001;overflow:auto;width:100%;height:100%;' id='bigPhotoDivID' onclick=\"hideBig2ImagePage();\">";
    code += "<img src='"+lotDetailSetBig2PhotoUrl+"' id='bigPhotoID' style='top:0px;left:0px;visibility:hidden;' onload='loadedBig2Image();'>";
    code += "</div>";
    
    $('#addcodediv').html($('#addcodediv').html() + code);
    $('#addcodediv').show();
    
    $('#bigPhotoDivID').offset({ 
      top: document.body.scrollTop, 
      left: 0 
    });
    
  }
}

function loadedBig2Image()
{
  $('#bigPhotoDivID').show();
  
  width = $('#bigPhotoID').width();
  height = $('#bigPhotoID').height();
  clientWidth = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
  showedClientHeight = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
  
  $('#bigPhotoID').offset({ 
    top: $(document).scrollTop() + ((showedClientHeight - height) / 2), 
    left: (clientWidth - width) / 2 
  });
  
  $('#bigPhotoID').show();
  $('#bigPhotoID').css('visibility', 'visible');
}

function hideBig2ImagePage()
{
  $('#addcodediv').hide();
  $('#bigPhotoDivID').hide();
  $('#bigPhotoID').hide();
  
  $('#bigPhotoID').remove();
  $('#bigPhotoDivID').remove();
  
  hideBB();
}

function showBig2ImagePage_old()
{
  if(lotDetailSetBig2PhotoUrl !== undefined && lotDetailSetBig2PhotoUrl != '')
  {
    var lotBigPhotoWindow = open(lotDetailSetBig2PhotoUrl);
  }
}

//показать бг
function showBB()
{
  objBB = document.getElementById('blackbackdiv');
  objBB.style.opacity = 7/10;
  objBB.style.filter = 'alpha(opacity=' + 7*10 + ')';
  objBB.style.width = '100%';
  objBB.style.height = $(document).height()+'px';
  //$(document.body).css('overflow', 'hidden');
  objBB.style.display = 'inline';
}

//скрыть бг
function hideBB()
{
  objBB = document.getElementById('blackbackdiv');
  objBB.style.display = 'none';
  objBB.style.opacity = 0/10;
  objBB.style.filter = 'alpha(opacity=' + 0*10 + ')';
  //$(document.body).css('overflow', 'auto');
}

function is_int(input){
  return typeof(input)=='number'&&parseInt(input)==input;
}

function filterHideNotChecked(bodyDivID)
{
  chbDivs = $('#' + bodyDivID).children('div');
  for(i in chbDivs)
  {
    if(is_int(parseInt(i)))
    {
      if($(chbDivs[i]).attr('class') == 'filterGroupBodyCHB')
        if($(chbDivs[i]).children('a').children('input[type=checkbox]').is(':checked') == false)
          $(chbDivs[i]).hide();
    }
  }
}

function filterShowNotChecked(bodyDivID)
{
  chbDivs = $('#' + bodyDivID).children('div');
  for(i in chbDivs)
  {
    if(is_int(parseInt(i)))
    {
      if($(chbDivs[i]).attr('class') == 'filterGroupBodyCHB')
        if($(chbDivs[i]).children('a').children('input[type=checkbox]').is(':checked') == false)
          $(chbDivs[i]).show();
    }
  }
}

function filterShowArrParams(bodyDivID)
{
  filterShowNotChecked(bodyDivID);
  $('#'+bodyDivID+'_allParamsHrefDiv').hide();
}

function searchtopinput_onFocus(inputObj)
{
  if(inputObj.value == 'ПОИСК')
  {
    inputObj.value = '';
    inputObj.className = 'searchtopinput_using';
  }
}

function searchtopinput_onOut(inputObj)
{
  if(inputObj.value == 'ПОИСК' || inputObj.value == '')
  {
    inputObj.className = 'searchtopinput';
    inputObj.value = 'ПОИСК';
  }
}

