function ShowTimevn(){
	var dt = new Date();
	var strMonth = new Array("01","02","03","04","05","06","07","08","09","10","11","12"); 
	var strDay = new Array("Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"); 
	var date = strDay[dt.getDay()] + ", ";
	var years = dt.getYear();
	var days=dt.getDate();
	if (years<1900) years += 1900;
	if (days<10)
		date += "0" + dt.getDate() + "/" + strMonth[dt.getMonth()] + "/" + years;
	else
		date += "" + dt.getDate() + "/" + strMonth[dt.getMonth()] + "/" + years;
	var phut=dt.getMinutes();
	if(phut<10)
		phut="0"+phut;
	if(document.getElementById("timer")!=null)
		document.getElementById("timer").innerHTML=date+", "+dt.getHours()+":"+phut+":"+dt.getSeconds()+" GMT+7";
}

function DetectImageSize(picPath,picTitle)
{
    
  image_1 = new Image();
  image_1.src = picPath;
  var picName=image_1;
  picURL=picName.src;
  newWindow=window.open(picURL,'newWin','scrollbars=yes,toolbar=yes,width='+picName.width+',height='+picName.height);
  newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body oncontextmenu="return false;" background="'+picURL+'"><\/body><\/html>');
  newWindow.resizeBy(picName.width-newWindow.document.body.clientWidth,picName.height-newWindow.document.body.clientHeight);
  newWindow.focus();
} 

function isEmail(email) {
	var pattern = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.0123456789@~";
	var theStr = new String(email)
	var index = theStr.indexOf("@");

	for (var a=0; a<pattern.length; a++) {
		if (pattern.indexOf(email.charAt(a),0) == -1) return false;
	}
	if (theStr.indexOf(" ",0) != -1) return false;
	if (index > 0) {
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1)) return true;
	}
	return false;
}
///////////////////////////////////////////////////////////////////////////////
// Flash Template
///////////////////////////////////////////////////////////////////////////////
function insert_flash( _url , _width , _height )
{
    var writeStr =  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + _width + '" height="' + _height + '">'
                  + '<param name="movie" value="' + _url + '">'
                  + '<param name="quality" value="high">'
                  + '<param name="wmode" value="transparent">'
                  + '<embed src="' + _url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + _width + '" height="' + _height + '" wmode="transparent"></embed>'
                  + '</object>';

    document.write( writeStr );
}


