/**
* @author TaiNguyen
*/
var ajaxSec;
var ajaxMar;
var ajaxDetails;
var ajaxput;
var rain;
var mar = new Market([]);
var secArr = [], secArr1 = [], secArr2 = [];
var comm = { scroll: 'false', speed: 80, timeup: 3000, stLoad: '0', stcID: '001', sRain: 3000, tMar: 5001, tSec: 2001, fixed: '', lag: 'vi', stas: '0' };
function callLoadMarket(stcID) {
    if (stcID != '030')
        comm.stcID = stcID;
    if (stcID == '001')
        ajaxMar = new Ajax.Request('MarketHo.ashx?stcId=' + stcID + '&type=' + Math.random(), { method: 'get', onComplete: LoadMarket, onerror: [] });
    else if (stcID == '002')
        ajaxMar = new Ajax.Request('MarketHa.ashx?stcId=' + stcID + '&type=' + Math.random(), { method: 'get', onComplete: LoadMarket, onerror: [] });
    else
        ajaxMar = new Ajax.Request('MarketVN30.ashx?stcId=030&type=' + Math.random(), { method: 'get', onComplete: LoadVN30Market, onerror: [] });
};

function LoadVN30Market(ajaxMar) {    
    mar.LoadVN30Market(eval("(" + ajaxMar.responseText + ")"));
};
function LoadMarket(ajaxMar) {
    mar.LoadMarket(eval("(" + ajaxMar.responseText + ")"));
};
function callLoadSecurity(stcID) {
    comm.stcID = stcID;
    if (stcID == '001')
        ajaxSec = new Ajax.Request('SecurityHo.ashx?stcId=' + stcID + '&pro=' + Math.random() + '&status=0&type=' + Math.random(), { method: 'get', onComplete: LoadSecurities, onerror: [] });
    else
        ajaxSec = new Ajax.Request('SecurityHa.ashx?stcId=' + stcID + '&pro=' + Math.random() + '&status=0&type=' + Math.random(), { method: 'get', onComplete: LoadSecurities, onerror: [] });
};
function LoadSecurities(ajaxSec) {
    sec.LoadSecurity(eval("(" + ajaxSec.responseText + ")"));
};
function CallDetails(sfile) {
    ajaxDetails = new Ajax.Request(sfile, { method: 'get', onComplete: LoadDetails, onerror: [] });
};
var details;
function LoadDetails(ajaxDetails) {
    details = eval("(" + ajaxDetails.responseText + ")");
};
function callLoadPutThrough() {
    ajaxput = new Ajax.Request('PutThrough.ashx?type=' + Math.random(), { method: 'get', onComplete: PutShow, onerror: [] });
};


