﻿function UcitajArtikal(id)
{
    var xmlhttp;
    document.getElementById("a_c_" + id).innerHTML = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"width: 100%; height: 100%\"><tr><td style=\"width: 100%; height: 100%\" align=\"center\" valign=\"middle\"><img src=\"Graphics/loading.gif\" alt=\"\" /></td></tr></table>";
    if (window.XMLHttpRequest)
      {// IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.onreadystatechange=function()
    {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            if(xmlhttp.responseText!="no")
            {
                if(xmlhttp.responseText.indexOf("<!DOCTYPE") >= 0)
                    document.getElementById("a_" + id).innerHTML = xmlhttp.responseText.substring(0,xmlhttp.responseText.indexOf("<!DOCTYPE"));
                else
                    document.getElementById("a_" + id).innerHTML = xmlhttp.responseText;
            }
            else
            {
                document.getElementById("a_" + id).innerHTML = "Greška !";
            }
        }
    }
    xmlhttp.open("GET","UcitajArtikal.aspx?id=" + id, true);
    xmlhttp.send();
}

