
function err_status(x,e)
{
  if(x.status==0){
    alert('You are offline!!\n Please Check Your Network.');
    }else if(x.status==404){
    alert('Requested URL not found.');
    }else if(x.status==500){
    alert('Internel Server Error.');
    }else if(e=='parsererror'){
    alert('Error.\nParsing JSON Request failed.');
    }else if(e=='timeout'){
    alert('Request Time out.');
    }else {
    alert('Unknow Error.\n'+x.responseText);
    }
}

function content_ch(docid, liactive)
{
  $(document).ready(function() {
    $('#smallContenttd').css('background', 'url(assets/js/loader.gif) no-repeat');
     $('#smallContenttd').css('background-position', 'center');
    
    $.ajax({
      url: "assets/js/java/ajax_getcontent.php",
      global: true,
      type: "POST",
      data: ({
              docin : docid
            }),
      dataType: "html",
      success: function(data){
        $("#menu_sm li").removeClass("active");
        $('#'+liactive).addClass("active");
        $('#smallContenttd').css('background', 'url()');
        
        
        if( jQuery.trim(data) == '' )
        {
          $('#smallContent').html('');
        }
        else
        {
          $('#smallContent').html(data);
        }
        $('#smallContenttd').css('background', 'url()');
      },
      error:function(x,e){
        $('#smallContenttd').css('background', 'url()');
        err_status(x,e);
      }
    });
    
  });
}