﻿// JScript File
function Browser() {
  var ua, s, i;
  this.isIE    = false;
  this.isNS    = false;
  this.version = null;
  ua = navigator.userAgent;
  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.
  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}
var XmlHttp1;
   function CreateXmlHttp()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttp1 = new ActiveXObject("Msxml2.XmlHttp");
		}
		catch(e)
		{
			try
			{
				XmlHttp1 = new ActiveXObject("Microsoft.XmlHttp");
			} 
			catch(oc)
			{
				XmlHttp1 = null;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttp1 && typeof XMLHttpRequest!='undefined') 
		{
	          try 
	          {
		        XmlHttp1 = new XMLHttpRequest();
	          } 
	         catch (e) 
	          {
		        XmlHttp1=false;
	          }
        }
        if (!XmlHttp1 && window.createRequest) 
        {
	        try 
	        {
		        XmlHttp1 = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttp1=false;
	        }
        }
	}
	
function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 

function CreateXmlHttpSymb()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttpSymb = new ActiveXObject("Msxml2.XmlHttp");
		}
		catch(e)
		{
			try
			{
				XmlHttpSymb = new ActiveXObject("Microsoft.XmlHttp");
			} 
			catch(oc)
			{
				XmlHttpSymb = null;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if(!XmlHttpSymb && typeof XmlHttpRequest != "undefined") 
		{
			XmlHttpSymb = new XmlHttpRequest();
		}
	}


	
	
function CreateXmlHttpVV()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttpVV = new ActiveXObject("Msxml2.XmlHttp");
		}
		catch(e)
		{
			try
			{
				XmlHttpVV = new ActiveXObject("Microsoft.XmlHttp");
			} 
			catch(oc)
			{
				XmlHttpVV = null;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if(!XmlHttpVV && typeof XmlHttpRequest != "undefined") 
		{
			XmlHttpVV = new XmlHttpRequest();
		}
	}


function CreateXmlHttp1()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttp1 = new ActiveXObject("Msxml2.XmlHttp");
		}
		catch(e)
		{
			try
			{
				XmlHttp1 = new ActiveXObject("Microsoft.XmlHttp");
			} 
			catch(oc)
			{
				XmlHttp1 = null;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if(!XmlHttp1 && typeof XmlHttpRequest != "undefined") 
		{
			XmlHttp1 = new XmlHttpRequest();
		}
	}	
	
function Changearchive()
  {
   var date = document.getElementById("ctl00_ContentPlaceHolder1_DateselectionDrp").value; 
    CreateXmlHttp(); 
   
	var requestUrl="TechArchives.aspx?Date="+date;  
	if(XmlHttp1)	
			{
					
					XmlHttp1.onreadystatechange = function(){ShowTData();}; 
					XmlHttp1.open("GET", requestUrl,  true);
					XmlHttp1.send(null);
			}
  }
  function ShowTData()
  {
      if(XmlHttp1.readyState == 4)
	    {	
		    if(XmlHttp1.status == 200)
		    {			
			    var ShowGLData= document.getElementById("ctl00_ContentPlaceHolder1_InnerTable"); 
		    var strData = XmlHttp1.responseText;	  
			    if(strData != "")
			    {
				    ShowGLData.innerHTML =strData;
			    }
			    document.body.style.cursor = "auto";	
		    }
		    else
		    {
			    ShowGLData.innerHTML = "There was a problem retrieving data from the server.";
    			
			    document.body.style.cursor = "auto";
		    }
	    }
  }

 function ShowtableData()
{
    var date = document.getElementById("ctl00_ContentPlaceHolder1_DateselectionDrp").value; 
    CreateXmlHttp(); 

	var requestUrl="SaysTableData.aspx?Date="+date;  
	if(XmlHttp1)	
			{
					
					XmlHttp1.onreadystatechange = function(){ShowData();}; 
					XmlHttp1.open("GET", requestUrl,  true);
					XmlHttp1.send(null);
			}
	
}

function ShowData() 
{ 

if(XmlHttp1.readyState == 4)
	{	
		if(XmlHttp1.status == 200)
		{			
			var ShowGLData   = document.getElementById("ctl00_ContentPlaceHolder1_SaysDataPart");
		var strData = XmlHttp1.responseText;	 
			if(strData != "")
			{
				ShowGLData.innerHTML   =  strData;
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			ShowGLData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
} 
