var isnDays=new Array("Ch&#7911; nh&#7853;t","Th&#7913; hai","Th&#7913; ba","Th&#7913; t&#432;","Th&#7913; n&#259;m","Th&#7913; s&#225;u","Th&#7913; b&#7843;y")   
var isnMonths=new Array("th&#225;ng 1","th&#225;ng 2","th&#225;ng 3","th&#225;ng 4","th&#225;ng 5","th&#225;ng 6","th&#225;ng 7","th&#225;ng 8","th&#225;ng 9","th&#225;ng 10","th&#225;ng 11","th&#225;ng 12") 
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
clckh=""+((hrs>12)?hrs-12:hrs); 
clckm=((min<10)?"0":"")+min;
clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"p.m.":"a.m.";

function ngaythang(){
if (navigator.userAgent.indexOf(" MSIE") != -1){
document.write("<font color=lime face=arial>"
+isnDays[today.getDay()]+"</font>"+" Ng&#224;y  "+today.getDate()+" "+ isnMonths [today.getMonth()] + " n&#259;m "
+today.getYear());}
else{
var others=today.getYear()+1900
document.write("<font color=#00ff00 face=arial>"
+isnDays[today.getDay()]+"</font> "+" Ng&#224;y "+today.getDate()+" "+ isnMonths [today.getMonth()] + " n&#259;m "
+others);}
}

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function Check_user(theForm)
{
if (theForm.from_name.value== "")
  {
    alert("Xin vui long nhap ten nguoi goi");
	theForm.from_name.focus();
	return false;
  }  
  if (theForm.address.value== "")
  {
    alert("Xin vui long nhap dia chi nguoi goi");
	theForm.address.focus();
	return false;
  }  
   if (!document.layer) //ie support only
  {
  
   pattern = /^[^@^\\^'^"^\/]+@[^@^\\^'^"^\/]+\.[^@^\\^'^"^\/]+/i   //regular exp for email pattern matching
  
    if ( !theForm.from_email.value.match(pattern) )
    {
    alert(" Dia chi email  khong hop le\r\n Vui Long Nhap Lai !!! " ) ;
    theForm.from_email.focus();
    return (false);
    }  
  }
}

function kiemtra_capnhat(){
if (document.AddFrm.ProductName.value == "" ){
alert("Ban chua nhap ten san pham can cap nhat");
document.AddFrm.ProductName.focus();
return false
}
else if (document.AddFrm.Desc.value == "" ){
alert("Ban chua nhap mo ta cho san pham");
document.AddFrm.Desc.focus();
return false
}
//else if (document.AddFrm.CellPrice.value == "" ){
//alert("Ban chua nhap gia cua mobile");
//document.AddFrm.CellPrice.focus();
//return false
//}
else if (document.AddFrm.ProcatPic.value == "" ){
alert("Ban chua chon hinh anh cho san pham");
document.AddFrm.ProcatPic.focus();
return false
}
}
function kiemtra_capnhat1(){
if (document.AddFrm.ProductName.value == "" ){
alert("Ban chua nhap ten san pham ");
document.AddFrm.ProductName.focus();
return false;
}
else if (document.AddFrm.Desc.value == "" ){
alert("Ban chua nhap mo ta cho san pham");
document.AddFrm.Desc.focus();
return false;
}
}

function kiemtra_capnhat2(){
if (document.AddFrm.ProductName.value == "" ){
alert("Ban chua nhap ten san pham ");
document.AddFrm.ProductName.focus();
return false;
}
else if (document.AddFrm.Desc.value == "" ){
alert("Ban chua nhap mo ta cho san pham");
document.AddFrm.Desc.focus();
return false;
}
}
function kiemtra_capnhat3(){
if (document.AddFrm.Desc.value == "" ){
alert("Ban chua nhap chu thich ");
document.AddFrm.Desc.focus();
return false;
}
else if (document.AddFrm.Datasheet.value == "" ){
alert("Ban chua chon file Datasheet / App Note");
document.AddFrm.Datasheet.focus();
return false;
}
}
function donothing(){}
function kiemtra_timkiem(){
if (document.search.cell.value == "" ){
alert("Ban chua nhap ten mobile can tim.(VD : T100)");
document.search.cell.focus();
return false
}
}

function delcell(i,j)
{
if (confirm ("Ban co muon xoa san pham nay ?"))
{window.location='action_script.asp?action=delcell&ID='+i+'&kid='+j}
//return false;
}

function deldata(i,j)
{
if (confirm ("Ban co muon xoa datasheet nay ?"))
{window.location='action_script.asp?action=deldata&ID='+i+'&Proid='+j}
//return false;
}

function delnote(i,j)
{
if (confirm ("Ban co muon xoa App Note nay ?"))
{window.location='action_script.asp?action=delnote&ID='+i+'&Proid='+j}
//return false;
}

function delpros(i,j)
{
if (confirm ("Ban co muon xoa san pham con nay ?"))
{window.location='action_script.asp?action=delpros&ID='+i+'&Proid='+j}
//return false;
}


function delpro(i)
{
if (confirm ("Ban co muon xoa san pham nay ?"))
{window.location='action_script.asp?action=delpro&ID='+i}
//return false;
}
function kiemtra_news(){
if (document.AddNews.news_title.value == "" ){
alert("Ban chua nhap tieu de");
document.AddNews.news_title.focus();
return false
}
else if (document.AddNews.Content.value == "" ){
alert("Ban chua nhap noi dung tin tuc moi");
document.AddNews.Content.focus();
return false
}
}
function kiemtra_kind(){
if (document.Addcell.newcell.value == "" ){
alert("Ban chua nhap loai moblie");
document.Addcell.newcell.focus();
return false
}}

function kiemtra_mk(){
if (document.Login.username.value == "" ){
alert("Xin vui long nhap mat khau");
document.Login.username.focus();
return false;}

if (document.Login.username.value!=document.Login.pwd.value ){
alert("Mat khau khong trung nhau.\n Xin vui long nhap lai");
document.Login.pwd.focus();
return false
}}

function Check_user1()
{
if (document.contact.from_name.value== "")
  {
    alert("Please enter your name");
	document.contact.from_name.focus();
	return false;
  }  
  if (document.contact.job.value== "")
  {
    alert("Please enter your title");
	document.contact.job.focus();
	return false;
  }  
  if (document.contact.company.value== "")
  {
    alert("Please enter your company");
	document.contact.company.focus();
	return false;
  }  
  
  if (document.contact.address.value== "")
  {
    alert("Please enter your address");
	document.contact.address.focus();
	return false;
  }  
  
  if (document.contact.city.value== "")
  {
    alert("Please enter your city");
	document.contact.city.focus();
	return false;
  }  
  if (document.contact.country.value== "")
  {
    alert("Please enter your country");
	document.contact.country.focus();
	return false;
  }  
   if (!document.layer) //ie support only
  {
  
   pattern = /^[^@^\\^'^"^\/]+@[^@^\\^'^"^\/]+\.[^@^\\^'^"^\/]+/i   //regular exp for email pattern matching
  
    if ( !document.contact.from_email.value.match(pattern) )
    {
    alert(" Email address is invalid \r\n Please re-enter !!! " ) ;
    document.contact.from_email.focus();
    return (false);
    }  
  }
}


