﻿var tc=0;
cd=5;

var today =  new Date();
var month = Number(today.getMonth())+1;

var strToDay = today.getDate() + '/' + month + '/' + today.getFullYear() + " ";

function si()
{
	var v = (new Date());
	var h, m, s;
	/*
					  var today =  new Date();
					  var month = Number(today.getMonth())+1;
*/
	h = v.getHours();
	m = v.getMinutes();
	s = v.getSeconds();

	document.getElementById('Clock').innerHTML = "".concat((h < 10) ? '0'.concat(h) : h).concat(':').concat((m < 10) ? '0'.concat(m) : m).concat(':').concat((s < 10) ? '0'.concat(s) : s);
	
	cd--;
	//window.status=cd;
	//if (cd<=0)	ua();
}

function uq()
{
	if (tc>0) return false;
	if (g_cl==''||!g_cl) g_cl=GetCookie('HCMSelectList');
	var cl=g_cl;	cl=(cl==','?'':cl);
		
	tc++;
	showSecuListAll();
	//sf(document.frmSelect);	
	//shl('FPTSQuote');tc--;
}

function sf(f) {
  var status = AjaxRequest.submit(
    f
    ,{
      'onSuccess':function(req){ document.getElementById('tdra').innerHTML=req.responseText; shl('FPTSQuote');tc--;}
    }
  );
  
  return status;
}

function uu()
{/*
	AjaxRequest.get(
		{
		'url':'_sevn.asp?id=x'.concat((new Date()).getTime())
		,'onSuccess':function(req){document.getElementById('tdsu').innerHTML=req.responseText;}
		,'onError':function(req){document.getElementById("tdsu").innerHTML = req.statusText;}
		}
	)*/
}

function us()
{
	//document.getElementById('mqHCM').innerHTML = document.getElementById('dstHCM').innerHTML; 
	//document.getElementById('mqHN').innerHTML  = document.getElementById('dstHN').innerHTML; 
}

function ui()
{
	//tt('imi', '&#272;&#7875; hi&#7875;n th&#7883; b&#7843;ng gi&#225; c&#7911;a c&#225;c m&#227; ch&#7913;ng kho&#225;n b&#7841;n b&#7845;m "Xem t&#7845;t" r&#7891;i b&#7845;m "Ch&#7885;n t&#7845;t", ho&#7863;c ch&#7885;n t&#7915;ng m&#227;, sau &#273;&#243; b&#7845;m n&#250;t "Xem". C&#225;c b&#7841;n c&#361;ng c&#243; th&#7875; ch&#7885;n m&#227; ch&#7913;ng kho&#225;n theo ch&#7919; c&#225;i &#273;&#7847;u b&#7857;ng c&#225;ch b&#7845;m v&#224;o m&#7897;t trong c&#225;c ch&#7919; c&#225;i &#7903; tr&#234;n.');	
}

function ua()
{
	status='Updating...';
	uu();
	uq();
	status='Done';
	cd=it;
}

function doView()
{
	md=1;
	SaveSelectList('HCMSelectList');	
	HideAllCheck();																			
	uq();
}

function doAddCode(){
	LoadSelectList('HCMSelectList');
	var i;
	for(i=65; i<=90; i++)
	{
		document.getElementById("char" + i).className = "cx1";
	}
	document.getElementById("viewAll").className = "cd1";

	var j;
	for(j=1; j<=total; j++)
	{
		var chkid = "c_" + j;
		var spnid = "s_" + j;
		document.getElementById(chkid).style.display = '';								
		document.getElementById(spnid).style.display = '';
	}
	document.getElementById("checkAll").style.display = '';
}

LoadSelectList('HCMSelectList');

uq();
uu();
us();
ui();
 
si();

setInterval('si()', 1000);
setTimeout(function(){ftd('divHeader');shw();}, 5000);

