
		
		
 function authenticate()
 {
    var newwindow=window.open('Login.jsp','newwindow', 'width=1017,height=690,left=0,top=0,resizable=yes,titlebar=no,menubar=no,toolbar=no,status=yes,scrollbars=1');
	newwindow.focus();
 }


 
 function EnterkeyPressed(e)
  {
    var whichCode = (window.Event) ? e.which : e.keyCode;
    if (e.keyCode==13)
    {
      authenticate();
      return false;		
    }
   }
function replin(e,id,repLogin){
 var whichCode = (window.Event) ? e.which : e.keyCode;
    if (e.keyCode==13)
    {
      authRep(id,repLogin);
    }
}
function authRep(id,repLogin){
	var pwd=document.getElementById(id).value;
	if(document.getElementById(id).value==""){
	 alert("Please Enter Valid Password");
	 return false;
 }

 var url="http://reports.aarogyasri.org/ASRI/FrontServlet";
 document.forms[repLogin].action=url;
 document.forms[repLogin].submit();
}

function openTreeView()
{
    window.open('/ASRI/Tree_View/index.jsp','window1','width=900, height=600, top=60,left=70,resizable=yes,titlebar=yes,scrollbars=yes,menubar=yes,toolbar=yes');
}

function populateDropDown1()
{
	var browser = 'ie';
	var value1Index = 0;
	var value2Index = 1;
  var value3Index = 2; var value4Index = 3; var value5Index = 4; var value6Index = 5;
  
	if (document.implementation && document.implementation.createDocument)
	{
	  browser = 'firefox';
	  var nameIndex = 1;
	  var valueIndex = 3;
	}
             var value1,value2;
            var x = xmlDoc.getElementsByTagName('item');
          for(newsCnt=1;newsCnt<x.length;newsCnt++)
          {
                    for (j=0;j<x[newsCnt].childNodes.length;j++)
                    {
                                        var theData = document.createTextNode(x[newsCnt].childNodes[j].firstChild.nodeValue);
                                        if (j==0) value1 = theData.nodeValue;
                                        if (j==1) value2 = theData.nodeValue;		
                    }
                    if(value1 != '')
                    {
                                var dd3 = document.getElementById(value1); 
                                        var htmlText="";
                                        htmlText+=value2;
                                        dd3.innerHTML=htmlText;
                    }
          }
 
    getData2();
 
 
}

function getData1() 
{
  
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = populateDropDown;
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () 
		{  if (xmlDoc.readyState == 4) 
			populateDropDown1()
		};
 	}
	else
	{
		
		return;
	}
  	var url =  '/ASRI/FillData?actionVal=HomePageStatistics';
    xmlDoc.load(url);
}

function Eligibility()
{
	window.open('/ASRI/empanelment/Eligibility.jsp','window1','width=900, height=600, top=60,left=70,resizable=yes,titlebar=yes,status=yes,scrollbars=yes,menubar=no,toolbar=no');
}
function populateDropDown2()
{
	var browser = 'ie';
	var value1Index = 0;
	var value2Index = 1;
  var value3Index = 2; var value4Index = 3; var value5Index = 4; var value6Index = 5;
  
	if (document.implementation && document.implementation.createDocument)
	{
		 browser = 'firefox';
	  var nameIndex = 1;
	  var valueIndex = 3;
	}
    var dd3;
    
    dd3= document.getElementById('NewsId'); 
  var x = xmlDoc.getElementsByTagName('newsitem');
  htmlText="";
  for(newsCnt=0;newsCnt<x.length;newsCnt++)
  {
    for (j=0;j<x[newsCnt].childNodes.length;j++)
    {
      var theData = document.createTextNode(x[newsCnt].childNodes[0].firstChild.nodeValue);
      htmlText+="<br>";
	  htmlText+="<li>";
		
	  htmlText+=theData.nodeValue; 

	  htmlText+="</li>";
    }
  }
  dd3.innerHTML=htmlText;

  dd3= document.getElementById('MessageId'); 
  x = xmlDoc.getElementsByTagName('messageitem');
  htmlText="";
  for(newsCnt=0;newsCnt<x.length;newsCnt++)
  {
    for (j=0;j<x[newsCnt].childNodes.length;j++)
    {
      var theData = document.createTextNode(x[newsCnt].childNodes[0].firstChild.nodeValue);
      htmlText+=theData.nodeValue; 
      htmlText+="::"; 
    }
  }
  dd3.innerHTML=htmlText;
 
}

function getData2() 
{
  	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = populateDropDown;
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () 
		{  if (xmlDoc.readyState == 4) 
			populateDropDown2()
		};
 	}
	else
	{
		alert('Your browser can\'t handle this script');
		return;
	}
  	var url =  '/ASRI/FillData?actionVal=ViewNews';
    xmlDoc.load(url);
}



function openAttachment()
{
    window.open('/ASRI/EXT_IMAGES/documents/NotificationForDoctors.doc','window1','width=900, height=600, top=60,left=70,resizable=yes,titlebar=yes,scrollbars=yes,menubar=yes,toolbar=yes');
}

function openAttachment1()
{
    document.forms[0].action="/ASRI/FrontServlet?requestType=HospEmpanelRH&actionVal=HospInfoPage&pageName=HospitalInfo&fromPage=HomePage";
   document.forms[0].submit();
}

function openAttachment2()
{
    window.open('/ASRI/EXT_IMAGES/documents/Claims_screenshotsmodified.doc','window1','width=900, height=600, top=60,left=70,resizable=yes,titlebar=yes,scrollbars=yes,menubar=yes,toolbar=yes');
}
