
function loadHTML(file, dest, param, add) 
{
  $.ajax(
  {
     url: file + param,
     beforeSend: function()
     {
       if ( add != "+" && add != "-" && add != "s")
       {
         $("#"+dest).html("<img src='/images/wait.gif'/>")
                    .slideDown(700);;
       }
     },
     success: function(answ)
     {
       if ( add == "+" )
       {
         $("#"+dest).hide()  
                     .append(answ)
                     .slideDown(700);
       }
       else
       {
         if ( answ != '' && add != 's' )
         {
            $("#"+dest).hide()  
                        .html(answ)
                        .slideDown(700);
         }
         else
         {
            $("#"+dest).slideUp(700)
                       .html(answ)
                       ;
         }
       }
     }
  }
  );
}

function validate(textform)
{
    
    text = eval("document.getElementById('" + textform + "').value")
    
    if ( text.length > 300 )
    {
       text = text.substring(0, 300);
       eval("document.getElementById('" + textform + "').value = '" + text + "'")
    }
    document.getElementById(textform + '_col').innerHTML = 300 - text.length;
 }
 
function show(id)
{
  block = document.getElementById(id).style
  if ( block.display == 'none' )
  {
    block.display = '';
  }
  else
  {
    block.display = 'none';
  }
}

function show_error( id )
{
   var value = document.getElementById(id).innerHTML;
   if ( value != "" && value != "ok" )
   {
      $("#"+id).show();
   }
}
function hide( id )
{
   $("#"+id).hide();
}
function set_show( id )
{
   if ( document.getElementById("layer" + id).style.display == 'none' )
   {
      $(".nobold").hide(150);
      $("#layer" + id).show(150);
      document.location = $("#a" + id).attr("href");
   }
   else
   {
      document.location = $("#a" + id).attr("href");
   }
}


