if (navigator.cookieEnabled == 0) {
  alert("Bạn chưa bật Cookies do đó một số chức năng sẽ không hoạt động!");
}
function save_cookieline(cookie_name, cookie_value){
	document.cookie = cookie_name + "=" + cookie_value;
}

function getCookieline(c_name){
	if(document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if(c_start!=-1){ 
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return "";
}
function CheckNumber(number)
{
	var pattern = "0123456789";
	var len = number.value.length;
	if (len != 0)
	{
		var index = 0;
		
		while ((index < len) && (len != 0))
			if (pattern.indexOf(number.value.charAt(index)) == -1)
			{
				if (index == len-1)
					number.value = number.value.substring(0, len-1);
				else if (index == 0)
					 	number.value = number.value.substring(1, len);
					 else number.value = number.value.substring(0, index)+number.value.substring(index+1, len);
				index = 0;
				len = number.value.length;
			}
			else index++;
	}
}
var _disable_empty_list=false;
var _hide_empty_list=false;

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}
function setPaymentInfo(isChecked)
{
	with (window.document.form1) {
		if (isChecked) {
			name2.value  = name.value;
			gioitinh2.value  = gioitinh.value;
			add2.value  = add.value;
			tinhthanh2.value  = tinhthanh.value;
			tel2.value  = tel.value;
			email2.value  = email.value;
						
			name2.readOnly  = true;
			gioitinh2.readOnly  = true;
			add2.readOnly  = true;
			tinhthanh2.readOnly  = true;
			tel2.readOnly  = true;
			email2.readOnly  = true;
			
		} else {
			name2.readOnly  = false;
			gioitinh2.readOnly  = false;
			add2.readOnly  = false;
			tinhthanh2.readOnly  = false;
			tel2.readOnly  = false;
			email2.readOnly  = false;
					
		}
	}
}
//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
//document.write(unescape("%3Cscript src='" + gaJsHost + "maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA4cZL1rxsNgaxEmoh7NERzRScJchyB25_4LsMjemUS7-69SBRCRSgt3nAXCMREW48_1XepzTiS2b6vQ' type='text/javascript'%3E%3C/script%3E"));
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA4cZL1rxsNgaxEmoh7NERzRSOv4qyBmY44Stjgn1iCUi-ulpV6BTaWDpvPyc6z43VD0tfuXYW_C63Ag' type='text/javascript'%3E%3C/script%3E"));
// This function formats numbers by adding commas
function numberFormat(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;
}


