var my_action = '/cgi-bin/mebelus/mebelus.pl';

callJS = function(jsStr) { 
  return eval(jsStr)
}

open_gtshow = function(page, id)
{
 window.open('/mebelus/'+page+'?id='+id+'','gtview',
 'width=760,height=700,scrollbars=yes,resizable=yes');
}

open_gtselect = function(page)
{
 var gt=document.all('gt').options[document.all('gt').selectedIndex].value;
 window.open('/mebelus/'+page+'?id='+gt+'','gtview',
 'width=760,height=700,scrollbars=yes,resizable=yes');
}

open_lamselect = function(page, id)
{
 window.open('/mebelus/'+page+'?id='+id+'','gtview',
 'width=760,height=400,scrollbars=yes,resizable=yes');
}

reset_images = function(index)
{
    document.all('k_t').value='';
    document.all('k_t_img').src='/images/1.gif';
    document.all('m_t').value='';
    document.all('m_t_img').src='/images/1.gif';
    $('#hp').val( $('#gt option:selected').attr('mebelus:price') );
    if (index > 0)
       {
        document.getElementById('cloth1').style.display = 'block';
        document.getElementById('cloth2').style.display = 'block';
       }
      else
       {
        document.getElementById('cloth1').style.display = 'none';
        document.getElementById('cloth2').style.display = 'none';
       }
}

reloadPrices = function(var_id, gab_id)
    {
     if (var_id != null)
        {
         $("#select_place").html('<img src="/images/ajax-loader.gif">');
         $("#table_place").html('<img src="/images/ajax-loader.gif">');
         $.get(''+my_action+'', { action: "up_pr", id: var_id, size: gab_id, place: "select" },
               function(data){
                  $("#select_place").html(data);
               });
         $.get(''+my_action+'', { action: "up_pr", id: var_id, size: gab_id, place: "table" },
               function(data){
                  $("#table_place").html(data);
               });
        }
    }

$(document).ready(function(){

    $('#select_place').ajaxError(function(){
        $("#select_place").html('<p>Error</p>');
   });
});

