function getsub1(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub1;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub1;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub1()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcor = req.responseText;	
            //alert(gcor);
            minsub1(gcor);
        }
    }
}

function minsub1(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
/*      if (fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var opt = document.createElement('option');
	     opt.text = nm;
	     opt.value = cd;
             var el = document.getElementById('pricent');
             try {
	      	    el.add(opt,null); 
	         }
	     catch(ex) 
	         {
	      	    el.add(opt); 
	         }
          cd="";
          nm=""; 
          }
      }
      else 
*/      
      if (fname=="subcd" || fname=="subnm")
      {
      	  if(fname=="subcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="subnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var opt = document.createElement('option');
	     opt.text = nm;
	     opt.value = cd;
             var el = document.getElementById('subcd_1_2');
	     try {
	      	    el.add(opt,null); 
	         }
	     catch(ex) 
	         {
	      	    el.add(opt); 
	         }
      	     var opt1 = document.createElement('option');
	     opt1.text = nm;
	     opt1.value = cd;

             var elSel2 = document.getElementById('subcd_1_3');
	     try {
	      	    elSel2.add(opt1,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel2.add(opt1); // IE only
	         }

      	     var opt2 = document.createElement('option');
	     opt2.text = nm;
	     opt2.value = cd;

             var elSel3 = document.getElementById('subcd_1_4');
	     try {
	      	    elSel3.add(opt2,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel3.add(opt2); // IE only
	         }

      	     var opt3 = document.createElement('option');
	     opt3.text = nm;
	     opt3.value = cd;

             var elSel4 = document.getElementById('subcd_1_5');
	     try {
	      	    elSel4.add(opt3,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel4.add(opt3); // IE only
	         }

      	     var opt4 = document.createElement('option');
	     opt4.text = nm;
	     opt4.value = cd;

             var elSel5 = document.getElementById('subcd_1_6');
	     try {
	      	    elSel5.add(opt4,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel5.add(opt4); // IE only
	         }

      	     var opt5 = document.createElement('option');
	     opt5.text = nm;
	     opt5.value = cd;

             var elSel6 = document.getElementById('subcd_1_7');
	     try {
	      	    elSel6.add(opt5,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel6.add(opt5); // IE only
	         }

      	     var opt6 = document.createElement('option');
	     opt6.text = nm;
	     opt6.value = cd;

             var elSel7 = document.getElementById('subcd_1_8');
	     try {
	      	    elSel7.add(opt6,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel7.add(opt6); // IE only
	         }
	     cd="";
             nm="";     
         }
      }
   }
    return 'Y';  
}

function getsub2(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub2;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub2;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub2()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            minsub2(gcorstr);
        }
    }
}

function minsub2(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";
   //alert(fields.length);

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
      //alert(fname+"****"+fval)
      if (fname=="subcd")
      {//alert(fval);
          var el1_2 = document.getElementById('subcd_1_3');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_4');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_5');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_6');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_7');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_8');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
      }
      else if(fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  { 
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('tccntr_1_2');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
   }
    return 'Y';  
}

function getsub3(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub3;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub3;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub3()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            minsub3(gcorstr);
        }
    }
}

function minsub3(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";

   //alert(fields.length);

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
      //alert(fname+"****"+fval)
      if (fname=="subcd")
      {//alert(fval);
          var el1_2 = document.getElementById('subcd_1_4');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_5');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_6');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_7');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_8');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
      }
      else if(fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
             //alert(cd+"**"+nm);
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel12 = document.getElementById('tccntr_1_3');
	     try {
	      	    elSel12.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel12.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
   }
    return 'Y';  
}

function getsub4(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub4;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub4;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub4()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            minsub4(gcorstr);
        }
    }
}

function minsub4(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm1="";
   var cd1="";

   //alert(fields.length);

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
      //alert(fname+"****"+fval)
      if (fname=="subcd")
      {//alert(fval);
          var el1_2 = document.getElementById('subcd_1_5');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_6');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_7');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_8');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
      }
      else if(fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd1=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm1=fval;
      	  }
      	  if(nm1.length>0 && cd1.length>0)
      	  {
             
      	     var optadd = document.createElement('option');
	     optadd.text = nm1;
	     optadd.value = cd1;
	     var elSel = document.getElementById('tccntr_1_4');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
   }
    return 'Y';  
}

function getsub5(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub5;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub5;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub5()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            minsub5(gcorstr);
        }
    }
}

function minsub5(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";

   //alert(fields.length);

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
      //alert(fname+"****"+fval)
      if (fname=="subcd")
      {//alert(fval);
          var el1_2 = document.getElementById('subcd_1_6');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_7');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_8');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
      }
      else if(fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('tccntr_1_5');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
   }
    return 'Y';  
}

function getsub6(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub6;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub6;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub6()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            minsub6(gcorstr);
        }
    }
}

function minsub6(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";

   //alert(fields.length);

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
      //alert(fname+"****"+fval)
      if (fname=="subcd")
      {//alert(fval);
          var el1_2 = document.getElementById('subcd_1_7');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
          var el1_2 = document.getElementById('subcd_1_8');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
      }
      else if(fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('tccntr_1_6');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
   }
    return 'Y';  
}

function getsub7(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub7;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub7;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub7()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            minsub7(gcorstr);
        }
    }
}

function minsub7(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";

   //alert(fields.length);

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
     // alert(fname+"****"+fval)
      if (fname=="subcd")
      {//alert(fval);
          var el1_2 = document.getElementById('subcd_1_8');
          for (l = el1_2.length - 1; l>=0; l--) 
          {//alert(el1_2.options[l].value);
              if(el1_2.options[l].value==fval)
              {     
                el1_2.remove(l);
              }    
          }
      }
      else if(fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('tccntr_1_7');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
   }
    return 'Y';  
}

function getsub8(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangesub8;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangesub8;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangesub8()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            minsub8(gcorstr);
        }
    }
}

function minsub8(resstr)
{
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";

   //alert(fields.length);

   for (i=1; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
      //alert(fname+"****"+fval)
      if(fname=="centcd" || fname=="centnm")
      {
      	  if(fname=="centcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="centnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('tccntr_1_8');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
   }
    return 'Y';  
}




function getData(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChange;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChange;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChange()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
        //alert(req.status);
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            //alert(gcorstr);
            setData(gcorstr);
        }
  //      else
//	{
//            alert("Data Not Found");
//	}
    }
}
function getDataprn(url)
{
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
	req.onreadystatechange = processReqChangeprn;
	req.open("GET", url, true);
	req.send(null);
    }
    // branch for IE/Windows ActiveX version
    else if (window.ActiveXObject)
    {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	if (req)
	{
	    req.onreadystatechange = processReqChangeprn;
	    req.open("GET", url, true);
	    req.send(null);
	}
    }
}

function processReqChangeprn()
{
 // only if req shows "complete"
    if (req.readyState == 4)
    {
        // only if "OK"
	if (req.status == 200)
	{
            gcorstr = req.responseText;	
            if(gcorstr.indexOf('Error')==-1)
              document.getElementById('mthnm').focus();  
            setData(gcorstr);
        }
        else
	{
            alert("Invalid PRN No.");
            document.getElementById('prnno').value="";
            onUndo();
	}
    }
}  

function setData(resstr)
{
//alert("========"+resstr);
   var l = resstr.length;
   var fields = resstr.split("|");
   var nm="";
   var cd="";
   var shrtnm="";
   var late="";
   var nofill=""

   for (i=0; i<fields.length; i++)
   {  
      var fname = "";
      var fval = "";
      var k = fields[i].indexOf('>');
      if (k != -1)
      {
         fname = fields[i].substr(0,k);
         fval = fields[i].substr(k+1);
      }
      // Logic for assigning values to form fields
      //alert(fname+"****"+fval)
      if (fname=="cotycd"||fname=="cotynm")
      {
      	  if(fname=="cotycd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="cotynm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('crstype');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }
      }
      else if (fname=="cstcd"||fname=="cstnm")
      {
      	  if(fname=="cstcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="cstnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('cstctg');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
	     cd="";
             nm="";     
      	  }
      }
      else if(fname=="bccd")
      {  //alert(fval+"****")
          if(fval!="null" || fval!="0")
          {//alert("in")
             document.getElementById('cstctg').value=fval;
             document.getElementById('cstctg').disabled=true;
          }
          else 
          {
// alert("in else") 
            document.getElementById('cstctg').disabled=false;
          }
      }
      else if(fname=="nm")
      { 
          document.getElementById('name').value=fval;
          document.getElementById('name').disabled=true;
      }
      else if(fname=="Error")
      {
            alert("Invalid PRN No.");
            document.getElementById('prnno').value="";
            document.getElementById('reset').focus();
            //onUndo();
      }
      else if(fname=="mthnm")
      {   
          if(fval!="null")
          {
              document.getElementById('mthnm').value=fval;
              document.getElementById('mthnm').focus(); 
              //document.getElementById('mthnm').disabled=true;
          }
          //document.getElementById('mthnm').disabled=true;  
      }
      else if(fname=="add1")
      { 
          if(fval!="null")
          {
              document.getElementById('addforcurrs1').value=fval;
              document.getElementById('addforcurrs1').disabled=true;
          }
      }
      else if(fname=="add3")
      { 
          if(fval!="null")
          {
              document.getElementById('addforcurrs3').value=fval;
              document.getElementById('addforcurrs3').disabled=true;
          }          
      }
      else if(fname=="add2")
      { 
          if(fval!="null")
          {
              document.getElementById('addforcurrs2').value=fval;
              document.getElementById('addforcurrs2').disabled=true;
          }
      }
      else if(fname=="city")
      { 
          if(fval!="null")
          {
              document.getElementById('cty').value=fval;
             document.getElementById('cty').disabled=true;
          }
      }
      else if(fname=="dist")
      { 
          if(fval!="null")
          {
              document.getElementById('dist').value=fval;
              document.getElementById('dist').disabled=true; 
          }
      }
      else if(fname=="pin")
      { 
          if(fval!="null")
          {
              document.getElementById('pincd').value=fval;
              document.getElementById('pincd').disabled=true;
          }          
      }
      else if(fname=="tele")
      { 
          if(fval!="null")
          {
              document.getElementById('telno').value=fval;
              document.getElementById('telno').disabled=true;
          }          
      }
      else if(fname=="clgnm")
      { 
          if(fval!="null")
          {
              document.getElementById('prevclg').value=fval;
              document.getElementById('prev_univ').value="Shivaji University";
          }
          document.getElementById('prevclg').disabled=true;
          document.getElementById('prev_univ').disabled=true;
      }
      else if(fname=="exnm")
      { 
          if(fval!="null")
          {
              document.getElementById('exm_txt').value=fval;
          }
          document.getElementById('exm_txt').disabled=true;
      }
      else if(fname=="setno")
      { 
          if(fval!="null")
          {
              document.getElementById('setno').value=fval;
          }
          document.getElementById('setno').disabled=true;
      }
      else if(fname=="exyr")
      { 
          if(fval!="null")
          {
              document.getElementById('yrofpass').value=fval;
          }
          document.getElementById('yrofpass').disabled=true;
      }
      else if(fname=="coflg")
      { 
          if(fval!="null") 
          {
            document.getElementById('clgflg').value=fval;  
            /*document.getElementById('tccntr_1_2').disabled=true;                 
            document.getElementById('tccntr_1_3').disabled=true;                 
            document.getElementById('tccntr_1_4').disabled=true;                 
            document.getElementById('tccntr_1_5').disabled=true;                 
            document.getElementById('tccntr_1_6').disabled=true; */
          }
          if(fval.indexOf('A')!=-1)
          {
                document.getElementById('cntr').disabled=true;
                document.getElementById('hostel_yn').disabled=true; 
                document.getElementById('prinsub').disabled=true; 
                //document.getElementById('pricent').disabled=true;
                //document.getElementById('subcd_1_2').disabled=false; 
               // ifflgisA();
          } 
            // document.getElementById('prnno').disabled=true;   
      }
      else if(fname=="cotypflg")
      {  
          if(fval!="4") //if student select other than Bachelor Courses
          {
             var optadd = document.createElement('option');
	     optadd.text = "Shivaji University"
	     optadd.value = 1;
	     var elSel = document.getElementById('prvuni');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
             var optadd = document.createElement('option');
	     optadd.text = "Other University"
	     optadd.value = 2;
	     var elSel = document.getElementById('prvuni');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
          }
          else if(fval=="4") //if student select Bachelor Courses
          { //alert("in");
             var optadd = document.createElement('option');
	     optadd.text = "Kolhapur Board"
	     optadd.value = 11;
	     var elSel = document.getElementById('prvuni');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
             var optadd = document.createElement('option');
	     optadd.text = "From Maharashtra Outside Kolhapur Board"
	     optadd.value = 12;
	     var elSel = document.getElementById('prvuni');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
             var optadd = document.createElement('option');
	     optadd.text = "Outside Maharashtra";
	     optadd.value = 13;
	     var elSel = document.getElementById('prvuni');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }
          }
      }
      else if(fname=="brcd")
      { 
          if(fval!="null")
          { 
              document.getElementById('prisub').value=fval;
          }   
          document.getElementById('prisub').disabled=true;
      }
      else if(fname=="sexcd")
      { 
          if(fval!="null")
          { 
                document.getElementById('gender').value=fval;
          }   
          document.getElementById('gender').disabled=true;
      }
      else if (fname=="CENTCDENT" || fname=="CENTCD")
      {
      	  if(fname=="CENTCD")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="CENTCDENT")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  { //alert(cd+"****"+nm)
      	      var opt = document.createElement('option');
	      opt.text = nm;
	      opt.value = cd;
	      var el = document.getElementById('cntr');
              try {
                  el.add(opt,null); // standards compliant; doesn't work in IE
                  }
              catch(ex) 
                  {
                   el.add(opt); // IE only
                  }
             cd="";
             nm=""; 
          }
      }
      else if (fname=="medCenter" || fname=="medCenternm")
      {
      	  if(fname=="medCenter")
       	  {
       	     cd=fval;
       	  }
       	  else if(fname=="medCenternm")
      	  {
      	      nm=fval;
       	  }
       	  if(nm.length>0 && cd.length>0)
       	  { //alert(cd+"****"+nm)
       	      var opt = document.createElement('option');
      	      opt.text = nm;
      	      opt.value = cd;
      	      var el = document.getElementById('tccntr_1_2');
              try {
                      el.add(opt,null); // standards compliant; doesn't work in IE
                  }
              catch(ex) 
                  {
                      el.add(opt); // IE only
                  }
       	      var opt1 = document.createElement('option');
      	      opt1.text = nm;
      	      opt1.value = cd;                  
              var e2 = document.getElementById('tccntr_1_3');
              try {
                      e2.add(opt1,null); // standards compliant; doesn't work in IE
                  }
              catch(ex) 
                  {
                      e2.add(opt1); // IE only
                  }             
       	      var opt2 = document.createElement('option');
      	      opt2.text = nm;
      	      opt2.value = cd;                  
              var e3 = document.getElementById('tccntr_1_4');
              try {
                      e3.add(opt2,null); // standards compliant; doesn't work in IE
                  }
              catch(ex) 
                  {
                      e3.add(opt2); // IE only
                  }   
       	      var opt3 = document.createElement('option');
      	      opt3.text = nm;
      	      opt3.value = cd;                  
              var e4 = document.getElementById('tccntr_1_5');
              try {
                      e4.add(opt3,null); // standards compliant; doesn't work in IE
                  }
              catch(ex) 
                  {
                      e4.add(opt3); // IE only
                  }
       	      var opt4 = document.createElement('option');
      	      opt4.text = nm;
      	      opt4.value = cd;                  
              var e5 = document.getElementById('tccntr_1_6');
              try {
                      e5.add(opt4,null); // standards compliant; doesn't work in IE
                  }
              catch(ex) 
                  {
                      e5.add(opt4); // IE only
                  }    
              cd="";
              nm=""; 
          }
      }
/*      else if(fname=="bedmethcd" || fname=="bedmethnm")
      {
      	  if(fname=="bedmethcd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="bedmethnm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd1 = document.createElement('option');
	     optadd1.text = nm;
	     optadd1.value = cd;
	     var elSel1 = document.getElementById('bedmeth1');
	     try {
	      	    elSel1.add(optadd1,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel1.add(optadd1); // IE only
	         }
	         
      	     var optadd2 = document.createElement('option');
	     optadd2.text = nm;
	     optadd2.value = cd;
	     var elSel2 = document.getElementById('bedmeth2');
	     try {
	      	    elSel2.add(optadd2,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel2.add(optadd2); // IE only
	         }
	     cd="";
             nm="";     
      	  }          
      }
*/      
      else if (fname=="formfee")
      {
          if(fval!="null") 
          {
            document.getElementById('formfee').value=fval; 
            document.getElementById('amt').value=parseFloat(document.getElementById('formfee').value); 
          }
      }
      else if(fname=="Err")
      {
          alert('Form Submission date of this Course is not Declared  ');
          dis();
         // document.getElementById('prnno').disabled=true;
          document.getElementById('save').disabled=true;
          document.getElementById('reset').focus();
      }
      else if (fname=="subreq")
      {
          if(fval!="null") 
          {
      		  if(fval=='N')
      		  {
      		        document.getElementById('tccntr_1_2').disabled=false;
      		        document.getElementById('subcd_1_2').disabled=true;
      		  }
      		  if(fval=='Y')
		  { 
		    	if(document.getElementById('clgflg').value=='E')
		    	{
		    		document.getElementById('tccntr_1_2').disabled=false;
		    	}
                        /*if((document.getElementById('clgflg').value=='A')||(document.getElementById('clgflg').value=='E'))
                        {
                            document.getElementById('subcd_1_2').disabled=false;

                        }*/
      		  }     
      		  document.getElementById('subreq').value=fval;   
      		  document.getElementById('prinsub').disabled=false;
          }
      }
      else if (fname=="persub")
      {
          if(fval!="null") 
          {
            document.getElementById('persubfee').value=fval; 
          }
      }
      else if (fname=="firstsubfee")
      {
          if(fval!="null") 
          {
            document.getElementById('1st_sub_fee').value=fval; 
          }
      }
      else if (fname=="latefee")
      {
          if(fval!="null") 
          {
            document.getElementById('latefee').value=fval; 
          }
      }      
      else if (fname=="late" ||fname=="noformfill")
      {
          if(fname=="late")
          {   late=fval;
              document.getElementById('laterem').value=fval; 
          }
          else if(fname=="noformfill")
   	  {   nofill=fval;
   	      document.getElementById('notaccept').value=fval;
   	  }
   	  if(nofill.length>0 && late.length>0)
   	  {//alert(late+" *** "+nofill);
   	  	/*if((parseInt(document.getElementById('laterem').value)>0)&&
   	  	   (parseInt(document.getElementById('notaccept').value)<=0))
	       	{
	      	      	document.getElementById('amt').value=parseFloat(document.getElementById('amt').value)+parseFloat(document.getElementById('latefee').value); 
	       	}*/
	       	if(parseInt(document.getElementById('notaccept').value)>0)
	       	{
	              //onUndo();
	              alert('Form Submission date is Expired, You Can not Fill the Form');
	              /*var elSel12 = document.getElementById('prvuni');
		      for (i = elSel12.length - 1; i>=0; i--) 
		      {
		            elSel12.remove(i);
    		      }*/
    		      dis();
    		      //document.getElementById('prnno').disabled=true;
    		     // onUndo();
    		     document.getElementById('save').disabled=true;
	             document.getElementById('reset').focus();
		}
          }
      }      
      else if (fname=="fomdate")
      {
          if(fval!="null") 
          {
            document.getElementById('fomdate').value=fval; 
          }
      }
      else if (fname=="dep_co_cd"||fname=="dep_co_nm")
      {
      	  if(fname=="dep_co_cd")
      	  {
      	     cd=fval;
      	  }
      	  else if(fname=="dep_co_nm")
	  {
	      nm=fval;
      	  }
      	  if(nm.length>0 && cd.length>0)
      	  {
      	     var optadd = document.createElement('option');
	     optadd.text = nm;
	     optadd.value = cd;
	     var elSel = document.getElementById('prinsub');
	     try {
	      	    elSel.add(optadd,null); // standards compliant; doesn't work in IE
	         }
	     catch(ex) 
	         {
	      	    elSel.add(optadd); // IE only
	         }

	     cd="";
             nm="";     
      	  }
      }
    }
    return 'Y';  
}

