function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {

	if (document.images) {
	
		announcement_over = newImage("images/announcement-over.gif");
		result_over = newImage("images/result-over.gif");
		sharholding_over = newImage("images/sharholding-over.gif");
		sast_over = newImage("images/sast-over.gif");
		insider_over = newImage("images/insider-over.gif");
		
		preloadFlag = true;
																
	}
	ajaxFunctionShareLoad();	
	ajaxFunctionLatestFilings();
}
function ld()
{
var iframesrc="../AnnouncementFeed/feed.asp"
document.write('<iframe id="datamain" src="'+iframesrc+'" width="200px" height="120px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="no" scrolling="no"></iframe>')
}
function ajaxFunctionA()
  {  
  
  document.getElementById("Ann").src="../images/over_ann.gif";
  document.getElementById("SAST123").src="../images/tab_sast.gif";
  document.getElementById("Share").src="../images/tab_share.gif";
  document.getElementById("Res").src="../images/tab_res.gif";
  var xmlHttp;
  try
    {    
   xmlHttp=new XMLHttpRequest();    }
  catch (e)
    {        try
      {      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      }
    catch (e)
      {      try
        {        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        }
      catch (e)
        {        alert("Your browser does not support AJAX!");        return false;        }      }    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById("tab").innerHTML =xmlHttp.responseText;
        //document.myForm.tab.innetHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","../WebForm1.aspx?id=ann",true);
    xmlHttp.send(null);  }
    
    function ajaxFunctionSAST()
  {  
  document.getElementById("Ann").src="../images/tab_ann.gif";
  document.getElementById("SAST123").src="../images/over_sast.gif";
  document.getElementById("Share").src="../images/tab_share.gif";
  document.getElementById("Res").src="../images/tab_res.gif";
  
  var xmlHttp;
  try
    {    
   xmlHttp=new XMLHttpRequest();    }
  catch (e)
    {        try
      {      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      }
    catch (e)
      {      try
        {        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        }
      catch (e)
        {        alert("Your browser does not support AJAX!");        return false;        }      }    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById("tab").innerHTML =xmlHttp.responseText;
        //document.myForm.tab.innetHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","../WebForm1.aspx?id=sast",true);
    xmlHttp.send(null);  }
    
     function ajaxFunctionShare()
  {  
   document.getElementById("Ann").src="../images/tab_ann.gif";
  document.getElementById("SAST123").src="../images/tab_sast.gif";
  document.getElementById("Share").src="../images/over_share.gif";
  document.getElementById("Res").src="../images/tab_res.gif";
  
  var xmlHttp;
  try
    {    
   xmlHttp=new XMLHttpRequest();    }
  catch (e)
    {        try
      {      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      }
    catch (e)
      {      try
        {        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        }
      catch (e)
        {        alert("Your browser does not support AJAX!");        return false;        }      }    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById("tab").innerHTML =xmlHttp.responseText;
        //document.myForm.tab.innetHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","../WebForm1.aspx?id=share",true);
    xmlHttp.send(null);  }
    
    function ajaxFunctionRes()
  {  
   document.getElementById("Ann").src="../images/tab_ann.gif";
  document.getElementById("SAST123").src="../images/tab_sast.gif";
  document.getElementById("Share").src="../images/tab_share.gif";
  document.getElementById("Res").src="../images/over_res.gif";
  var xmlHttp;
  try
    {    
   xmlHttp=new XMLHttpRequest();    }
  catch (e)
    {        try
      {      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      }
    catch (e)
      {      try
        {        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        }
      catch (e)
        {        alert("Your browser does not support AJAX!");        return false;        }      }    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById("tab").innerHTML =xmlHttp.responseText;
        //document.myForm.tab.innetHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET","../WebForm1.aspx?id=res",true);
    xmlHttp.send(null);  }
    
     function ajaxFunctionShareLoad()
  {  
   document.getElementById("Ann").src="../images/tab_ann.gif";
  document.getElementById("SAST123").src="../images/tab_sast.gif";
  document.getElementById("Share").src="../images/over_share.gif";
  document.getElementById("Res").src="../images/tab_res.gif";
  
  var xmlHttp;
  try
    {    
   xmlHttp=new XMLHttpRequest();    }
  catch (e)
    {        try
      {      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      }
    catch (e)
      {      try
        {        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        }
      catch (e)
        {        alert("Your browser does not support AJAX!");        return false;        }      }    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById("tab").innerHTML =xmlHttp.responseText;
        //document.myForm.tab.innetHTML=xmlHttp.responseText;

	document.getElementById("tab_loader").parentNode.removeChild(document.getElementById("tab_loader"));
        }
      }
    xmlHttp.open("GET","../WebForm1.aspx?id=share",true);
    xmlHttp.send(null);
  }
    
function ajaxFunctionLatestFilings()
{
	var xmlHttp;
	try
	{    
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
		        return false;
	        }
	    }
	}
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			if(xmlHttp.responseText.indexOf("Server Error") == -1)
			{
				document.getElementById("LatestFilings").innerHTML =xmlHttp.responseText;
				//document.myForm.tab.innetHTML=xmlHttp.responseText;				
			}
			else
			{
				document.getElementById("LatestFilings").innerHTML = "<br><table width='99%'><tr><td bgcolor='#CCCCCC' align='center' height='50'><font size='2' color='red'>Failed to load the Latest Filings<br>Click <a href='#' onClick='javascript:ReloadLatestFilings()'><b>re-load</b></a> to try again</font></td></tr></table>";
			}
            //document.getElementById("latest_loader").parentNode.removeChild(document.getElementById("latest_loader"));
            document.getElementById("latest_loader").style.visibility = "hidden";
		    document.getElementById("latest_loader").style.height = "0px";
		    document.getElementById("latest_loader").style.width = "0px";
		}
	}
	xmlHttp.open("GET","../LatestFilings.aspx",true);
	xmlHttp.send(null);
}

function ReloadLatestFilings()
{
	document.getElementById("latest_loader").style.visibility = "visible";
	document.getElementById("latest_loader").style.height = "30px";
	document.getElementById("latest_loader").style.width = "30px";
	document.getElementById("LatestFilings").innerHTML = "";
	ajaxFunctionLatestFilings();
}