﻿//Su dung cho ho tro truc tuyen, kich vao trai ra cua sofunction getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
if((typeof opt_position!="undefined" && opt_position.indexOf("top")!=-1))
	ypos=getposOffset(curobj, "top")-subobj.offsetHeight-3;

subobj.style.left="0px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}
//Su dung cho ho tro truc tuyen, kich vao trai ra cua so
var req;
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function NumberFormat_999(number)
{
    if (number!=null)
    {
        var NumberToString = number + '';
        var lengthNumber = NumberToString.length;
        var LenPart = Math.ceil(parseInt( lengthNumber)/3)-1;
        var DivPart;
        var iPart = 0;
        var Rs="";
        DivPart = lengthNumber%3;
        
        if (DivPart>0)
        {
            Rs = NumberToString.substring(0,DivPart);
            
        }else
        {
            LenPart=LenPart+1;
        }
        while (iPart<LenPart)
        {
            if (Rs=="")
            {
                Rs = NumberToString.substring(3*iPart+DivPart,3*(iPart +1)+DivPart);
                
            }
            else
            {
                Rs = Rs + ',' + NumberToString.substring(3*iPart+DivPart,3*(iPart +1)+DivPart);
                
            }
            iPart = iPart+1;
        }
        return Rs;
    }
    return "";

}

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}



function isDate18(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	
	//var strMonth=dtStr.substring(0,pos1)
	//var strDay=dtStr.substring(pos1+1,pos2)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strDay=dtStr.substring(0,pos1)	
	
	var strYear=dtStr.substring(pos2+1)

	var currentTime = new Date()
	//var month = currentTime.getMonth() + 1
	//var day = currentTime.getDate()
	var nam = currentTime.getFullYear()
	
	if ((nam - strYear) < 7)
	{
		//alert("Chua du 18 tuoi")
		return false		
	}
	return true
}
function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	
	//var strMonth=dtStr.substring(0,pos1)
	//var strDay=dtStr.substring(pos1+1,pos2)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strDay=dtStr.substring(0,pos1)	
	
	var strYear=dtStr.substring(pos2+1)
	
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : dd/mm/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}


function Initialize()
{
	try
	{
		req=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			req=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			req=null;
		}
	}

	if(!req&&typeof XMLHttpRequest!="undefined")
	{
		req=new XMLHttpRequest();
	}
	
}


function SetCookie(v, name_c) {
CurrentCookie = v;
document.cookie = name_c + '=' + v;
}

function GetCookie(name_c) {
var c_content = '';
if(document.cookie.length > 0) {
   var c_name = name_c + '=';
   var c_begin = document.cookie.indexOf(c_name);
   var c_end = 0;
   if(c_begin > -1) {
      c_begin += c_name.length;
      c_end = document.cookie.indexOf(";",c_begin);
      if(c_end < c_begin) { c_end = document.cookie.length; }
      c_content = document.cookie.substring(c_begin,c_end);
      }
   }
   //alert(c_content);
return c_content;
}


function RoundNumber(number,percision)
{
    if (number !=null || number !="" || number!='')
    {
        var theNumberString = parseFloat(Math.round(parseFloat(number)*10))/10 + ''; // force a string
        
        
        var PointPixel =theNumberString.lastIndexOf('.');
        if (PointPixel>=0)
        {
            //alert(theNumberString + ' ' + PointPixel);
            
            return theNumberString.substring(0,PointPixel + percision +1);
        }
        else
        {
            
            return theNumberString;
        }
     }
     else
     {
        return 0;
     }

}

function displayItems(par1) {
	
	var params = par1;	
	// check to see which checkboxes are checked and append them to the string.
	//if (document.getElementById('checkBox1').checked == true) {
	//params += "cuong"
	//}
	// more here
	retrieveURL("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;
}

function change_location(boxmenu) {
	var params = boxmenu[boxmenu.selectedIndex].value;
	retrieveURL("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
		
}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ' ' + '$2');
	}
	return x1 + x2;
}

function change_pro1() {
	change_pro();
}

function sleep(delay)
{
	 /**
	 * Delay for a number of milliseconds
	 */     
	 //var start = new Date().getTime();
     //while (new Date().getTime() < start + delay);
	//netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
	var thread = Components.classes["@mozilla.org/thread-manager;1"].getService(Components.interfaces.nsIThreadManager).currentThread;
	this.delayed = true;
	setTimeout("this.delayed = false;", delay);
	while (this.delayed) {
		thread.processNextEvent(true);
	}
	
}

function cmdsend(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
//req.onreadystatechange = processStateChangeXDMT;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
//req.onreadystatechange = processStateChangeXDMT;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}


function choose_pro(boxmenu) {
	var params = boxmenu[boxmenu.selectedIndex].value;
	if (params == '0')
	{
		return false;
	}
	//alert(params);
	retrieveURLAdd2cartXDMT("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
		
}

function retrieveURLAdd2cartXDMT(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = processStateChangeXDMT;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processStateChangeXDMT;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}


function processStateChangeXDMT() {
if (req.readyState == 4) 
{ // Complete
	if (req.status == 200) 
	{ // OK response

			var t1 = req.responseText;
			var tim;
			var kq;
			tim=/@@/i;
			kq = t1.search(tim);
			
			checkok = new Array();

			
			if (kq === -1)
			{				
				document.getElementById("thetableAdd2cart").innerHTML = req.responseText;
			}
			else
			{
				checkok = t1.split("@@");
				if (checkok[0].length >= 1)
				{
					document.getElementById("thetableAdd2cart").innerHTML =checkok[0];
				}
								
				if (checkok[1]!='-' && checkok[1]!='')
				{
					//document.getElementById("piccenter").innerHTML ="<img border=0 src='images/imgupload/"+checkok[1]+"' width=298 height=269>";					
					document.getElementById("thelist").innerHTML =checkok[1];					
				}
			}
			
					
			
	}
	bb_save_state();	
}
else
{

	var load1= "<table border=0 width=100% cellSpacing=0 cellPadding=0  bordercolor=#C0C0C0 style='border-collapse: collapse' align=center>";
	load1 = load1 + "<tr><td><table border=0 width=100% cellSpacing=0 cellPadding=0><tr><td width=100% class=blockTitle style='PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px' noWrap width=99% height=15>";
	load1 = load1 + "</td></tr><TR><TD class=bgc3 height=2></TD></TR><tr><td width=100% height=50><div align=center><img src=images/loading.gif></div>";
	load1 = load1 + "</td></tr></table></td></tr></table>";				            	
	document.getElementById("thetableAdd2cart").innerHTML = load1;			

}
}




function retrieveURL1(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = processStateChange;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processStateChange;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(pars);
//req.send();
}
}
}
function checkGrid(Dangky) {
	var params = "at=grid";	if (document.getElementById("vt1").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("vt1").focus();  
		return false;
	}	if (document.getElementById("vt2").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("vt2").focus();  
		return false;
	}	if (document.getElementById("vt3").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("vt3").focus();  
		return false;
	}		document.Dangky.submit();	}
function doipass(Doitt) {		if (document.getElementById("mkcu").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("mkcu").focus();  
		return false;
	}	if (document.getElementById("mkmoi").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("mkmoi").focus();  
		return false;
	}		if (document.getElementById("mkmoi").value != document.getElementById("xacnhan").value)
	{    
		alert('Xac nhan mat khau khong dung !');
		document.getElementById("xacnhan").focus();  
		return false;
	}		if (document.getElementById("mkcu").value.search("'") >= 0)
	{			document.getElementById("mkcu").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}	if (document.getElementById("mkmoi").value.search("'") >= 0)
	{			document.getElementById("mkmoi").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}	if (document.getElementById("xacnhan").value.search("'") >= 0)
	{			document.getElementById("xacnhan").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}		document.Doitt.submit();	}function doipass1(Doitt) {		if (document.getElementById("ten").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("ten").focus();  
		return false;
	}	if (document.getElementById("mkmoi").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("mkmoi").focus();  
		return false;
	}		if (document.getElementById("mkmoi").value != document.getElementById("xacnhan").value)
	{    
		alert('Xac nhan mat khau khong dung !');
		document.getElementById("xacnhan").focus();  
		return false;
	}		if (document.getElementById("ten").value.search("'") >= 0)
	{			document.getElementById("ten").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}	if (document.getElementById("mkmoi").value.search("'") >= 0)
	{			document.getElementById("mkmoi").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}	if (document.getElementById("xacnhan").value.search("'") >= 0)
	{			document.getElementById("xacnhan").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}			if (document.getElementById("mabaove").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("mabaove").focus();  
		return false;
	}		if (document.getElementById("mabaove").value.search("'") >= 0)
	{			document.getElementById("mabaove").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}		document.Doitt.submit();	}function checkDoithongtin(Doitt) {
	var params = "at=doitt";			if (document.getElementById("mabaomat").value == '')
	{			document.getElementById("mabaomat").focus();		alert('Chưa nhập mã bảo mật !');				return false;		
	}		if (document.getElementById("dienthoai").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("dienthoai").focus();		return false;		
	}	if (document.getElementById("email1").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("email1").focus();		return false;		
	}			if (document.getElementById("sotaikhoan").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("sotaikhoan").focus();		return false;		
	}		if (document.getElementById("mabaomat").value.search("'") >= 0)
	{			document.getElementById("mabaomat").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}			if (document.getElementById("sotaikhoan").value != '')
	{    
		if (document.getElementById("nganhang").value == 0)
		{			alert('Chưa chọn ngân hàng!');
			document.getElementById("nganhang").focus();  
			return false;					}			if (document.getElementById("chinhanh").value == 0)
		{			alert('Chưa chọn chi nhánh!');
			document.getElementById("chinhanh").focus();  
			return false;					}
	}		document.Doitt.submit();	
}function checkdangky(Dangky) {
	var params = "at=dk";					if (document.getElementById("taikhoan").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("taikhoan").focus();  
		return false;
	}	if (document.getElementById("matkhau").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("matkhau").focus();  
		return false;
	}	if (document.getElementById("matkhau").value.length < 6 )
	{    
		alert('Mat khau phai it nhat 6 ky tu !');
		document.getElementById("matkhau").focus();  
		return false;
	}		if (document.getElementById("matkhau").value != document.getElementById("xacnhanlai").value)
	{    
		alert('Xac nhan mat khau khong dung !');
		document.getElementById("xacnhanlai").focus();  
		return false;
	}				var tim;		var tim=String.fromCharCode(39);	
	if (document.getElementById("taikhoan").value.search(tim) >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("taikhoan").focus();		return false;		
	}		if (document.getElementById("matkhau").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("matkhau").focus();		return false;		
	}		////////	if (document.getElementById("hoten").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("hoten").focus();		return false;		
	}	if (document.getElementById("fromDateId").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("fromDateId").focus();		return false;		
	}	if (document.getElementById("cmtnd").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("cmtnd").focus();		return false;		
	}	if (document.getElementById("toDateId").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("toDateId").focus();		return false;		
	}	if (document.getElementById("noicap").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("noicap").focus();		return false;		
	}		if (document.getElementById("dienthoai").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("dienthoai").focus();		return false;		
	}	if (document.getElementById("diachi").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("diachi").focus();		return false;		
	}	if (document.getElementById("email1").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("email1").focus();		return false;		
	}			if (document.getElementById("sotaikhoan").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("sotaikhoan").focus();		return false;		
	}		if (document.getElementById("mabaomat").value.search("'") >= 0)
	{			document.getElementById("mabaomat").focus();		alert('Dữ liệu không được có dấu phẩy trên !');				return false;		
	}			if (document.getElementById("sotaikhoan").value != '')
	{    
		if (document.getElementById("nganhang").value == 0)
		{			alert('Chưa chọn ngân hàng!');
			document.getElementById("nganhang").focus();  
			return false;					}			if (document.getElementById("chinhanh").value == '')
		{			alert('Chưa chọn chi nhánh!');
			document.getElementById("chinhanh").focus();  
			return false;					}
	}	if (document.getElementById("nganhang").value != 0)
	{		if (document.getElementById("chinhanh").value == '')
		{			alert('Chưa nhập chi nhánh!');
			document.getElementById("chinhanh").focus();  
			return false;					}			if (document.getElementById("sotaikhoan").value == '')
		{			alert('Chưa nhập số tài khoản!');
			document.getElementById("sotaikhoan").focus();  
			return false;				}		}			if (document.getElementById("fromDateId").value != '')	{		if (isDate(document.getElementById("fromDateId").value))
		{		}		else		{				alert('Dữ liệu dạng ngày không đúng !');
			document.getElementById("fromDateId").focus();			return false;		
		}	}		if (document.getElementById("toDateId").value != '')	{		if (isDate(document.getElementById("toDateId").value))
		{		}		else		{				alert('Dữ liệu dạng ngày không đúng !');
			document.getElementById("toDateId").focus();			return false;		
		}	}		document.Dangky.submit();	
}
function checkdongy(){	var n1, n0;	n1 = '	<p style="margin: 2px 5px" align=center>';	
	n1 = n1 + '			<table border="0" cellpadding="0" cellspacing="0" width="85" height=25><tr>';
	n1 = n1 + '					<td width="85"  height=25  id=idbtn class=Btn onmouseover="mouseOverBtn()" onmouseout="mouseOverOutBtn()" onclick="return checkdangky(Dangky)">';
	n1 = n1 + '					<div align=center style="display: block; height: 25px; width: 85px" >Đăng ký</div>';
	n1 = n1 + '</td></tr></table></p>';	n0 = '	<p style="margin: 2px 5px" align=center>';	
	n0 = n0 + '			<table border="0" cellpadding="0" cellspacing="0" width="85" height=25><tr>';
	n0 = n0 + '					<td width="85"  height=25  id=idbtn class=BtnDis>';
	n0 = n0 + '					<div align=center style="display: block; height: 25px; width: 85px" >Đăng ký</div>';
	n0 = n0 + '</td></tr></table></p>';		if (document.getElementById("chkclk").value == '0')	{		document.getElementById("chkclk").value = '1';		document.getElementById("dktk").innerHTML = n1;	}	else	{		document.getElementById("chkclk").value = '0';		document.getElementById("dktk").innerHTML = n0;	}}function qschuyentienvtc(){
var answer = confirm ("Bạn có chắc chắn thực hiện nạp tiền từ Vcoin ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	chuyentienvtc();
else
	alert ("Việc thực hiện nạp tiền bị hủy bỏ")
}function qschuyentien(){
var answer = confirm ("Bạn có chắc chắn thực hiện thông báo này ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	chuyentien();
else
	alert ("Thông báo không được thực hiện")
}function chuyentienvtc() {	var params;	params = "at=tbchuyentienvtc";			if (document.getElementById("sotienvtc").value == 0)	{		alert('Chưa chọn số tiền để nạp !');
		document.getElementById("sotienvtc").focus();  
		return false;		}	if (document.getElementById("vcoin1").value == '0')
	{    
		alert('Chưa chọn số tiền để nạp !');
		document.getElementById("vcoin1").focus();  
		return false;
	}		if (isNaN(document.getElementById("sotienvtc").value))
	{		alert('Tiền nạp phải là dạng số !');
		document.getElementById("sotienvtc").focus();  
		return false;			}	if (isNaN(document.getElementById("vcoin1").value))
	{		alert('Tiền nạp phải là dạng số !');
		document.getElementById("vcoin1").focus();  
		return false;			}				params = params + "&sotienvtc=" + document.getElementById("sotienvtc").value;	params = params + "&vcoin1=" + document.getElementById("vcoin1").value;			params = params + "&ghichu=" + document.getElementById("ghichu").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	}function qschuyentiennganluong(){
var answer = confirm ("Bạn có chắc chắn thực hiện nạp tiền từ NGÂN LƯỢNG ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	chuyentiennganluong();
else
	alert ("Việc thực hiện nạp tiền bị hủy bỏ")
}function qschuyentienmobivi(){
var answer = confirm ("Bạn có chắc chắn thực hiện nạp tiền từ MOBIVI ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	chuyentienmobivi();
else
	alert ("Việc thực hiện nạp tiền bị hủy bỏ")
}function qschuyentienbaokim(){
var answer = confirm ("Bạn có chắc chắn thực hiện nạp tiền từ Bảo Kim ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	chuyentienbaokim();
else
	alert ("Việc thực hiện nạp tiền bị hủy bỏ")
}function chuyentienbaokim() {	var params;	params = "at=tbchuyentienbaokim";			if (document.getElementById("sotien").value == 0)	{		alert('Chưa chọn số tiền để nạp !');
		document.getElementById("sotien").focus();  
		return false;		}			if (isNaN(document.getElementById("sotien").value))
	{		alert('Tiền nạp phải là dạng số !');
		document.getElementById("sotien").focus();  
		return false;			}	else	{		if (document.getElementById("sotien").value < 10000)		{			alert('Số tiền tối thiểu phải là 10.000 VNĐ !');
			document.getElementById("sotien").focus();  
			return false;					}	}				params = params + "&sotien=" + document.getElementById("sotien").value;	//params = params + "&nganluongacc=" + document.getElementById("nganluongacc").value;			params = params + "&ghichu=" + document.getElementById("ghichu").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	}function chuyentiennganluong() {	var params;	params = "at=tbchuyentiennganluong";			if (document.getElementById("sotien").value == 0)	{		alert('Chưa chọn số tiền để nạp !');
		document.getElementById("sotien").focus();  
		return false;		}			if (isNaN(document.getElementById("sotien").value))
	{		alert('Tiền nạp phải là dạng số !');
		document.getElementById("sotien").focus();  
		return false;			}	else	{		if (document.getElementById("sotien").value < 10000)		{			alert('Số tiền tối thiểu phải là 10.000 VNĐ !');
			document.getElementById("sotien").focus();  
			return false;					}	}				params = params + "&sotien=" + document.getElementById("sotien").value;	//params = params + "&nganluongacc=" + document.getElementById("nganluongacc").value;			params = params + "&ghichu=" + document.getElementById("ghichu").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	}function chuyentienmobivi() {	var params;	params = "at=tbchuyentienmobivi";			if (document.getElementById("sotien").value == 0)	{		alert('Chưa chọn số tiền để nạp !');
		document.getElementById("sotien").focus();  
		return false;		}			if (isNaN(document.getElementById("sotien").value))
	{		alert('Tiền nạp phải là dạng số !');
		document.getElementById("sotien").focus();  
		return false;			}	else	{		if (document.getElementById("sotien").value < 10000)		{			alert('Số tiền tối thiểu phải là 10.000 VNĐ !');
			document.getElementById("sotien").focus();  
			return false;					}	}				params = params + "&sotien=" + document.getElementById("sotien").value;	//params = params + "&nganluongacc=" + document.getElementById("nganluongacc").value;			params = params + "&ghichu=" + document.getElementById("ghichu").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	}function chuyentien() {	var params;	params = "at=tbchuyentien";		//if (document.getElementById("tkchuyen").value == '')
	//{    
	//	alert('Chua  nhap du du lieu !');
	//	document.getElementById("tkchuyen").focus();  
	//	return false;
	//}			if (document.getElementById("tknhan").value == 0)	{		alert('Tai khoan nhan chua co !');
		document.getElementById("tknhan").focus();  
		return false;		}	if (document.getElementById("tienchuyen").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("tienchuyen").focus();  
		return false;
	}		if (isNaN(document.getElementById("tienchuyen").value))
	{		alert('Tien chuyen phai la dang so !');
		document.getElementById("tienchuyen").focus();  
		return false;			}	if (document.getElementById("tkchuyen").value != '' && document.getElementById("nganhang").value == 0)	{		alert('Chua chon ngan hang cho tai khoan chuyen !');
		document.getElementById("nganhang").focus();  
		return false;			}		params = params + "&tkchuyen=" + document.getElementById("tkchuyen").value;	params = params + "&nganhang=" + document.getElementById("nganhang").value;		params = params + "&tienchuyen=" + document.getElementById("tienchuyen").value;	params = params + "&tknhan=" + document.getElementById("tknhan").value;	params = params + "&ghichu=" + document.getElementById("ghichu").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	}function chuyennoibo() {	var params;	params = "at=chuyennoibo";		if (document.getElementById("tknhan").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("tknhan").focus();  
		return false;
	}			if (document.getElementById("tienchuyen").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("tienchuyen").focus();  
		return false;
	}		if (isNaN(document.getElementById("tienchuyen").value))
	{		alert('Tien chuyen phai la dang so !');
		document.getElementById("tienchuyen").focus();  
		return false;			}		params = params + "&tkchuyen=" + document.getElementById("tkchuyen").value;	params = params + "&tknhan=" + document.getElementById("tknhan").value;		params = params + "&tienchuyen=" + document.getElementById("tienchuyen").value;		params = params + "&ghichu=" + document.getElementById("ghichu").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	}function qsruttien(){
var answer = confirm ("Bạn có chắc chắn thực hiện yêu cầu này ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	ruttien();
else
	alert ("Yêu cầu không được thực hiện")
}function ruttien() {	var params;	params = "at=ruttien";	if (document.getElementById("tienrut").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("tienrut").focus();  
		return false;
	}		if (isNaN(document.getElementById("tienrut").value))
	{		alert('So tien phai la dang so !');
		document.getElementById("tienrut").focus();  
		return false;			}		if (document.getElementById("tknhan").value == 0)
	{    
		alert('Tai khoan nhan chua co !');
		document.getElementById("tknhan").focus();  
		return false;
	}			params = params + "&tknhan=" + document.getElementById("tknhan").value;		params = params + "&tienrut=" + document.getElementById("tienrut").value;	params = params + "&ghichu=" + document.getElementById("ghichu").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function dt636Ent(event){	var KeyID = event.keyCode;   switch(KeyID)
   {
      case 13:		qsmuadt636();
      break; 	}	}function dt123Ent(event){	var KeyID = event.keyCode;   switch(KeyID)
   {
      case 13:		qsmuadt123();
      break; 	}	}
function qsmuadt123(){
var answer = confirm ("Bạn có chắc chắn thực hiện đặt lệnh này ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	muadt123();
else
	alert ("Lệnh không được thực hiện")
}function thantaiEnt(event){	var KeyID = event.keyCode;   switch(KeyID)
   {
      case 13:		qsmuathantai4();
      break; 	}	}
function qsmuathantai4(){
var answer = confirm ("Bạn có chắc chắn thực hiện đặt lệnh này ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	muathantai4();
else
	alert ("Lệnh không được thực hiện")
}function muathantai4() {	var params;	params = "at=muathantai4";	if (document.getElementById("fromDateId").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("fromDateId").focus();  
		return false;
	}		if (isDate(document.getElementById("fromDateId").value))	{	}	else	{		alert('Dữ liệu dạng ngày không đúng !');
		document.getElementById("fromDateId").focus();  
		return false;			}		if (document.getElementById("sotien").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("sotien").focus();  
		return false;
	}		if (isNaN(document.getElementById("sotien").value))
	{		alert('So tien phai la dang so !');
		document.getElementById("sotien").focus();  
		return false;			}		if (document.getElementById("thantai4").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("thantai4").focus();  
		return false;
	}	else	{		if (isNaN(document.getElementById("thantai4").value))
		{			alert('Số chọn phải là dạng số !');
			document.getElementById("thantai4").focus();  
			return false;				}			}				params = params + "&ngayquay=" + document.getElementById("fromDateId").value;		params = params + "&sotien=" + document.getElementById("sotien").value;	params = params + "&sochon=" + document.getElementById("thantai4").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function muadt123() {	var params;	params = "at=muadt123";				if (document.getElementById("fromDateId").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("fromDateId").focus();  
		return false;
	}		if (document.getElementById("sotien").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("sotien").focus();  
		return false;
	}		if (isNaN(document.getElementById("sotien").value))
	{		alert('So tien phai la dang so !');
		document.getElementById("sotien").focus();  
		return false;			}		if (document.getElementById("boso1").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("boso1").focus();  
		return false;
	}	if (isNaN(document.getElementById("boso1").value))
	{		alert('So chon phai la dang so !');
		document.getElementById("boso1").focus();  
		return false;			}		if (document.getElementById("boso2").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("boso2").focus();  
		return false;
	}	if (isNaN(document.getElementById("boso2").value))
	{		alert('So chon phai la dang so !');
		document.getElementById("boso2").focus();  
		return false;			}	if (document.getElementById("boso3").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("boso3").focus();  
		return false;
	}	if (isNaN(document.getElementById("boso3").value))
	{		alert('So chon phai la dang so !');
		document.getElementById("boso3").focus();  
		return false;			}	if (isDate(document.getElementById("fromDateId").value))
	{	}	else	{			alert('Dữ liệu dạng ngày không đúng !');
		document.getElementById("fromDateId").focus();		return false;		
	}		params = params + "&ngayquay=" + document.getElementById("fromDateId").value;		params = params + "&sotien=" + document.getElementById("sotien").value;	params = params + "&boso1=" + document.getElementById("boso1").value;	params = params + "&boso2=" + document.getElementById("boso2").value;	params = params + "&boso3=" + document.getElementById("boso3").value;		//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function qsmuadt636(){
var answer = confirm ("Bạn có chắc chắn thực hiện đặt lệnh này ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	muadt636();
else
	alert ("Lệnh không được thực hiện")
}function muadt636() {	var params;	params = "at=muadt636";				if (document.getElementById("fromDateId").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu!');
		document.getElementById("fromDateId").focus();  
		return false;
	}		if (document.getElementById("sotien").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu !');
		document.getElementById("sotien").focus();  
		return false;
	}		if (isNaN(document.getElementById("sotien").value))
	{		alert('Tiền phải là dạng số !');
		document.getElementById("sotien").focus();  
		return false;			}		if (document.getElementById("so1").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu !');
		document.getElementById("so1").focus();  
		return false;
	}	if (isNaN(document.getElementById("so1").value))
	{		alert('Số chọn phải là dạng số !');
		document.getElementById("so1").focus();  
		return false;			}		if (document.getElementById("so2").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu !');
		document.getElementById("so2").focus();  
		return false;
	}	if (isNaN(document.getElementById("so2").value))
	{		alert('Số chọn phải là dạng số !');
		document.getElementById("so2").focus();  
		return false;			}		if (document.getElementById("so3").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu !');
		document.getElementById("so3").focus();  
		return false;
	}	if (isNaN(document.getElementById("so3").value))
	{		alert('Số chọn phải là dạng số !');
		document.getElementById("so3").focus();  
		return false;			}		if (document.getElementById("so4").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu !');
		document.getElementById("so4").focus();  
		return false;
	}	if (isNaN(document.getElementById("so4").value))
	{		alert('Số chọn phải là dạng số !');
		document.getElementById("so4").focus();  
		return false;			}	if (document.getElementById("so5").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu !');
		document.getElementById("so5").focus();  
		return false;
	}	if (isNaN(document.getElementById("so5").value))
	{		alert('Số chọn phải là dạng số !');
		document.getElementById("so5").focus();  
		return false;			}	if (document.getElementById("so6").value == '')
	{    
		alert('Chưa nhập đủ dữ liệu !');
		document.getElementById("so6").focus();  
		return false;
	}	if (isNaN(document.getElementById("so6").value))
	{		alert('Số chọn phải là dạng số !');
		document.getElementById("so6").focus();  
		return false;			}			if (isDate(document.getElementById("fromDateId").value))
	{	}	else	{			alert('Dữ liệu dạng ngày không đúng !');
		document.getElementById("fromDateId").focus();		return false;		
	}		params = params + "&ngayquay=" + document.getElementById("fromDateId").value;		params = params + "&sotien=" + document.getElementById("sotien").value;	params = params + "&so1=" + document.getElementById("so1").value;	params = params + "&so2=" + document.getElementById("so2").value;	params = params + "&so3=" + document.getElementById("so3").value;		params = params + "&so4=" + document.getElementById("so4").value;	params = params + "&so5=" + document.getElementById("so5").value;	params = params + "&so6=" + document.getElementById("so6").value;	//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function mualttcEnt(event){	var KeyID = event.keyCode;   switch(KeyID)
   {
      case 13:		qsmualttc();
      break; 	}	}function qsmualttc(){
var answer = confirm ("Bạn có chắc chắn thực hiện đặt lệnh này ?")
if (answer)
	//alert ("Woo Hoo! So am I.")	mualttc();
else
	alert ("Lệnh không được thực hiện")
}function mualttc() {	var params;	var chonmau;	params = "at=mualttc";	chonmau = document.getElementById("chonmau").value;		//gameid = 4	if (document.getElementById("gameid").value == 0)	{			alert('Chọn loại xổ số !');
			document.getElementById("gameid").focus();  
			return false;			}		if (document.getElementById("gameid").value == 4)	{			if (chonmau >=1)		{		}		else		{			if (document.getElementById("van").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("van").focus();  
				return false;
			}				if (isNaN(document.getElementById("van").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("van").focus();  
				return false;					}			if (document.getElementById("nghin").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("nghin").focus();  
				return false;
			}				if (isNaN(document.getElementById("nghin").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("nghin").focus();  
				return false;					}				if (document.getElementById("tram").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("tram").focus();  
				return false;
			}				if (isNaN(document.getElementById("tram").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("tram").focus();  
				return false;					}			if (document.getElementById("chuc").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("chuc").focus();  
				return false;
			}				if (isNaN(document.getElementById("chuc").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("chuc").focus();  
				return false;					}			if (document.getElementById("donvi").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("donvi").focus();  
				return false;
			}				if (isNaN(document.getElementById("donvi").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("donvi").focus();  
				return false;					}				}		//if (chonmau >=1)				params = params + "&van=" + document.getElementById("van").value;		params = params + "&nghin=" + document.getElementById("nghin").value;		params = params + "&tram=" + document.getElementById("tram").value;		params = params + "&chuc=" + document.getElementById("chuc").value;		params = params + "&donvi=" + document.getElementById("donvi").value;			}	//if (document.getElementById("gameid").value == 4)		/**	//gameid 3	if (document.getElementById("gameid").value == 3)	{				if (document.getElementById("nghin").value == '')
		{    
			alert('Chua nhap du so lieu !');
			document.getElementById("nghin").focus();  
			return false;
		}			if (isNaN(document.getElementById("nghin").value))
		{			alert('Du lieu phai la dang so !');
			document.getElementById("nghin").focus();  
			return false;				}			if (document.getElementById("tram").value == '')
		{    
			alert('Chua nhap du so lieu !');
			document.getElementById("tram").focus();  
			return false;
		}			if (isNaN(document.getElementById("tram").value))
		{			alert('Du lieu phai la dang so !');
			document.getElementById("tram").focus();  
			return false;				}		if (document.getElementById("chuc").value == '')
		{    
			alert('Chua nhap du so lieu !');
			document.getElementById("chuc").focus();  
			return false;
		}			if (isNaN(document.getElementById("chuc").value))
		{			alert('Du lieu phai la dang so !');
			document.getElementById("chuc").focus();  
			return false;				}		if (document.getElementById("donvi").value == '')
		{    
			alert('Chua nhap du so lieu !');
			document.getElementById("donvi").focus();  
			return false;
		}			if (isNaN(document.getElementById("donvi").value))
		{			alert('Du lieu phai la dang so !');
			document.getElementById("donvi").focus();  
			return false;				}			params = params + "&nghin=" + document.getElementById("nghin").value;		params = params + "&tram=" + document.getElementById("tram").value;		params = params + "&chuc=" + document.getElementById("chuc").value;		params = params + "&donvi=" + document.getElementById("donvi").value;			}	//if (document.getElementById("gameid").value == 3)	**/		//gameid 2	if (document.getElementById("gameid").value == 2)	{				if (chonmau >=1)		{		}		else		{			if (document.getElementById("tram").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("tram").focus();  
				return false;
			}				if (isNaN(document.getElementById("tram").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("tram").focus();  
				return false;					}			if (document.getElementById("chuc").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("chuc").focus();  
				return false;
			}				if (isNaN(document.getElementById("chuc").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("chuc").focus();  
				return false;					}			if (document.getElementById("donvi").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("donvi").focus();  
				return false;
			}				if (isNaN(document.getElementById("donvi").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("donvi").focus();  
				return false;					}					}		//if (chonmau >=1)				params = params + "&nghin=" + document.getElementById("nghin").value;		params = params + "&tram=" + document.getElementById("tram").value;		params = params + "&chuc=" + document.getElementById("chuc").value;		params = params + "&donvi=" + document.getElementById("donvi").value;			}	//if (document.getElementById("gameid").value == 2)		//gameid 1	if (document.getElementById("gameid").value == 1)	{				if (chonmau >=1)		{		}		else		{			if (document.getElementById("chuc").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("chuc").focus();  
				return false;
			}				if (isNaN(document.getElementById("chuc").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("chuc").focus();  
				return false;					}			if (document.getElementById("donvi").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("donvi").focus();  
				return false;
			}				if (isNaN(document.getElementById("donvi").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("donvi").focus();  
				return false;					}				}		//if (chonmau >=1)			params = params + "&chuc=" + document.getElementById("chuc").value;		params = params + "&donvi=" + document.getElementById("donvi").value;			}	//if (document.getElementById("gameid").value == 1)			//gameid 7	if (document.getElementById("gameid").value == 7)	{								if (chonmau >=1)		{		}		else		{			if (document.getElementById("capso4").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso4").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso4").value))
			{				alert('Dữ liệu phải là dạng số !');
				document.getElementById("capso4").focus();  
				return false;					}				if (document.getElementById("capso3").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso3").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso3").value))
			{				alert('Dữ liệu phải là dạng số !');
				document.getElementById("capso3").focus();  
				return false;					}			if (document.getElementById("capso2").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso2").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso2").value))
			{				alert('Dữ liệu phải là dạng số !');
				document.getElementById("capso2").focus();  
				return false;					}			if (document.getElementById("capso1").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso1").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso1").value))
			{				alert('Dữ liệu phải là dạng số !');
				document.getElementById("capso1").focus();  
				return false;					}				if ((document.getElementById("capso1").value == document.getElementById("capso2").value)||(document.getElementById("capso1").value == document.getElementById("capso3").value) ||(document.getElementById("capso1").value == document.getElementById("capso4").value)||(document.getElementById("capso2").value == document.getElementById("capso3").value)|| (document.getElementById("capso2").value == document.getElementById("capso4").value)||(document.getElementById("capso3").value == document.getElementById("capso4").value))
			{    
				alert('Cặp số không được giống nhau !');
				document.getElementById("capso1").focus();  
				return false;
			}					}		//if (chonmau >=1)				params = params + "&capso4=" + document.getElementById("capso4").value;		params = params + "&capso3=" + document.getElementById("capso3").value;		params = params + "&capso2=" + document.getElementById("capso2").value;		params = params + "&capso1=" + document.getElementById("capso1").value;			}	//if (document.getElementById("gameid").value == 7)	//gameid 6	if (document.getElementById("gameid").value == 6)	{						if (chonmau >=1)		{		}		else		{			if (document.getElementById("capso3").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso3").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso3").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("capso3").focus();  
				return false;					}			if (document.getElementById("capso2").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso2").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso2").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("capso2").focus();  
				return false;					}			if (document.getElementById("capso1").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso1").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso1").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("capso1").focus();  
				return false;					}				if ((document.getElementById("capso1").value == document.getElementById("capso2").value)||(document.getElementById("capso1").value == document.getElementById("capso3").value) || (document.getElementById("capso3").value == document.getElementById("capso2").value))
			{    
				alert('Cap so khong duoc giong nhau !');
				document.getElementById("capso1").focus();  
				return false;
			}					}		//if (chonmau >=1)				params = params + "&capso3=" + document.getElementById("capso3").value;		params = params + "&capso2=" + document.getElementById("capso2").value;		params = params + "&capso1=" + document.getElementById("capso1").value;			}	//if (document.getElementById("gameid").value == 6)		//gameid 5	if (document.getElementById("gameid").value == 5)	{						if (chonmau >=1)		{		}		else		{			if (document.getElementById("capso2").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso2").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso2").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("capso2").focus();  
				return false;					}			if (document.getElementById("capso1").value == '')
			{    
				alert('Chua nhap du so lieu !');
				document.getElementById("capso1").focus();  
				return false;
			}				if (isNaN(document.getElementById("capso1").value))
			{				alert('Du lieu phai la dang so !');
				document.getElementById("capso1").focus();  
				return false;					}				if ((document.getElementById("capso1").value == document.getElementById("capso2").value)||(document.getElementById("capso1").value == document.getElementById("capso3").value) || (document.getElementById("capso3").value == document.getElementById("capso2").value))
			{    
				alert('Cap so khong duoc giong nhau !');
				document.getElementById("capso1").focus();  
				return false;
			}					}		//if (chonmau >=1)				params = params + "&capso2=" + document.getElementById("capso2").value;		params = params + "&capso1=" + document.getElementById("capso1").value;			}	//if (document.getElementById("gameid").value == 5)			if (document.getElementById("fromDateId").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("fromDateId").focus();  
		return false;
	}		if (document.getElementById("sotien").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("sotien").focus();  
		return false;
	}		if (isNaN(document.getElementById("sotien").value))
	{		alert('So tien phai la dang so !');
		document.getElementById("sotien").focus();  
		return false;			}			if (isDate(document.getElementById("fromDateId").value))
	{	}	else	{			alert('Dữ liệu dạng ngày không đúng !');
		document.getElementById("fromDateId").focus();		return false;		
	}			params = params + "&ngayquay=" + document.getElementById("fromDateId").value;			params = params + "&sotien=" + document.getElementById("sotien").value;	params = params + "&gameid=" + document.getElementById("gameid").value;	params = params + "&chonmau=" + document.getElementById("chonmau").value;			//alert(params);	retrieveURLTIEN("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function checkDangnhap(Dangnhap) {
	var params = "at=dn";	if (document.getElementById("ten1").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("ten1").focus();   
		return false;
	}	if (document.getElementById("pass1").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("pass1").focus();  
		return false;
	}	if (document.getElementById("ma1").value == '')
	{    
		alert('Chua  nhap du thong so !');
		document.getElementById("ma1").focus();  
		return false;
	}		if (document.getElementById("ten1").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("ten1").focus();		return false;		
	}	if (document.getElementById("pass1").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("pass1").focus();		return false;		
	}	if (document.getElementById("ma1").value.search("'") >= 0)
	{			alert('Dữ liệu không được có dấu phẩy trên !');
		document.getElementById("ma1").focus();		return false;		
	}		document.Dangnhap.submit();
}function tabdientoan636() 
{
	var params = "";
	params = "at=dt636";
	//params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLtab("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;	
}function tabthantai4() 
{
	var params = "";
	params = "at=thantai4";
	//params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLtab("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;	
}function tablttc() 
{
	var params = "";
	params = "at=lttc";
	//params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLtab("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	
	return true;	
}function tabthongkecoban() 
{
	var params = "";
	params = "at=tkcoban";
	//params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLtab("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	//alert(params);
	return true;	
}function tabthongketonghop() 
{
	var params = "";
	params = "at=tktonghop";
	//params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLtab("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	
	return true;	
}function tabthongkelogic() 
{
	var params = "";
	params = "at=tklogic";
	//params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLtab("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;	
}function tabdientoan123() 
{
	var params = "";
	params = "at=dt123";
	//params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLtab("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);	//alert(params);
	return true;	
}function timlenh() {	var params;	params = "at=timlenh";	if (document.getElementById("ngaybd").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaybd").focus();  
		return false;
	}			if (document.getElementById("ngaykt").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaykt").focus();  
		return false;
	}	if (isDate(document.getElementById("ngaybd").value))	{	}	else	{		
		document.getElementById("ngaybd").focus();  
		return false;					}	if (isDate(document.getElementById("ngaykt").value))	{	}	else	{		
		document.getElementById("ngaykt").focus();  
		return false;					}		params = params + "&ngaybd=" + document.getElementById("ngaybd").value;		params = params + "&ngaykt=" + document.getElementById("ngaykt").value;			//alert(params);	retrieveURLtimlenh("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function saokelenh() {	var params;	params = "at=saokelenh";	if (document.getElementById("ngaybd").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaybd").focus();  
		return false;
	}			if (document.getElementById("ngaykt").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaykt").focus();  
		return false;
	}	if (isDate(document.getElementById("ngaybd").value))	{	}	else	{		
		document.getElementById("ngaybd").focus();  
		return false;					}	if (isDate(document.getElementById("ngaykt").value))	{	}	else	{		
		document.getElementById("ngaykt").focus();  
		return false;					}		params = params + "&ngaybd=" + document.getElementById("ngaybd").value;		params = params + "&ngaykt=" + document.getElementById("ngaykt").value;	params = params + "&gameid=" + document.getElementById("gameid").value;	params = params + "&trangthai=" + document.getElementById("trangthai").value;			//alert(params);	retrieveURLtimlenh("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function saoketien() {	var params;	params = "at=saoketien";	if (document.getElementById("ngaybd").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaybd").focus();  
		return false;
	}			if (document.getElementById("ngaykt").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaykt").focus();  
		return false;
	}	if (isDate(document.getElementById("ngaybd").value))	{	}	else	{		
		document.getElementById("ngaybd").focus();  
		return false;					}	if (isDate(document.getElementById("ngaykt").value))	{	}	else	{		
		document.getElementById("ngaykt").focus();  
		return false;					}		params = params + "&ngaybd=" + document.getElementById("ngaybd").value;		params = params + "&ngaykt=" + document.getElementById("ngaykt").value;	params = params + "&gameid=" + document.getElementById("gameid").value;	params = params + "&trangthai=" + document.getElementById("trangthai").value;			//alert(params);	retrieveURLtimlenh("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function saoketonghop() {	var params;	params = "at=saoketonghop";	if (document.getElementById("ngaybd").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaybd").focus();  
		return false;
	}			if (document.getElementById("ngaykt").value == '')
	{    
		alert('Chua  nhap du du lieu !');
		document.getElementById("ngaykt").focus();  
		return false;
	}	if (isDate(document.getElementById("ngaybd").value))	{	}	else	{		
		document.getElementById("ngaybd").focus();  
		return false;					}	if (isDate(document.getElementById("ngaykt").value))	{	}	else	{		
		document.getElementById("ngaykt").focus();  
		return false;					}		params = params + "&ngaybd=" + document.getElementById("ngaybd").value;		params = params + "&ngaykt=" + document.getElementById("ngaykt").value;			//alert(params);	retrieveURLtimlenh("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function retrieveURLtimlenh(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = timlenhProcess;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = timlenhProcess;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}function retrieveURLtab(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = tabProcessusr;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = tabProcessusr;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}function retrieveURLloadCMB(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = ProcessCMB;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = ProcessCMB;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}function ProcessCMB()
{
	
	if (req.readyState == 4) 
        {
            // only if "OK"			
			if (req.status == 200) 
			{							
				document.getElementById("idcmbgame").innerHTML = req.responseText;											
			}
			else 
			{
				document.getElementById("idcmbgame").innerHTML = "Lam lai";
			}
		}
		else
		{	
			load1 = "<table width=100% border=0><tr><td width=100%><p align=center><img src=images/loading.gif></p></td></tr></table></div>";	
			document.getElementById("idcmbgame").innerHTML = load1;
		}
}function retrieveURLTIEN(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = ProcessTIEN;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = ProcessTIEN;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}function ProcessTIEN()
{
	
	if (req.readyState == 4) 
        {
            // only if "OK"			
			if (req.status == 200) 
			{
								var t1 = req.responseText;
				var tim;
				var kq;
				tim=/@@/i;
				kq = t1.search(tim);
				checkok = new Array();
				if (kq === -1)
				{				
					document.getElementById("tbctlist").innerHTML = req.responseText;					document.getElementById("chonap").innerHTML ='0';
				}
				else
				{
					checkok = t1.split("@@");
					if (checkok[0].length >= 1)
					{
						document.getElementById("tbctlist").innerHTML =checkok[0];
					}					
					if (checkok[1]!='-' && checkok[1]!='')
					{						sd = new Array();						sd = checkok[1].split("~");						document.getElementById("sodu").innerHTML =sd[0];						document.getElementById("chorut").innerHTML =sd[1];						document.getElementById("chonap").innerHTML =sd[2];
					}					if (checkok[2]!='-' && checkok[2]!='')
					{						document.getElementById("thongbao").innerHTML =checkok[2];
					}					
				}							
			}
			else 
			{
				document.getElementById(ar[0]).innerHTML="There was a problem retrieving data:<br>"+req.statusText;
			}
		}
		else
		{	
			load1 = "<table width=100% border=0><tr><td width=100%><p align=center><img src=images/loading.gif></p></td></tr></table></div>";	
			document.getElementById("thongbao").innerHTML = load1;
		}
}function timlenhProcess()
{
	
	if (req.readyState == 4) 
        {
            // only if "OK"			
			if (req.status == 200) 
			{
								var t1 = req.responseText;
				var tim;
				var kq;
				tim=/@@/i;
				kq = t1.search(tim);
				checkok = new Array();
				if (kq === -1)
				{				
					document.getElementById("tbctlist").innerHTML = req.responseText;					//document.getElementById("chonap").innerHTML ='0';
				}
				else
				{
					checkok = t1.split("@@");
					if (checkok[0].length >= 1)
					{
						document.getElementById("tbctlist").innerHTML =checkok[0];
					}					
					if (checkok[1]!='-' && checkok[1]!='')
					{						sd = new Array();						sd = checkok[1].split("~");						document.getElementById("sodu").innerHTML =sd[0];						document.getElementById("chorut").innerHTML =sd[1];						document.getElementById("chonap").innerHTML =sd[2];
					}					if (checkok[2]!='-' && checkok[2]!='')
					{						document.getElementById("thongbao").innerHTML =checkok[2];
					}					
				}							
			}
			else 
			{
				document.getElementById(ar[0]).innerHTML="There was a problem retrieving data:<br>"+req.statusText;
			}
		}
		else
		{	
			load1 = "<table width=100% border=0><tr><td width=100%><p align=center><img src=images/loading.gif></p></td></tr></table></div>";	
			document.getElementById("tbctlist").innerHTML = load1;
		}
}function tabProcessusr()
{
	
	if (req.readyState == 4) 
        {
            // only if "OK"			
			if (req.status == 200) 
			{
								var t1 = req.responseText;
				var tim;
				var kq;
				tim=/@@/i;
				kq = t1.search(tim);
				checkok = new Array();
				if (kq === -1)
				{				
					document.getElementById("tab1").innerHTML = req.responseText;					document.getElementById("gdnhap").innerHTML ='';
				}
				else
				{
					checkok = t1.split("@@");
					if (checkok[0].length >= 1)
					{
						document.getElementById("tab1").innerHTML =checkok[0];
					}					
					if (checkok[1]!='-' && checkok[1]!='')
					{						document.getElementById("gdnhap").innerHTML =checkok[1];
					}					if (checkok[2]!='-' && checkok[2]!='')
					{						//document.getElementById("tbctlist").innerHTML =checkok[2];
					}										
				}							
			}
			else 
			{
				document.getElementById("tab1").innerHTML="There was a problem retrieving data:<br>"+req.statusText;
			}
		}
		else
		{	
			//load1 = "<img src=images/loading.gif>";	
			//document.getElementById("tab1").innerHTML = load1;
		}
}function kichhoatdate(){	setupVNCalendar("fromDateId", "imgFromDateId");}function kichhoatdate1(){	setupVNCalendar("ngaybd", "imgngaybd");	setupVNCalendar("ngaykt", "imgngaykt");}function checkUser() 
{
	var params = "";
	params = "at=chkUser";
	if (document.getElementById("taikhoan").value == '') {
		alert("Chua nhap ten truy nhap");		document.getElementById("taikhoan").focus();
		return false;	
	}	
	
	params = params + "&id2=" + document.getElementById("taikhoan").value;	
	retrieveURLcheckUser("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;	
}function retrieveURLcheckUser(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = tProcesscheckUser;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = tProcesscheckUser;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}function tProcesscheckUser()
{
	
	if (req.readyState == 4) 
        {
            // only if "OK"			
			if (req.status == 200) 
			{
				if(req.responseText=="")
					document.getElementById("checkUser").innerHTML = "khong co"
				else
				{
					document.getElementById("checkUser").innerHTML =req.responseText;
					
				}
			}
			else 
			{
				document.getElementById("checkUser").innerHTML="There was a problem retrieving data:<br>"+req.statusText;
			}
		}
		else
		{	
			load1 = "<img src=images/loading.gif>";	
			document.getElementById("checkUser").innerHTML = load1;
		}
}
function retrieveURLusr(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = tProcessusr;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = tProcessusr;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}function tProcessusr()
{
	
	if (req.readyState == 4) 
        {
            // only if "OK"			
			if (req.status == 200) 
			{
				if(req.responseText=="")
					document.getElementById("automation").innerHTML = "khong co"
				else
				{
					document.getElementById("automation").innerHTML =req.responseText;
					
				}
			}
			else 
			{
				document.getElementById("automation").innerHTML="There was a problem retrieving data:<br>"+req.statusText;
			}
		}
		else
		{	
			load1 = "<img src=images/loading.gif>";	
			document.getElementById("automation").innerHTML = load1;
		}
}
function tProcessusr1()
{
	
	if (req.readyState == 4) 
        {
            // only if "OK"			
			if (req.status == 200) 
			{
				if(req.responseText=="")
					document.getElementById("automation1").innerHTML = ""
				else
				{
					document.getElementById("automation1").innerHTML =req.responseText;
					
				}
			}
			else 
			{
				document.getElementById("automation1").innerHTML="There was a problem retrieving data:<br>"+req.statusText;
			}
		}
		else
		{	
			load1 = "<img src=images/loading.gif>";	
			document.getElementById("automation1").innerHTML = load1;
		}
}
function retrieveURLusr1(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = tProcessusr1;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = tProcessusr1;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}
function newCart(par1) {
		
	retrieveURL2("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", par1);
	
	return true;
}

function deleteCart(par1) {
	
	var params = "";

	
	params = "at=danko.vn_del2cart";				
	params = params + "&lgid=" + document.getElementById("lgid" + par1).value;
	params = params + "&number_pro=" + document.getElementById("number_pro" + par1).value;
	
	params = params + "&price_pro=" + document.getElementById("price_pro" + par1).value;
	params = params + "&name_pro=" + document.getElementById("name_pro" + par1).value;
	params = params + "&sid=" + document.getElementById("sid" + par1).value;
	params = params + "&iden=" + document.getElementById("iden" + par1).value;
			
	retrieveURL2("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	
	return true;
}
function retrieveURL3(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = processStateChange3;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processStateChange3;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(pars);
}
}
}function processStateChange3() {if (req.readyState == 4) { // Complete	if (req.status == 200) 	{ // OK response
			var t1 = req.responseText;			//alert(t1);
			kq = new Array();			if (t1 != "")			{				kq = t1.split(",");								if (kq.length>=1)				{					for (x=0; x<kq.length-1; x++)
					{															if (x == (kq.length-2))						{							document.getElementById("g"+x).innerHTML = '<span class=bgrnhay>&nbsp;'+kq[x]+'&nbsp;</span>';							l1 = x;							gt1 = kq[x];						}						else						{							//document.getElementById("g"+x).innerHTML = kq[x];							//document.getElementById("g"+x).innerHTML = '<span style="background-color: #FFFF00">'+kq[x]+'..'+(kq.length)+'</span>';							document.getElementById("g"+x).innerHTML = kq[x];						}																
					}				}			}			//document.getElementById("thetable1").innerHTML =checkok[0];			
	}
}
else
{
	var load1= "<table border=0 width=100% cellSpacing=0 cellPadding=0  bordercolor=#C0C0C0 style='border-collapse: collapse' align=center>";
	load1 = load1 + "<tr><td><table border=0 width=100% cellSpacing=0 cellPadding=0><tr><td width=100% class=blockTitle style='PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px' noWrap width=99% height=15>";
	load1 = load1 + "</td></tr><TR><TD class=bgc3 height=2></TD></TR><tr><td width=100% height=50><div align=center><img src=images/loading.gif></div>";
	load1 = load1 + "</td></tr></table></td></tr></table>";				            	
	document.getElementById("thetable1").innerHTML = load1;			
}
}
function retrieveURL2(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = processStateChange2;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processStateChange2;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(pars);
//req.send();
}
}
}

function send_order() {
	
	var params = "";
	if (document.getElementById("ten").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("ten").focus();  
			return false;
	}

	if (document.getElementById("diachi").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("diachi").focus();  
			return false;
	}
	if (document.getElementById("dienthoai").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("dienthoai").focus();  
			return false;
	}	
	
	params = params + "&at=" + document.getElementById("at").value;	
	params = params + "&lgid=" + document.getElementById("lgid").value;
	params = params + "&sid=" + document.getElementById("sid").value;
	params = params + "&dienthoai=" + document.getElementById("dienthoai").value;
	
	params = params + "&ten=" + document.getElementById("ten").value;
	params = params + "&congty=" + document.getElementById("congty").value;
	params = params + "&chucdanh=" + document.getElementById("chucdanh").value;
	params = params + "&diachi=" + document.getElementById("diachi").value;
	params = params + "&thanhpho=" + document.getElementById("thanhpho").value;
	params = params + "&tinh=" + document.getElementById("tinh").value;
	params = params + "&mabuudien=" + document.getElementById("mabuudien").value;
	params = params + "&quocgia=" + document.getElementById("quocgia").value;
	params = params + "&fax=" + document.getElementById("fax").value;
	params = params + "&thu=" + document.getElementById("thu").value;
	
	params = params + "&tinkhac=" + document.getElementById("tinkhac").value;
		

	
	retrieveURL("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	
	return true;
}

function check_tuvan() {
	
	var params = "";
	if (document.getElementById("ten").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("ten").focus();  
			return false;
	}

	if (document.getElementById("diachi").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("diachi").focus();  
			return false;
	}
	if (document.getElementById("dienthoai").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("dienthoai").focus();  
			return false;
	}	
	
	if (document.getElementById("mabaove").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("mabaove").focus();  
			return false;
	}		
	
}function tenEnt(event){	var KeyID = event.keyCode;	//var sChar=String.fromCharCode(KeyID);	//alert(sChar);	   switch(KeyID)
   {
      case 13:		document.getElementById("pass1").focus();
      break; 	}	}
function passEnt(event){	var KeyID = event.keyCode;   switch(KeyID)
   {
      case 13:		document.getElementById("ma1").focus();
      break; 	}	}function maEnt(event){	var KeyID = event.keyCode;   switch(KeyID)
   {
      case 13:		document.Dangnhap.submit();
      break; 	}	}
function send_mail() {
	
	var params = "";
	if (document.getElementById("ten").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("ten").focus();  
			return false;
	}

	if (document.getElementById("mabaove").value=='')
	{    
			alert('Chua  nhap du thong so !');
			document.getElementById("mabaove").focus();  
			return false;
	}
	
	params = params + "&at=" + document.getElementById("at").value;	
	params = params + "&lgid=" + document.getElementById("lgid").value;
	params = params + "&sid=" + document.getElementById("sid").value;
	
	
	params = params + "&ten=" + document.getElementById("ten").value;
	params = params + "&mabaove=" + document.getElementById("mabaove").value;
	
	

	
	retrieveURL("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	
	return true;
}

function retrieveURL(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = processStateChange;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processStateChange;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}


function processStateChange() {
if (req.readyState == 4) 
{ // Complete
	if (req.status == 200) 
	{ // OK response

			var t1 = req.responseText;
			var tim;
			var kq;
			tim=/@@/i;
			kq = t1.search(tim);
			checkok = new Array();
			if (kq === -1)
			{				
				document.getElementById("thetable").innerHTML = req.responseText;
			}
			else
			{
				checkok = t1.split("@@");
				if (checkok[0].length >= 1)
				{
					document.getElementById("thetable").innerHTML =checkok[0];
				}					
				if (checkok[1]!='-' && checkok[1]!='')
				{
				}
			}
			
					
			
	}
}
else
{

	var load1= "<table border=0 width=100% cellSpacing=0 cellPadding=0  bordercolor=#C0C0C0 style='border-collapse: collapse' align=center>";
	load1 = load1 + "<tr><td><table border=0 width=100% cellSpacing=0 cellPadding=0><tr><td width=100% class=blockTitle style='PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px' noWrap width=99% height=15>";
	load1 = load1 + "</td></tr><TR><TD class=bgc3 height=2></TD></TR><tr><td width=100% height=50><div align=center><img src=images/loading.gif></div>";
	load1 = load1 + "</td></tr></table></td></tr></table>";				            	
	document.getElementById("thetable").innerHTML = load1;			

}
}



function processStateChange2() {
if (req.readyState == 4) 
{ // Complete
	if (req.status == 200) 
	{ // OK response

			var t1 = req.responseText;
			var tim;
			var kq;
			tim=/@@/i;
			kq = t1.search(tim);
			
			checkok = new Array();

			
			if (kq === -1)
			{				
				document.getElementById("thetable1").innerHTML = req.responseText;
			}
			else
			{
				checkok = t1.split("@@");
				if (checkok[0].length >= 1)
				{
					document.getElementById("thetable1").innerHTML =checkok[0];
				}
								
				if (checkok[1]!='-' && checkok[1]!='')
				{
					//document.getElementById("piccenter").innerHTML ="<img border=0 src='images/imgupload/"+checkok[1]+"' width=298 height=269>";					
					document.getElementById("thetable1").innerHTML =checkok[0];					document.getElementById("tieudethongke").innerHTML ='Thống kê tổng hợp : ' + checkok[1];					
				}
			}
			
					
			
	}	
}
else
{

	var load1= "<table border=0 width=100% cellSpacing=0 cellPadding=0  bordercolor=#C0C0C0 style='border-collapse: collapse' align=center>";
	load1 = load1 + "<tr><td><table border=0 width=100% cellSpacing=0 cellPadding=0><tr><td width=100% class=blockTitle style='PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px' noWrap width=99% height=15>";
	load1 = load1 + "</td></tr><TR><TD class=bgc3 height=2></TD></TR><tr><td width=100% height=50><div align=center><img src=images/loading.gif></div>";
	load1 = load1 + "</td></tr></table></td></tr></table>";				            	
	document.getElementById("thetable1").innerHTML = load1;			

}
}


function displayItemsAdd2cart(par1) {
	
	var params = par1;	
	retrieveURLAdd2cart("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;
}

function retrieveURLAdd2cart(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = processStateChangeAdd2cart;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processStateChangeAdd2cart;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}


var bb_count = 0;
var bb_curr_idx = "";
var bb_cache = new Array;
//var bb_debug = false;
var bb_debug = true;
var bb_iframe_script = "store.php";
var bb_iframe_loaded = false;
var bb_target_div = "";

//If debug is enabled via bb_init(  ), then
//we append some data to the divTrail 
//element.

function bb_debug_update (str) {
    if (bb_debug) {
        var divBBDebug = document.getElementById("divBBDebug");
        //divBBDebug.innerHTML = divBBDebug.innerHTML + "<br>" + str;
    }
}

//Run from the interval timer (once a second), 
//this function reads a cache index value
//stored in the DIV element of the child IFRAME.
//
//If this extracted cache index differs from the
//current cache index, then the back button was
//pressed. In this case, we pull the corresponding
//data from the cache and update the page.

function bb_check_state (  ) {

    if (bb_iframe_loaded == false) {
        return;
    }

    var doc =  window.frames['bbFrame1'].document;
    var new_idx = doc.getElementById('divFrameCount').innerHTML;

	//alert(bb_curr_idx);
	//alert(new_idx);
	//alert(bb_cache[new_idx]);
    //var bbFrame1 = document.getElementById("bbFrame1");    	
	//bb_debug_update ("Added " + bbFrame1.src + " to cache");
	
    if (new_idx != bb_curr_idx) {

        var debug_msg = "IFRAME changed. Was " 
                        + bb_curr_idx 
                        + ", now " 
                        + new_idx;

        //Pull a previous state from the cache (if it exists).
			
        if (bb_cache[new_idx]) {
            var body1 = document.getElementById("body1");
            body1.innerHTML = bb_cache[new_idx];
			
			//Lay anh trong array ra, dong thoi lay he thong menu san pham
			//get_danhmuc();
			
            debug_msg += " [pulled " 
                         + new_idx 
                         + " from cache]";
        }
        bb_curr_idx = new_idx;

        bb_debug_update (debug_msg);
    }
}

//Called by child IFRAME.

function bb_done_loading () {
    bb_iframe_loaded = true;
}

//Update the hidden IFRAME.

function bb_loadframe (  ) {
    var bbFrame1 = document.getElementById("bbFrame1");
    bb_iframe_loaded = false;
    bbFrame1.src = bb_iframe_script + "?vt=" + bb_count;
	//alert(bbFrame1.src);
	
}

//When requested, save the current state
//in a cache.

function bb_save_state (  ) {
    //Store the new contents in the cache.
    var div_to_cache = document.getElementById(bb_target_div);
    bb_count++;
    bb_cache[bb_count] = div_to_cache.innerHTML;

    bb_debug_update ("Added " + bb_count + " to cache");
			
    //Load the new page into the IFRAME.
    bb_loadframe();

    bb_curr_idx = bb_count;
}

//Load the hidden IFRAME and start an interval timer.

function bb_init (div_name, debug_val) {
	/*
	//Auto Login
	var usr7lunch = readCookie('usr7lunch');
	var pss7lunch = readCookie('pss7lunch');	
	if (usr7lunch==null) 
	{
	}
	else
	{
		document.Truynhap.ten.value = usr7lunch;
		document.Truynhap.matkhau.value = pss7lunch;
		SubAutomit();
	}
	//Ket thuc autologoin
	*/
	
    bb_target_div = div_name;
    bb_debug = debug_val;

    bb_loadframe (  );
    window.setInterval ('bb_check_state()', 1000);
    bb_save_state (  );	
}



var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
		if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
			ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
		else //else if this is a sub level submenu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
		for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
		ultags[t].style.visibility="visible"
		ultags[t].style.display="none"
		}
  }
  
 
}

function get_danhmuc() {
	
	var params = "";
	
	params = params + "&at=danko.vn_danhmuc";	
	//params = params + "&lgid=" + document.getElementById("lgid").value;
	//params = params + "&sid=" + document.getElementById("sid").value;
		
	retrieveURLdanhmuc("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	
	return true;
}

function retrieveURLdanhmuc(url, pars) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = processStateChangedanhmuc;
try {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
//req.setRequestHeader("Content-length", "0");
req.send(pars);
} catch (e) {
alert(e);
}
req.send(null);
//req.send(1);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processStateChangedanhmuc;
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", pars.length);
req.send(pars);
//req.send();
}
}
}


function processStateChangedanhmuc() {
if (req.readyState == 4) 
{ // Complete
	if (req.status == 200) 
	{ // OK response

			var t1 = req.responseText;
			var tim;
			var kq;
			tim=/@@/i;
			kq = t1.search(tim);
			
			checkok = new Array();

			
			if (kq === -1)
			{				
				document.getElementById("dmsp").innerHTML = req.responseText;
			}
			else
			{
				checkok = t1.split("@@");
				if (checkok[0].length >= 1)
				{
					document.getElementById("dmsp").innerHTML =checkok[0];
					buildsubmenus();
				}
								
				if (checkok[1]!='-' && checkok[1]!='')
				{
					//document.getElementById("piccenter").innerHTML ="<img border=0 src='images/imgupload/"+checkok[1]+"' width=298 height=269>";					
					//document.getElementById("thoigian").innerHTML =checkok[1];					
				}
			}
			
					
			
	}
	bb_save_state();	
}
else
{

	var load1= "<table border=0 width=100% cellSpacing=0 cellPadding=0  bordercolor=#C0C0C0 style='border-collapse: collapse' align=center>";
	load1 = load1 + "<tr><td><table border=0 width=100% cellSpacing=0 cellPadding=0><tr><td width=100% class=blockTitle style='PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px' noWrap width=99% height=15>";
	load1 = load1 + "</td></tr><TR><TD class=bgc3 height=2></TD></TR><tr><td width=100% height=50><div align=center><img src=images/loading.gif></div>";
	load1 = load1 + "</td></tr></table></td></tr></table>";				            	
	//document.getElementById("dmsp").innerHTML = load1;			

}
}



function ApplySettings()
{
    var CheckedStocks = CountCheckStock();
    pageSize = parseInt( document.getElementById("txtPageSize").value);
    
    if (pageSize<CheckedStocks)
    {
        pageSize = CheckedStocks;
    }
    if (pageSize<15)
    {
        pageSize = 15;
    }
    if (pageSize>LiveStockSecurity.length )
    {
        pageSize = LiveStockSecurity.length ;
    }
    document.getElementById("txtPageSize").value = pageSize;
    MakingHeader();
    MakingContent();
    ShowNextInterval();
}
function change_location1(boxmenu) {
	var idbank = boxmenu[boxmenu.selectedIndex].value;
	var params;				params = "at=bankc&id2=" + idbank;			
	retrieveURLusr("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;		
}function change_location4(boxmenu) {
	var idbank = boxmenu[boxmenu.selectedIndex].value;
	var params;				params = "at=searchbank&id2=" + idbank;			
	retrieveURLusr1("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;		
}function change_locationvtc(boxmenu) {
	var idbank = boxmenu[boxmenu.selectedIndex].value;	var vcoin = 1;	//1000000 -> 12000 Vcoin	document.getElementById("vcoin1").value = idbank*12/1000;
	return true;		
}
function change_location2(boxmenu) {
	var idbank = boxmenu[boxmenu.selectedIndex].value;
	var params;				params = "at=bankc&id2=" + idbank;			
	retrieveURLusr1("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);
	return true;		
}function change_location3(boxmenu) {
	var gameid;	gameid = boxmenu[boxmenu.selectedIndex].value;
			var n1;	var n2;		document.getElementById("thongbao").innerHTML = '';		/**	n1 = "<table border='0' width='100%' id='tbg' align=center cellpadding=0 cellspacing=0>";			
	n1 = n1 + "<tr>";
	n1 = n1 + "<td width='20%' height=25>";
	n1 = n1 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Vạn</td>";	
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Nghìn</td>";
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Trăm</td>";
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Chục</td>";
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Đơn vị</td>";
	n1 = n1 + "</tr>";
	n1 = n1 + "<tr>";
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p align='center'>";
	n1 = n1 + "<input type=text id='van' name='van' size='20' style='width: 100px' class=fieldNumber_Center></td>";	
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p align='center'>";
	n1 = n1 + "<input type=text id='nghin' name='nghin' size='20' style='width: 100px' class=fieldNumber_Center></td>";
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p align='center'>";
	n1 = n1 + "<input type=text id='tram' name='tram' size='20' style='width: 100px' class=fieldNumber_Center></td>";
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p align='center'>";
	n1 = n1 + "<input type=text id='chuc' name='chuc' size='20' style='width: 100px' class=fieldNumber_Center></td>";
	n1 = n1 + "<td width='20%'>";
	n1 = n1 + "<p align='center'>";
	n1 = n1 + "<input type=text id='donvi' name='donvi' size='20' style='width: 100px' class=fieldNumber_Center></td>";
	n1 = n1 + "</tr>";										
	n1 = n1 + "</table>";	**/	n1 = "<table border='0' width='100%' id='tbg' align=center cellpadding='0' cellspacing='0'>";			
	n1 = n1 + "	<tr>";
	n1 = n1 + "		<td width='12%' height=25>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Vạn</td>";	
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Nghìn</td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Trăm</td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Chục</td>";
	n1 = n1 + "		<td width='14%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Đơn vị</td>";
	n1 = n1 + "		<td width='36%'>";
	n1 = n1 + "		<p align='center' >Số tiền :</p>";
	n1 = n1 + "		</td>";
	n1 = n1 + "	</tr>";
	n1 = n1 + "	<tr>";
	n1 = n1 + "		<td width='12%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='van' maxlength=1  name='van' size='20' style='width: 80px' class=fieldNumber_Center></td>";	
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='nghin' maxlength=1 name='nghin' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='tram' maxlength=1 name='tram' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='chuc' maxlength=1 name='chuc' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='14%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='donvi' maxlength=1 name='donvi' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='36%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='sotien' maxlength=10 name='sotien' size='20' style='width: 200px; background-color:#F3F3F3' class=fieldNumber_Tien onkeypress='mualttcEnt(event)'></td>";
	n1 = n1 + "	</tr>";										
	n1 = n1 + "</table>";		n2 = "<table border='0' width='100%' id='tbg' align=center cellpadding=0 cellspacing=0>";			
	n2 = n2 + "<tr>";	n2 = n2 + "<td width='17%' height=25>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ tư</td>";	
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ ba</td>";
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ hai</td>";
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ nhất</td>";	n2 = n2 + "		<td width='32%'>";
	n2 = n2 + "		<p align='center'>";
	n2 = n2 + "Số tiền</td>";	
	n2 = n2 + "</tr>";	
	n2 = n2 + "<tr>";	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";
		n2 = n2 + "<input type=text id='capso4' maxlength=2 name='capso4' size='20' style='width: 80px' class=fieldNumber_Center></td>";	
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";	n2 = n2 + "<input type=text id='capso3' maxlength=2 name='capso3' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";
	n2 = n2 + "<input type=text id='capso2' maxlength=2 name='capso2' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";
	n2 = n2 + "<input type=text id='capso1' maxlength=2 name='capso1' size='20' style='width: 80px' class=fieldNumber_Center></td>";	n2 = n2 + "		<td width='32%'>";
	n2 = n2 + "		<p align='center'>";
	n2 = n2 + "		<input type=text id='sotien' maxlength=10 name='sotien' size='20' style='width: 200px; background-color:#F3F3F3' class=fieldNumber_Tien onkeypress='mualttcEnt(event)'></td>";	
	n2 = n2 + "</tr>";										
	n2 = n2 + "</table>";		document.getElementById("sotien").value = "";		//document.getElementById("txtvan").innerHTML  = "Cửu được";				switch (gameid) {
	case "5": 				document.getElementById("gd1").innerHTML = n2;		document.getElementById("capso3").disabled  = true;		document.getElementById("capso3").style.background = '#999999';			document.getElementById("capso4").disabled  = true;		document.getElementById("capso4").style.background = '#999999';			document.getElementById("capso1").disabled  = false;		document.getElementById("capso1").style.background = '#E4E4E4';			document.getElementById("capso2").disabled  = false;		document.getElementById("capso2").style.background = '#E4E4E4';					break;	case "6": 				document.getElementById("gd1").innerHTML = n2;		document.getElementById("capso3").disabled  = false;		document.getElementById("capso3").style.background = '#E4E4E4';			document.getElementById("capso4").disabled  = true;		document.getElementById("capso4").style.background = '#999999';			document.getElementById("capso1").disabled  = false;		document.getElementById("capso1").style.background = '#E4E4E4';			document.getElementById("capso2").disabled  = false;		document.getElementById("capso2").style.background = '#E4E4E4';				break;	case "7": 				document.getElementById("gd1").innerHTML = n2;				document.getElementById("capso3").disabled  = false;		document.getElementById("capso3").style.background = '#E4E4E4';			document.getElementById("capso4").disabled  = false;		document.getElementById("capso4").style.background = '#E4E4E4';			document.getElementById("capso1").disabled  = false;		document.getElementById("capso1").style.background = '#E4E4E4';			document.getElementById("capso2").disabled  = false;		document.getElementById("capso2").style.background = '#E4E4E4';					break;			case "1": 		document.getElementById("gd1").innerHTML = n1; 		break;	case "2": 		document.getElementById("gd1").innerHTML = n1; 		break;	case "3": 		document.getElementById("gd1").innerHTML = n1; 		break;	case "4": 		document.getElementById("gd1").innerHTML = n1; 		break;		
	default: 		document.getElementById("gd1").innerHTML = n1;
	}			if (gameid == 1)	{				document.getElementById("van").disabled  = true;		document.getElementById("van").style.background = '#999999';				document.getElementById("tram").disabled  = true;		document.getElementById("tram").style.background = '#999999';				document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";						document.getElementById("nghin").disabled  = true;		document.getElementById("nghin").value = "";				document.getElementById("nghin").style.background = '#999999';								document.getElementById("chuc").disabled  = false;		document.getElementById("donvi").disabled  = false;		document.getElementById("chuc").style.background = '#E4E4E4';		document.getElementById("donvi").style.background = '#E4E4E4';			}		if (gameid == 2)	{				document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";				document.getElementById("van").disabled  = true;		document.getElementById("van").style.background = '#999999';				document.getElementById("nghin").disabled  = true;		document.getElementById("nghin").style.background = '#999999';				document.getElementById("tram").disabled  = false;				document.getElementById("tram").style.background = '#E4E4E4';				document.getElementById("chuc").disabled  = false;		document.getElementById("chuc").style.background = '#E4E4E4';		document.getElementById("donvi").disabled  = false;				document.getElementById("donvi").style.background = '#E4E4E4';			}		if (gameid == 3)	{		document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";				document.getElementById("van").disabled  = true;		document.getElementById("van").style.background = '#999999';				document.getElementById("nghin").disabled  = false;		document.getElementById("nghin").style.background = '#E4E4E4';				document.getElementById("tram").disabled  = false;				document.getElementById("tram").style.background = '#E4E4E4';				document.getElementById("chuc").disabled  = false;		document.getElementById("chuc").style.background = '#E4E4E4';		document.getElementById("donvi").disabled  = false;				document.getElementById("donvi").style.background = '#E4E4E4';			}		if (gameid == 4)	{		document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";				document.getElementById("van").disabled  = false;		document.getElementById("van").style.background = '#E4E4E4';				document.getElementById("nghin").disabled  = false;		document.getElementById("nghin").style.background = '#E4E4E4';				document.getElementById("tram").disabled  = false;				document.getElementById("tram").style.background = '#E4E4E4';				document.getElementById("chuc").disabled  = false;		document.getElementById("chuc").style.background = '#E4E4E4';		document.getElementById("donvi").disabled  = false;				document.getElementById("donvi").style.background = '#E4E4E4';			}				fillcmbgamechonmau(gameid);
	return true;		
}function change_location5(boxmenu) {
	var idtaplenh = boxmenu[boxmenu.selectedIndex].value;
	var gameid = document.getElementById("gameid").value;			n1 = "<table border='0' width='100%' id='tbg' align=center cellpadding='0' cellspacing='0'>";			
	n1 = n1 + "	<tr>";
	n1 = n1 + "		<td width='12%' height=25>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Vạn</td>";	
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Nghìn</td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Trăm</td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Chục</td>";
	n1 = n1 + "		<td width='14%'>";
	n1 = n1 + "		<p style='margin-top: 0; margin-bottom: 0' align='center'>Đơn vị</td>";
	n1 = n1 + "		<td width='36%'>";
	n1 = n1 + "		<p align='center' >Số tiền :</p>";
	n1 = n1 + "		</td>";
	n1 = n1 + "	</tr>";
	n1 = n1 + "	<tr>";
	n1 = n1 + "		<td width='12%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='van' maxlength=1  name='van' size='20' style='width: 80px' class=fieldNumber_Center></td>";	
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='nghin' maxlength=1 name='nghin' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='tram' maxlength=1 name='tram' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='13%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='chuc' maxlength=1 name='chuc' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='14%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='donvi' maxlength=1 name='donvi' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n1 = n1 + "		<td width='36%'>";
	n1 = n1 + "		<p align='center'>";
	n1 = n1 + "		<input type=text id='sotien' maxlength=10 name='sotien' size='20' style='width: 200px; background-color:#F3F3F3' class=fieldNumber_Tien onkeypress='mualttcEnt(event)'></td>";
	n1 = n1 + "	</tr>";										
	n1 = n1 + "</table>";		n2 = "<table border='0' width='100%' id='tbg' align=center cellpadding=0 cellspacing=0>";			
	n2 = n2 + "<tr>";	n2 = n2 + "<td width='17%' height=25>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ tư</td>";	
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ ba</td>";
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ hai</td>";
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p style='margin-top: 0; margin-bottom: 0' align='center'>Cặp số thứ nhất</td>";	n2 = n2 + "		<td width='32%'>";
	n2 = n2 + "		<p align='center'>";
	n2 = n2 + "Số tiền</td>";	
	n2 = n2 + "</tr>";	
	n2 = n2 + "<tr>";	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";
		n2 = n2 + "<input type=text id='capso4' maxlength=2 name='capso4' size='20' style='width: 80px' class=fieldNumber_Center></td>";	
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";	n2 = n2 + "<input type=text id='capso3' maxlength=2 name='capso3' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";
	n2 = n2 + "<input type=text id='capso2' maxlength=2 name='capso2' size='20' style='width: 80px' class=fieldNumber_Center></td>";
	n2 = n2 + "<td width='17%'>";
	n2 = n2 + "<p align='center'>";
	n2 = n2 + "<input type=text id='capso1' maxlength=2 name='capso1' size='20' style='width: 80px' class=fieldNumber_Center></td>";	n2 = n2 + "		<td width='32%'>";
	n2 = n2 + "		<p align='center'>";
	n2 = n2 + "		<input type=text id='sotien' maxlength=10 name='sotien' size='20' style='width: 200px; background-color:#F3F3F3' class=fieldNumber_Tien onkeypress='mualttcEnt(event)'></td>";	
	n2 = n2 + "</tr>";										
	n2 = n2 + "</table>";		document.getElementById("sotien").value = "";		//document.getElementById("txtvan").innerHTML  = "Cửu được";				switch (gameid) {
	case "5": 				document.getElementById("gd1").innerHTML = n2;		document.getElementById("capso3").disabled  = true;		document.getElementById("capso3").style.background = '#999999';			document.getElementById("capso4").disabled  = true;		document.getElementById("capso4").style.background = '#999999';			if (idtaplenh == 0)		{			document.getElementById("capso1").disabled  = false;			document.getElementById("capso1").style.background = '#E4E4E4';				document.getElementById("capso2").disabled  = false;			document.getElementById("capso2").style.background = '#E4E4E4';						}		else		{			document.getElementById("capso1").disabled  = true;			document.getElementById("capso1").style.background = '#999999';				document.getElementById("capso2").disabled  = true;			document.getElementById("capso2").style.background = '#999999';								}						break;	case "6": 				document.getElementById("gd1").innerHTML = n2;		document.getElementById("capso4").disabled  = true;		document.getElementById("capso4").style.background = '#999999';			if (idtaplenh == 0)		{			document.getElementById("capso3").disabled  = false;			document.getElementById("capso3").style.background = '#E4E4E4';						document.getElementById("capso1").disabled  = false;			document.getElementById("capso1").style.background = '#E4E4E4';				document.getElementById("capso2").disabled  = false;			document.getElementById("capso2").style.background = '#E4E4E4';							}		else		{				document.getElementById("capso3").disabled  = true;			document.getElementById("capso3").style.background = '#999999';									document.getElementById("capso1").disabled  = true;			document.getElementById("capso1").style.background = '#999999';				document.getElementById("capso2").disabled  = true;			document.getElementById("capso2").style.background = '#999999';										}				break;	case "7": 				document.getElementById("gd1").innerHTML = n2;					if (idtaplenh == 0)		{					document.getElementById("capso1").disabled  = false;			document.getElementById("capso1").style.background = '#E4E4E4';				document.getElementById("capso2").disabled  = false;			document.getElementById("capso2").style.background = '#E4E4E4';								document.getElementById("capso3").disabled  = false;			document.getElementById("capso3").style.background = '#E4E4E4';				document.getElementById("capso4").disabled  = false;			document.getElementById("capso4").style.background = '#E4E4E4';					}		else		{													document.getElementById("capso1").disabled  = true;			document.getElementById("capso1").style.background = '#999999';				document.getElementById("capso2").disabled  = true;			document.getElementById("capso2").style.background = '#999999';				document.getElementById("capso3").disabled  = true;			document.getElementById("capso3").style.background = '#999999';				document.getElementById("capso4").disabled  = true;			document.getElementById("capso4").style.background = '#999999';								}				break;			case "1": 		document.getElementById("gd1").innerHTML = n1; 		break;	case "2": 		document.getElementById("gd1").innerHTML = n1; 		break;	case "3": 		document.getElementById("gd1").innerHTML = n1; 		break;	case "4": 		document.getElementById("gd1").innerHTML = n1; 		break;		
	default: 		document.getElementById("gd1").innerHTML = n1;
	}			if (gameid == 1)	{				document.getElementById("van").disabled  = true;		document.getElementById("van").style.background = '#999999';				document.getElementById("tram").disabled  = true;		document.getElementById("tram").style.background = '#999999';				document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";						document.getElementById("nghin").disabled  = true;		document.getElementById("nghin").value = "";				document.getElementById("nghin").style.background = '#999999';						if (idtaplenh == 0)		{			document.getElementById("chuc").disabled  = false;			document.getElementById("donvi").disabled  = false;			document.getElementById("chuc").style.background = '#E4E4E4';			document.getElementById("donvi").style.background = '#E4E4E4';						}		else		{			document.getElementById("chuc").disabled  = true;			document.getElementById("donvi").disabled  = true;			document.getElementById("chuc").style.background = '#999999';			document.getElementById("donvi").style.background = '#999999';				}	}		if (gameid == 2)	{				document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";				document.getElementById("van").disabled  = true;		document.getElementById("van").style.background = '#999999';				document.getElementById("nghin").disabled  = true;		document.getElementById("nghin").style.background = '#999999';					if (idtaplenh == 0)		{			document.getElementById("tram").disabled  = false;					document.getElementById("tram").style.background = '#E4E4E4';					document.getElementById("chuc").disabled  = false;			document.getElementById("chuc").style.background = '#E4E4E4';			document.getElementById("donvi").disabled  = false;					document.getElementById("donvi").style.background = '#E4E4E4';						}		else		{			document.getElementById("tram").disabled  = true;					document.getElementById("tram").style.background = '#999999';					document.getElementById("chuc").disabled  = true;			document.getElementById("chuc").style.background = '#999999';			document.getElementById("donvi").disabled  = true;					document.getElementById("donvi").style.background = '#999999';						}	}		if (gameid == 3)	{		document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";				document.getElementById("van").disabled  = true;		document.getElementById("van").style.background = '#999999';				if (idtaplenh == 0)		{			document.getElementById("nghin").disabled  = false;			document.getElementById("nghin").style.background = '#E4E4E4';					document.getElementById("tram").disabled  = false;					document.getElementById("tram").style.background = '#E4E4E4';					document.getElementById("chuc").disabled  = false;			document.getElementById("chuc").style.background = '#E4E4E4';			document.getElementById("donvi").disabled  = false;					document.getElementById("donvi").style.background = '#E4E4E4';					}		else		{			document.getElementById("nghin").disabled  = true;			document.getElementById("nghin").style.background = '#999999';					document.getElementById("tram").disabled  = true;					document.getElementById("tram").style.background = '#999999';					document.getElementById("chuc").disabled  = true;			document.getElementById("chuc").style.background = '#999999';			document.getElementById("donvi").disabled  = true;					document.getElementById("donvi").style.background = '#999999';													}							}		if (gameid == 4)	{		document.getElementById("van").value = "";		document.getElementById("tram").value = "";				document.getElementById("nghin").value = "";		document.getElementById("chuc").value = "";		document.getElementById("donvi").value = "";							if (idtaplenh == 0)		{			document.getElementById("van").disabled  = false;			document.getElementById("van").style.background = '#E4E4E4';						document.getElementById("nghin").disabled  = false;			document.getElementById("nghin").style.background = '#E4E4E4';						document.getElementById("tram").disabled  = false;					document.getElementById("tram").style.background = '#E4E4E4';						document.getElementById("chuc").disabled  = false;			document.getElementById("chuc").style.background = '#E4E4E4';			document.getElementById("donvi").disabled  = false;					document.getElementById("donvi").style.background = '#E4E4E4';			}		else		{			document.getElementById("van").disabled  = true;			document.getElementById("van").style.background = '#999999';						document.getElementById("nghin").disabled  = true;			document.getElementById("nghin").style.background = '#999999';						document.getElementById("tram").disabled  = true;					document.getElementById("tram").style.background = '#999999';						document.getElementById("chuc").disabled  = true;			document.getElementById("chuc").style.background = '#999999';			document.getElementById("donvi").disabled  = true;					document.getElementById("donvi").style.background = '#999999';																}			}			
	return true;		
}function fillcmbgamechonmau(gameid){	var params="";	params = params + "at=loadgameid&gid1=" + gameid;				retrieveURLloadCMB("t_5b6db47c7e807c2953a3b62cd24bf4e7.php", params);			}function tuchonlttc(boxmenu) {	var gameid;	var chonmau;		//gameid = boxmenu[boxmenu.selectedIndex].value;	gameid = document.getElementById(boxmenu).value;	chonmau = document.getElementById("chonmau").value;		if (gameid == 0)	{		alert('Chưa chọn loại xổ số!');
		document.getElementById(boxmenu).focus(); 		return false;	}		if (chonmau >=1)	{	}	else	{		switch (gameid) {
		case "5": 					//Tu chon 2 cap so			var rd1 = Math.floor(Math.random()*10);			var rd2 = Math.floor(Math.random()*10);			var rd3 = Math.floor(Math.random()*10);			var rd4 = Math.floor(Math.random()*10);			document.getElementById("capso1").value = rd1 + '' + rd2;				document.getElementById("capso2").value =  rd3 + '' + rd4;						break;		case "6": 					//Tu chon 3 cap so			var rd1 = Math.floor(Math.random()*10);			var rd2 = Math.floor(Math.random()*10);			var rd3 = Math.floor(Math.random()*10);			var rd4 = Math.floor(Math.random()*10);			var rd5 = Math.floor(Math.random()*10);			var rd6 = Math.floor(Math.random()*10);					document.getElementById("capso1").value = rd1 + '' + rd2;				document.getElementById("capso2").value =  rd3 + '' + rd4;			document.getElementById("capso3").value =  rd5 + '' + rd6;					break;		case "7": 					//Tu chon 4 cap so			var rd1 = Math.floor(Math.random()*10);			var rd2 = Math.floor(Math.random()*10);			var rd3 = Math.floor(Math.random()*10);			var rd4 = Math.floor(Math.random()*10);			var rd5 = Math.floor(Math.random()*10);			var rd6 = Math.floor(Math.random()*10);			var rd7 = Math.floor(Math.random()*10);			var rd8 = Math.floor(Math.random()*10);					document.getElementById("capso1").value = rd1 + '' + rd2;				document.getElementById("capso2").value =  rd3 + '' + rd4;			document.getElementById("capso3").value =  rd5 + '' + rd6;			document.getElementById("capso4").value =  rd7 + '' + rd8;					break;				case "1": 			//Tu chon 2  so			var rd1 = Math.floor(Math.random()*10);			var rd2 = Math.floor(Math.random()*10);					document.getElementById("chuc").value = rd1;				document.getElementById("donvi").value =  rd2;						break;		case "2": 			//Tu chon 3  so			var rd1 = Math.floor(Math.random()*10);			var rd2 = Math.floor(Math.random()*10);			var rd3 = Math.floor(Math.random()*10);					document.getElementById("tram").value = rd3;			document.getElementById("chuc").value = rd1;				document.getElementById("donvi").value =  rd2;					break;		case "3": 			 			break;		case "4": 			//Tu chon 3  so			var rd1 = Math.floor(Math.random()*10);			var rd2 = Math.floor(Math.random()*10);			var rd3 = Math.floor(Math.random()*10);			var rd4 = Math.floor(Math.random()*10);			var rd5 = Math.floor(Math.random()*10);					document.getElementById("van").value = rd5;			document.getElementById("nghin").value = rd4;			document.getElementById("tram").value = rd3;			document.getElementById("chuc").value = rd1;				document.getElementById("donvi").value =  rd2;		 			break;				
		}			//switch (gameid)		}		//if (chonmau >=1)	}function tuchonthantai4() {	var rd1 = Math.floor(Math.random()*10);	var rd2 = Math.floor(Math.random()*10);	var rd3 = Math.floor(Math.random()*10);	var rd4 = Math.floor(Math.random()*10);	document.getElementById("thantai4").value = rd1 + '' + rd2 + '' + rd3 + '' + rd4;	}function tuchondt123() {	var rd1 = Math.floor(Math.random()*10);	var rd2 = Math.floor(Math.random()*10);	var rd3 = Math.floor(Math.random()*10);	var rd4 = Math.floor(Math.random()*10);	var rd5 = Math.floor(Math.random()*10);	var rd6 = Math.floor(Math.random()*10);		document.getElementById("boso1").value = rd1;	document.getElementById("boso2").value = rd2 + '' + rd3;	document.getElementById("boso3").value = rd4 + '' + rd5 + '' + rd6;	}function tuchondt636() {	var i = 0;	var rd1 = Math.floor(Math.random()*4);	var rd2 = Math.floor(Math.random()*10);	var rd3 = 0;	var rd4 = 0;	var rd5 = 0;	var rd6 = 0;	var rd7 = 0;	var rd8 = 0;	var rd9 = 0;	var rd10 = 0;	var rd11 = 0;	var rd12 = 0;		var so1 = '';	var so2 = '';	var so3 = '';	var so4 = '';	var so5 = '';	var so6 = '';		if ((rd1==0) && (rd2==0))	{		so1 = '1' + rd2;	}			else	{		if (rd1==3 && rd2>6)		{			so1 = '36';		}		else		{			so1 = rd1 + '' + rd2;		}	}			while (i==0)
	{
		rd3 = Math.floor(Math.random()*4);		rd4 = Math.floor(Math.random()*10);		if ((rd3==0) && (rd4==0))		{		}		else		{			if (rd3==3 && rd4>6)			{				so2 = '36';			}			else			{				so2 = rd3 + '' + rd4;				if (so1 != so2)			{				i = 1;			}					}					}
	}		i = 0;	while (i==0)
	{
		rd5 = Math.floor(Math.random()*4);		rd6 = Math.floor(Math.random()*10);				if ((rd5==0) && (rd6==0))		{		}		else		{			if (rd5==3 && rd6>6)			{				so3 = '36';			}			else			{				so3 = rd5 + '' + rd6;				if ((so1 != so2) && (so1 != so3) && (so2 != so3))				{					i = 1;				}			}		}		
	}	i = 0;	while (i==0)
	{
		rd7 = Math.floor(Math.random()*4);		rd8 = Math.floor(Math.random()*10);			if ((rd7==0) && (rd8==0))		{		}		else		{			if (rd7==3 && rd8>6)			{				so4 = '36';			}			else			{				so4 = rd7 + '' + rd8;				if ((so1 != so2) && (so1 != so3) && (so1 != so4) && (so2 != so3) && (so2 != so4) && (so3 != so4))				{					i = 1;				}					}		}		
	}	i = 0;	while (i==0)
	{
		rd9 = Math.floor(Math.random()*4);		rd10 = Math.floor(Math.random()*10);			if ((rd9==0) && (rd10==0))		{		}		else		{			if (rd9==3 && rd10>6)			{				so5 = '36';			}			else			{				so5 = rd9 + '' + rd10;				if ((so1 != so2) && (so1 != so3) && (so1 != so4) && (so2 != so3) && (so2 != so4) && (so3 != so4) && (so1 != so5) && (so2 != so5) && (so3 != so5) && (so4 != so5))				{					i = 1;				}			}		}		
	}		i = 0;	while (i==0)
	{
		rd11 = Math.floor(Math.random()*4);		rd12 = Math.floor(Math.random()*10);			if ((rd11==0) && (rd12==0))		{		}		else		{			if (rd11==3 && rd12>6)			{				so6 = '36';			}			else			{				so6 = rd11 + '' + rd12;				if ((so1 != so2) && (so1 != so3) && (so1 != so4) && (so2 != so3) && (so2 != so4) && (so3 != so4) && (so1 != so5) && (so2 != so5) && (so3 != so5) && (so4 != so5) && (so1 != so6) && (so2 != so6) && (so3 != so6) && (so4 != so6) && (so5 != so6))				{					i = 1;				}			}		}		
	}		document.getElementById("so1").value = so1;	document.getElementById("so2").value = so2;	document.getElementById("so3").value = so3;	document.getElementById("so4").value = so4;	document.getElementById("so5").value = so5;	document.getElementById("so6").value = so6;	}
function CheckAll() {

    if (document.getElementById("ChkAll").checked)
    {
        document.getElementById("BtOK").disabled  = true;
        document.getElementById("txtPageSize").value =parseInt( LiveStockSecurity.length);
        pageSize = parseInt( LiveStockSecurity.length);
        SetListChkBox(true);
        document.getElementById("ChkDefault").checked = false;
        ShowNextInterval();
    } 
    else
    {
        SetListChkBox(false);
        document.getElementById("BtOK").disabled  = false;
    }
    
}

function SetListChkBox(value)
{
    var numberChecked=0, i;
    var ChkListBox = new Array();
    
    ChkListBox=document.forms["form1"].ChkStock;
    for (i=0; i<ChkListBox.length ;i++)
    {
        ChkListBox[i].checked=value;
    }
 
    
}

function mouseOverAll(kieu){
	kieu.style.textDecoration='underline';
}



function mouseOverAllTitle(kieu){
	kieu.style.textDecoration='underline';
}

function mouseOverOutTitle(kieu){
	kieu.style.color='006699';
	kieu.style.textDecoration='none';
}



function mouseOverOut(kieu){	kieu.style.color='black';
	kieu.style.textDecoration='none';
}
function mouseOverAll1(kieu){
	kieu.style.color='red';
	kieu.style.textDecoration='underline';
}function mouseOverOutTab(kieu){	kieu.style.color='#000000';
	kieu.style.textDecoration='none';
}
function mouseOverTab(kieu){
	kieu.style.color='#CC3300';
	kieu.style.textDecoration='underline';
}

function mouseOverOut1(kieu){
	kieu.style.color='006699';
	kieu.style.textDecoration='none';
}
function mouseOverBtn(){	//document.getElementById("idbtn").style.background = 'url("images/bt_over.jpg")';	document.getElementById("idbtn").style.color = '#800000';
}function mouseOverOutBtn(){	//document.getElementById("idbtn").style.background = 'url("images/bt_normal.jpg")';	document.getElementById("idbtn").style.color = '#000000';	
}function mouseOverBtnThis(btn1){	//document.getElementById("idbtn").style.background = 'url("images/bt_over.jpg")';	document.getElementById(btn1).style.color = '#800000';
}function mouseOverOutBtnThis(btn1){	//document.getElementById("idbtn").style.background = 'url("images/bt_normal.jpg")';	document.getElementById(btn1).style.color = '#000000';	
}function mouseOverBtnObj(idenobj){	//document.getElementById("idbtn").style.background = 'url("images/bt_over.jpg")';	document.getElementById(idenobj).style.color = '#800000';
}function mouseOverOutBtnObj(idenobj){	//document.getElementById("idbtn").style.background = 'url("images/bt_normal.jpg")';	document.getElementById(idenobj).style.color = '#000000';	
}function mouseOverBtn1(){	//document.getElementById("idbtn1").style.background = 'url("images/bt_over.jpg")';	document.getElementById("idbtn1").style.color = '#800000';
}function mouseOverOutBtn1(){	//document.getElementById("idbtn1").style.background = 'url("images/bt_normal.jpg")';	document.getElementById("idbtn1").style.color = '#000000';	
}
function mouseOverBgr(kieu){
	kieu.style.color='ffffff'; 
	kieu.style.textDecoration='underline';
	kieu.style.backgroundColor='AA0000';
}

function mouseOverOutBgr(kieu){
	kieu.style.color='ffffff'; 
	kieu.style.textDecoration='none';
	kieu.style.backgroundColor='930000';
}


function SetDefaultSettings() {

    if (document.getElementById("ChkDefault").checked)
    {
        document.getElementById("BtOK").disabled  = false;
        document.getElementById("txtPageSize").value =20;
        pageSize = 20;
        SetListChkBox(false);
        document.getElementById("ChkAll").checked = false;
        
        ShowNextInterval();
      
    } 

    
}


