var toq = 0;
var poq = 0;
var cpi = 0;
var cqi = 0
var url;
var responseSuccess = function(o){ 
  toq = toq - poq;
  poq = 0;
  //alert("Hi 3 success = " + toq);
  document.questionform.toq.value = toq;
}
var callback =
{
  success: responseSuccess,
  timeout: 5000
}
function setContextPath (path) {
  url = path + "/s/c/testelapsedincrementservlet?";
  //alert("Hi url = " + url);
}
function initTimer(arg, arg2) {
  //alert("Hi");
  cpi = arg;
  cqi = arg2;
  setTimeout ("ut()",1000);
}
function ut () {
  toq ++;
 
  if ((toq%5)==0) {
    // Reset the poq timer
    poq = toq;
//alert("Hi 2 = " + toq);
//alert("Hi url = " + url + "cpi=" + cpi + "&cqi=" + cqi + "&toq=" + toq);
    // Send request for updating the time
    YAHOO.util.Connect.asyncRequest('GET', url + "cpi=" + cpi + "&cqi=" + cqi + "&toq=" + toq, callback, null); 
  }
  document.questionform.toq.value = toq;
  setTimeout ("ut()",1000);
}
