function linkClick()
{
//alert("hi");
ShowLoadingMessage();
showexam();
}

function ShowLoadingMessage()
{
document.getElementById("show_k").innerHTML = 'please wait...';

}


var xmlhttp;




function showexam()
{
    //alert(document.getElementById("hdn_examid").value+document.getElementById("hdn_attemptid").value);
           
                     
            xmlhttp=GetXmlHttpObject();
            
            if (xmlhttp==null)
              {
              alert ("Your browser does not support AJAX!");
              return false;
              }
              //alert(document.getElementById("customers").value);
            
            xmlhttp.onreadystatechange=stateChanged;
            //xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

            xmlhttp.open("POST","getscore.asp",true);
            //xmlhttp.send("name=" + document.getElementById("customers").value);
            xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            
            
           var_examid=document.getElementById("hdn_examid").value
           var_attemptid=document.getElementById("hdn_attemptid").value
            
          
             xmlhttp.send("examid=" + encodeURI(var_examid)+ "&attemptid=" + encodeURI(var_attemptid));
            //xmlhttp.send("name=ss");
            
            return false;
            
          
        
}


function stateChanged()
{
if (xmlhttp.readyState==4)
  {
  
    var e_k=document.getElementById('show_k');
     e_k.style.display = 'none';
  
  document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
 //alert(xmlhttp.responseText);
  
  valcompare="<table><tr><td class=red><b>Invalid input values</b></td></tr></table>";
  
  if (valcompare==xmlhttp.responseText)
  {
     window.location="/index.asp";

  
  }
  }
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari

  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
