//
//==== Check and create flash object
function MM_CheckPlugin(plgIn, theFlash, theJPG, autoGo, pWidth, pHeight) { 
	var ok=false; document.MM_returnValue = false;
	with (navigator) if (appName.indexOf('Microsoft')==-1) ok=(plugins && plugins[plgIn]);
	else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
	if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
	else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
	else ok=false; }
	if (!ok)
	{
		document.write("<img src='_%20+%20theJPG%20+%20_.html' width=" + pWidth + " height=" + pHeight + ">");
	} else 
	{
		document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0' width=" + pWidth + " height=" + pHeight + "><param name=movie value='"+ theFlash + "'><param name=quality value=high>");
		document.write("<embed src='_%20+%20theFlash%20+%20_.html' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=" + pWidth + " height=" + pHeight + "></embed></object>");
	}
}

//
//==== change image on mouse over event
function mOver(imageName){
	 if (document.images) {
	document[imageName].src =eval(imageName + "Over.src");
	}
}

//
//==== change image on mouse out event
function mOut(imageName) {
	 if (document.images) {
	document[imageName].src =eval(imageName + "Out.src");
	}
}

//
//==== change other image on mouse over event
function bsOver(imageName){
	 if (document.images) {
	document.bs.src =eval(imageName + "Over.src");
	}
}

//
//==== change image on mouse out event
function bsOut(imageName) {
	 if (document.images) {
	document.bs.src =eval(imageName + "Out.src");
	}
}

//
//==== chane URL
function Redirect()
{
	top.location.href="/index.html";
}

//
//==== change URL with delay
function RedirectWithDelay()
{
	window.setTimeout("Redirect();", 5000);
}

//
//==== animate title bar initilize
function AniTitleBar() {
//	var it=0
	var bText=document.title
//	var bDelayChar=5
	var bLength=bText.length+10
	TypeTitleBar(0, bText, bLength)
}

//
//==== type new title bar
function TypeTitleBar(it, bText, bLength){
	if (it<=bLength){
		document.title=bText.substring(0,it)
		it++
		setTimeout("TypeTitleBar('"+it+"', '"+bText+"', "+bLength+")",500)
	}
	else{
		it=0
		TypeTitleBar(0, bText, bLength)
//		return
	}
}

function ShowLastModify(theDate, theLanguage)
{
	if ( theLanguage == 1)
	{
		// THAI
		theMonth = new Array ("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฏาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม");
		document.write (" ปรับปรุงล่าสุด :  ", Math.abs(theDate.substring(3,5)), " ", theMonth[Math.abs(theDate.substring(0,2))-1] , " ", Math.abs(theDate.substring(6,11)) + 543);
	}else	{
		// ENG
		theMonth = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
		document.write (" Last modified :  ", theMonth[Math.abs(theDate.substring(0,2))-1] , " ", Math.abs(theDate.substring(3,5)), ", ",  Math.abs(theDate.substring(6,11)) );
	}
}

AniTitleBar()
