function swf(src,w,h){
	var html = '';
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" id="main" align="middle">';
	html += '<param name="allowScriptAccess" value="sameDomain">';
	html += '<param name="movie" value="' + src + '">';
	html += '<param name="quality" value="high">';
	html += '<param name="salign" value="0">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="bgcolor" value="">';
	html += '<embed wmode="transparent" src="' + src + '" quality="high" salign="0" bgcolor="#ffffff" width="' + w + '" height="' + h + '" name="main" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	html += '</object>';
	document.write(html);
}

function menuswf(src,w,h){
	var html = '';
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" id="product" align="middle">';
	html += '<param name="allowScriptAccess" value="sameDomain">';
	html += '<param name="movie" value="' + src + '">';
	html += '<param name="quality" value="high">';
	html += '<param name="salign" value="l">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<embed src="' + src + '" quality="high" salign="l" bgcolor="#ffffff" width="' + w + '" height="' + h + '" name="product" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	html += '</object>';
	document.write(html);
}
function setAsHomePage(i)
{	
	if (document.all) {
		i.style.behavior='url(#default#homepage)';
		i.setHomePage('http://sandoanhnghiep.com.vn');
	}
}
function addCommas(nStr)
{
	nStr += ''; x = nStr.split('.');	x1 = x[0];	x2 = ""; x2 = x.length > 1 ? '.' + x[1] : '';	var rgx = /(\d+)(\d{3})/;	while (rgx.test(x1)) {		x1 = x1.replace(rgx, '$1' + ',' + '$2');	}	return x1 + x2;
}
function ChangeImg(urlImg,w)
{
    document.getElementById("divImg").innerHTML = "<img class='imgP' src='" + urlImg + "' width='"+ w +"' onclick=\"LargerPicture('" + urlImg + "')\" alt='Phóng to ảnh'>";
} 
function doClick(buttonName,e)
{
   var key;
   if(window.event)
        key = window.event.keyCode;     //IE
   if(e.which)
        key = e.which;     //firefox   
   if (key == 13)
   {
        //Get the button the user wants to have clicked
        var btn = document.getElementById(buttonName);
        if (btn != null)
        { //If we find the button click it
            //alert(key);
            btn.click();
            event.keyCode = 0;
        }
   }

}
function Button_Onclick(txt , objid)
{
    var obj = document.getElementById(objid); 
    obj.click();
    window.event.returnValue = false;
}
function LargerPicture(picName)
{
    window.open('viewImage.aspx?'+ picName,"",'resizable=1,HEIGHT=200,WIDTH=200,top=' + ((screen.height - 500)/2) + ',left=' + ((screen.width - 684)/2));
}
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ủ nhật";
		if (nday==1)
			nday="Thứ hai"; 
		if (nday==2)
			nday="Thứ ba"; 
		if (nday==3)
			nday="Thứ tư";
		if (nday==4)
			nday="Thứ năm";
		if (nday==5)
			nday="Thứ sáu";
		if (nday==6)
			nday="Thứ bả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 + " " + nhours+":"+nmins+":"+nsecn + " " + AMorPM;
		setTimeout('startclock()',1000);

} 
function PopupWin(url,w,h)
{
    window.open(url, '_blank', 'resizable=yes,width='+w+',height='+h+',left=270,top=80,scrollbars=0,menubar=0,status=0,derectories=0,toolbar=0,location=0,resizable=0');
}

