﻿/*------------------------------------------------
 * Created by HaiPQ
 * Date created : 23/07/2007
 */
var xmlHttpMI
var xmlHttpSL
var xmlHttpMS
var xmlHttpHOSEInfoListAll
var xmlHttpHNInfoListAll

function showMIListAll()
{ 
}

function showSecuListAll()
{ 
xmlHttpSL=GetXmlHttpObject();
if (xmlHttpSL==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
stocklist='';
	
url="GetDataListAllNewFrame.aspx";
url=url+"?Type=2";
url=url+"&sid="+Math.random();
url=url+"&stocklist="+stocklist;
xmlHttpSL.onreadystatechange=stateChanged_SecuritiesList;
xmlHttpSL.open("GET",url,true);
xmlHttpSL.send(null);

}
/*
function showMSListAll()
{ 
//xmlHttpMS=GetXmlHttpObject();
//if (xmlHttpMS==null)
//  {
//  alert ("Your browser does not support AJAX!");
//  return;
//  } 
//url="GetDataListAll.aspx";
//url=url+"?Type=3";
//url=url+"&sid="+Math.random();
//url=url+"&stocklist=";
//xmlHttpMS.onreadystatechange=stateChanged_MarketStatus;
//xmlHttpMS.open("GET",url,true);
//xmlHttpMS.send(null);
}
*/
function showHOSEInfoListAll()
{ 
//xmlHttpHOSEInfoListAll=GetXmlHttpObject();
//if (xmlHttpHOSEInfoListAll==null)
//  {
//  alert ("Your browser does not support AJAX!");
//  return;
//  } 
//var url="GetDataListAllNewFrame.aspx";
//url=url+"?Type=4";
//url=url+"&sid="+Math.random();
//url=url+"&stocklist=";
//xmlHttpHOSEInfoListAll.onreadystatechange=stateChanged_HOSEInfo;
//xmlHttpHOSEInfoListAll.open("GET",url,true);
//xmlHttpHOSEInfoListAll.send(null);
}

function showHNInfoListAll()
{ 
//xmlHttpHNInfoListAll=GetXmlHttpObject();
//if (xmlHttpHNInfoListAll==null)
//  {
//  alert ("Your browser does not support AJAX!");
//  return;
//  } 
//var url="GetDataListAllNewFrame.aspx";
//url=url+"?Type=5";
//url=url+"&sid="+Math.random();
//url=url+"&stocklist=";
//xmlHttpHNInfoListAll.onreadystatechange=stateChanged_HNInfo;
//xmlHttpHNInfoListAll.open("GET",url,true);
//xmlHttpHNInfoListAll.send(null);
}

function showMIFixed()
{ 

}

function showSecuFixed()
{ 
xmlHttpSL=GetXmlHttpObject();
if (xmlHttpSL==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataFixed.aspx";
url=url+"?Type=2";
url=url+"&sid="+Math.random();
xmlHttpSL.onreadystatechange=stateChanged_SecuritiesList;
xmlHttpSL.open("GET",url,true);
xmlHttpSL.send(null);
}

function showMSFixed()
{ 
xmlHttpMS=GetXmlHttpObject();
if (xmlHttpMS==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataFixed.aspx";
url=url+"?Type=3";
url=url+"&sid="+Math.random();
xmlHttpMS.onreadystatechange=stateChanged_MarketStatus;
xmlHttpMS.open("GET",url,true);
xmlHttpMS.send(null);
}

function showMIGeneral()
{ 
xmlHttpMI=GetXmlHttpObject();
if (xmlHttpMI==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataGeneral.aspx";
url=url+"?Type=1";
url=url+"&sid="+Math.random();
xmlHttpMI.onreadystatechange=stateChanged_MarketInfo;
xmlHttpMI.open("GET",url,true);
xmlHttpMI.send(null);
}

function showSecuGeneral()
{ 
xmlHttpSL=GetXmlHttpObject();
if (xmlHttpSL==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataGeneral.aspx";
url=url+"?Type=2";
url=url+"&sid="+Math.random();
xmlHttpSL.onreadystatechange=stateChanged_SecuritiesList;
xmlHttpSL.open("GET",url,true);
xmlHttpSL.send(null);
}

function showMSGeneral()
{ 
xmlHttpMS=GetXmlHttpObject();
if (xmlHttpMS==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataGeneral.aspx";
url=url+"?Type=3";
url=url+"&sid="+Math.random();
xmlHttpMS.onreadystatechange=stateChanged_MarketStatus;
xmlHttpMS.open("GET",url,true);
xmlHttpMS.send(null);
}

function showMIPTAD()
{ 
xmlHttpMI=GetXmlHttpObject();
if (xmlHttpMI==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataPTAD.aspx";
url=url+"?Type=1";
url=url+"&sid="+Math.random();
xmlHttpMI.onreadystatechange=stateChanged_MarketInfo;
xmlHttpMI.open("GET",url,true);
xmlHttpMI.send(null);
}

function showSecuPTAD()
{ 
xmlHttpSL=GetXmlHttpObject();
if (xmlHttpSL==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataPTAD.aspx";
url=url+"?Type=2";
url=url+"&sid="+Math.random();
xmlHttpSL.onreadystatechange=stateChanged_SecuritiesList;
xmlHttpSL.open("GET",url,true);
xmlHttpSL.send(null);
}

function showMSPTAD()
{ 
xmlHttpMS=GetXmlHttpObject();
if (xmlHttpMS==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataPTAD.aspx";
url=url+"?Type=3";
url=url+"&sid="+Math.random();
xmlHttpMS.onreadystatechange=stateChanged_MarketStatus;
xmlHttpMS.open("GET",url,true);
xmlHttpMS.send(null);
}

function showMIPTEXE()
{ 
xmlHttpMI=GetXmlHttpObject();
if (xmlHttpMI==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataPTEXE.aspx";
url=url+"?Type=1";
url=url+"&sid="+Math.random();
xmlHttpMI.onreadystatechange=stateChanged_MarketInfo;
xmlHttpMI.open("GET",url,true);
xmlHttpMI.send(null);
}

function showSecuPTEXE()
{ 
xmlHttpSL=GetXmlHttpObject();
if (xmlHttpSL==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataPTEXE.aspx";
url=url+"?Type=2";
url=url+"&sid="+Math.random();
xmlHttpSL.onreadystatechange=stateChanged_SecuritiesList;
xmlHttpSL.open("GET",url,true);
xmlHttpSL.send(null);
}

function showMSPTEXE()
{ 
xmlHttpMS=GetXmlHttpObject();
if (xmlHttpMS==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="GetDataPTEXE.aspx";
url=url+"?Type=3";
url=url+"&sid="+Math.random();
xmlHttpMS.onreadystatechange=stateChanged_MarketStatus;
xmlHttpMS.open("GET",url,true);
xmlHttpMS.send(null);
}

function stateChanged_MarketInfo() 
{ 
if (xmlHttpMI.readyState==4)
{ 
document.getElementById("MarketInfo").innerHTML=xmlHttpMI.responseText;//.getElementById("res").innerHTML;
//alert(xmlHttp.responseText.htmlText);
}
}

function stateChanged_SecuritiesList() 
{ 
if (xmlHttpSL.readyState==4)
{ 
if (xmlHttpSL.status==200)
{ 
document.getElementById("SecuritiesList").innerHTML=xmlHttpSL.responseText;//.getElementById("res").innerHTML;
//alert(xmlHttp.responseText.htmlText);
}
}
}

function stateChanged_MarketStatus() 
{ 
if (xmlHttpMS.readyState==4)
{ 
document.getElementById("MarketStatus").innerHTML=xmlHttpMS.responseText;//.getElementById("res").innerHTML;
//alert(xmlHttp.responseText.htmlText);
}
}
function stateChanged_HOSEInfo() 
{ 
if (xmlHttpHOSEInfoListAll != null && xmlHttpHOSEInfoListAll.readyState==4 && xmlHttpHOSEInfoListAll.status==200)
{ 
document.getElementById("mqHCM").innerHTML=xmlHttpHOSEInfoListAll.responseText;
}
}

function stateChanged_HNInfo() 
{ 
if (xmlHttpHNInfoListAll != null && xmlHttpHNInfoListAll.readyState==4 && xmlHttpHNInfoListAll.status==200)
{ 
document.getElementById("mqHN").innerHTML=xmlHttpHNInfoListAll.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
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");
    }
  }
return xmlHttp;
}

function doKeepcurrentStock(){
	
	var cur=GetCookie('currentstock');	
	doChange(cur);
	//alert(cur);
	
}