// JavaScript Document
    function todaysDate() {
    
      var theMonths = new Array("tháng 1", "tháng 2", "tháng 3", "tháng 4", "tháng 5", "tháng 6", "tháng 7", "tháng 8", "tháng 9", "tháng 10", "tháng 11", "tháng 12");
      var day_thu = new Array("chủ nhật","thứ hai","thứ ba","thứ tư","thứ năm","thứ sáu","thứ bảy");
      var theDate = new Date();
      var year=theDate.getYear();
      var thu =theDate.getDay();
      var gio =theDate.getHours();
      var phut =theDate.getMinutes();
      phut = phut + "";
      if (phut.length == 1)
      {
        phut = "0" + phut;
      }
      if (year < 1000)
      year+=1900
      
      if (gio<12)
      {
        var formattedDate = gio + "." + phut + " sáng, " + day_thu[thu] + ", ngày " + theDate.getDate() + " " + theMonths[theDate.getMonth()] + " năm " + year;
      }
      else
      {
        var formattedDate = gio + "." + phut + " chiều, " + day_thu[thu] + ", ngày " + theDate.getDate() + " " + theMonths[theDate.getMonth()] + " năm " + year;
      }
      document.write(formattedDate);
    
    }
    
    function thoitiet() {
      var t = new Date();
      var t4 = t.getHours();
      var tt = new Array("28", "28.5", "29", "29.5", "30", "30.5", "31", "31.5", "32");
      var status = new Array ("<img src='./images/sun.jpg' width='15' height='15' border='0' /> ", "<img src='./images/sun_cloud.jpg' width='15' height='15' border='0' /> ");
      var r = Math.random();
      var N = Math.round(r*8);
      var S = Math.round(r*1);
      if (t4<17)
      {
        x= "&nbsp;&nbsp;&nbsp;" + status[S] + "TP.Hồ Chí Minh " + tt[N] + "<sup>o</sup>C";
      }
      else
      {
        x= "&nbsp;&nbsp;&nbsp;" + "<img src='./images/moon.jpg' width='15' height='15' border='0' /> " + "TP.Hồ Chí Minh " + tt[N] + "<sup>o</sup>C";
      }
      
      document.write(x);
    }
    
    function todaysDate_e() {
    
      var theMonths = new Array("January", "Febuary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
      var day_thu = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
      var theDate = new Date();
      var year=theDate.getYear();
      var thu =theDate.getDay();
      var gio =theDate.getHours();
      var phut =theDate.getMinutes();
      phut = phut + "";
      if (phut.length == 1)
      {
        phut = "0" + phut;
      }
      if (year < 1000)
      year+=1900
      
      if (gio<12)
      {
        var formattedDate = gio + "." + phut + " am, " + day_thu[thu] + " " + theMonths[theDate.getMonth()] + " " + theDate.getDate() + ", " + year;
      }
      else
      {
        var formattedDate = gio + "." + phut + " pm, " + day_thu[thu] + " " + theMonths[theDate.getMonth()] + " " + theDate.getDate() + ", " + year;
      }
      document.write(formattedDate);
    
    }
    
    function thoitiet_e() {
      var t = new Date();
      var t4 = t.getHours();
      var tt = new Array("28", "28.5", "29", "29.5", "30", "30.5", "31", "31.5", "32");
      var status = new Array ("<img src='./images/sun.jpg' width='15' height='15' border='0' /> ", "<img src='./images/sun_cloud.jpg' width='15' height='15' border='0' /> ");
      var r = Math.random();
      var N = Math.round(r*8);
      var S = Math.round(r*1);
      if (t4<17)
      {
        x= "-&nbsp;&nbsp;&nbsp;" + status[S] + "Ho Chi Minh City " + tt[N] + "<sup>o</sup>C";
      }
      else
      {
        x= "-&nbsp;&nbsp;&nbsp;" + "<img src='./images/moon.jpg' width='15' height='15' border='0' /> " + "Ho Chi Minh City " + tt[N] + "<sup>o</sup>C";
      }
      
      document.write(x);
    }

      function SubmitVote(sform, saction)
      {
      	var form = sform;
      	var sheight = (10 * 40) + 80;
      	if (sheight < 250){
      		sheight = 250;
      	}
      	//open('', sform.name, 'scrollbars=yes,resizeable=no,locationbar=no,width=850,height='+sheight+',left='.concat((screen.width - 820)/2).concat(',top=').concat((screen.height - 450)/2));
      	alert ("Cảm ơn bạn đã tham gia bình chọn");
      	//sform.faction.value = saction;
      	sform.action = 'index.php?c=survey&m=doSurvey';
      	sform.submit();
      }
      
    function CountVisit(a)
    {
      //var r = Math.random();
      //var N = 4;
      //var num = Math.round(r*N)+30;
      var num = a + 30;
      //var num = Math.round(r*N) + a + 30;
      document.write(num);
    }
