﻿// JScript File
function Open_PopUp(url,displayname,width,height,left,top,resizable,scrollbars)
{
     window.open(url,displayname, 'width='+width+',height='+height+',left='+left+',top='+top+',resizable='+resizable+',scrollbars='+scrollbars);
}
function Open_PopUp_DatCauHoi(url)
{
     var width =460;
     var height =400;
     var left = window.screen.availWidth/2 - width/2;
     var top = window.screen.availHeight/2 - height/2;
     var resizable = 'no';
     var scrollbars = 'no'; 
     window.open(url,'', 'width='+width+',height='+height+',left='+left+',top='+top+',resizable='+resizable+',scrollbars='+scrollbars);
}
function Open_PopUp_Size(url, width, height)
{
    
     var left = window.screen.availWidth/2 - width/2;
     var top = window.screen.availHeight/2 - height/2;
     var resizable = 'no';
     var scrollbars = 'no'; 
     window.open(url,'', 'width='+width+',height='+height+',left='+left+',top='+top+',resizable='+resizable+',scrollbars='+scrollbars);
}
function Open_PopUp_UploadPicture(url)
{
     var width =440;
     var height =300;
     var left = window.screen.availWidth/2 - width/2;
     var top = window.screen.availHeight/2 - height/2;
     var resizable = 'no';
     var scrollbars = 'no'; 
     window.open(url,'', 'width='+width+',height='+height+',left='+left+',top='+top+',resizable='+resizable+',scrollbars='+scrollbars);
}
//-------------------------------------------//  */
function changeto(obj,strClass){
	if(strClass!=""){
		obj.className = strClass;
	}
	obj.style.cursor = 'hand';
}
//-------------------------------------------//
function dropCategory(obj){
	if(obj.className == "on"){
		obj.className = "off";
		document.frmTemp.objdrop.value = "";	
	}
	else{
		obj.className = "on";
		if(document.frmTemp.objdrop.value != ""){
			identity=document.getElementById(document.frmTemp.objdrop.value);
			identity.className = "off";
		}
		document.frmTemp.objdrop.value = obj.id;
	}
}

function startclock()
	{
		var curTime=new Date();
		var nhours=curTime.getHours();
		var nmins=curTime.getMinutes();
		var nsecn=curTime.getSeconds();
		var nday=curTime.getDay();
		var nmonth=curTime.getMonth();
		var ntoday=curTime.getDate();
		var nyear=curTime.getYear();
		var AMorPM=" ";

		if (nhours>=12)
			AMorPM="P.M.";
		else
			AMorPM="A.M.";

		if (nhours>=13)
			nhours-=12;

		if (nhours==0)
			nhours=12;

		if (nsecn<10)
			nsecn="0"+nsecn;

		if (nmins<10)
			nmins="0"+nmins;

		if (nday==0)
			nday="Ch&#7911; nh&#7853;t";
		if (nday==1)
			nday="Th&#7913; hai"; 
		if (nday==2)
			nday="Th&#7913; ba"; 
		if (nday==3)
			nday="Th&#7913; t&#432;";
		if (nday==4)
			nday="Th&#7913; n&#259;m";
		if (nday==5)
			nday="Th&#7913; s&#225;u";
		if (nday==6)
			nday="Th&#7913; b&#7843;y";


		nmonth+=1;

		if (nyear<=99)
			nyear= "19"+nyear;

		if ((nyear>99) && (nyear<2000))
			nyear+=1900;
		var d;
		d= document.getElementById("theClock");
		
		d.innerHTML=nday+" " + ntoday +"/" + nmonth +"/"+nyear;

		setTimeout('startclock()',1000);

	} 
