// JavaScript Document

//Made by 1st JavaScript Editor
//http://www.yaldex.com
//Come and get more (free) products
function showdate(){

    var fifteenth=new Date();
    var sixteenth=fifteenth.getFullYear();
    var seventeenth=fifteenth.getDay();
    var month=fifteenth.getMonth();
    var eighteenth=fifteenth.getDate();
    if (eighteenth<10)
        eighteenth='0'+eighteenth;
        
    var first2=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&aacute;u','Th&#7913; B&#7843;y');
    var second2=new Array('Th&aacute;ng Gi&ecirc;ng','Th&aacute;ng Hai','Th&aacute;ng Ba','Th&aacute;ng T&#432;','Th&aacute;ng N&#259;m','Th&aacute;ng S&aacute;u','Th&aacute;ng B&#7843;y','Th&aacute;ng T&aacute;m','Th&aacute;ng Ch&iacute;n','Th&aacute;ng M&#432;&#7901;i','Th&aacute;ng M&#432;&#7901;i M&#7897;t','Th&aacute;ng Ch&#7841;p');
    
    var isam = 'am';
    var curr_hour = fifteenth.getHours();
    if(curr_hour > 12){
        curr_hour -= 12;
        isam = 'pm';
    }
    if(curr_hour == 0){
        curr_hour = 12;
        isam = 'pm'
    }
    curr_hour = (curr_hour < 10) ? '0' + curr_hour : curr_hour;
    var curr_min = fifteenth.getMinutes();
    curr_min = (curr_min < 10) ? '0' + curr_min : curr_min;
    var curr_sec = fifteenth.getSeconds();
    curr_sec = (curr_sec < 10) ? '0' + curr_sec : curr_sec;
    
    var place = document.getElementById('search_date');
    if(place != null)
        place.innerHTML = first2[seventeenth]+', '+eighteenth+' '+second2[month]+', '+sixteenth + ' - ' + curr_hour + ':' + curr_min + ':' + curr_sec + ' ' + isam;
    setTimeout(showdate,1000);
}
window.onload = showdate;
