
var xmlHttp;

function GetXmlHttpObject()
{
	if (!xmlHttp)
	{
		try
		{
		  // Firefox, Opera 8.0+, Safari
		  xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{
			  // Internet Explorer
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
	}
	else
	{
		xmlHttp.abort();
	}
			
	return xmlHttp;
}
	


function setLoginForm()
{
  if (document.getElementById('strINS').value != '')
  {
    document.getElementById('strINS').removeAttribute('disabled');
    document.getElementById('strINS').style.backgroundColor = '';
    document.getElementById('strATP').setAttribute('disabled','disabled');
    document.getElementById('strATP').style.backgroundColor = '#DEDEDE';
  }
  else if (document.getElementById('strATP').value != '')
  {
    document.getElementById('strATP').removeAttribute('disabled');    
    document.getElementById('strATP').style.backgroundColor = '';
    document.getElementById('strINS').setAttribute('disabled','disabled');
    document.getElementById('strINS').style.backgroundColor = '#DEDEDE';
  }
  else
  {
    document.getElementById('strINS').removeAttribute('disabled');
    document.getElementById('strINS').style.backgroundColor = '';
    document.getElementById('strATP').removeAttribute('disabled');
    document.getElementById('strATP').style.backgroundColor = '';
  }
}

function logDownload(qs)
{
  xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  //If this is the case, suply a standard drop down in place of the text box
	  return;
	}
  var url="/includes/npors_download_alert.asp";
	url+="?" + qs;
	xmlHttp.onreadystatechange=stateChangedLogDownloads;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChangedLogDownloads()
{
  if (xmlHttp.readyState==4)
	{ 
		  var ss = document.getElementById('spnEmailAlertSend')
			ss.innerHTML = '';
			var str = xmlHttp.responseText;
			xmlHttp.abort();
			ss.innerHTML += str;		
	}
}

