<!--
var yourwords = "ยินดีต้อนรับเข้าสู่เว็บไซต์ของเราครับ";
var speed = 250;
var control = 1;
function flash()
{
  if (control == 1)
    {
      window.status=yourwords;
      control=0;
    }  
  else
    {
      window.status="";
      control=1;
    }
  setTimeout("flash();",speed);
}

var rate = 20; // Increase amount(The degree of the transmutation)
var obj; // The object which event occured in
var act = 0; // Flag during the action
var elmH = 0; // Hue
var elmS = 128; // Saturation
var elmV = 255; // Value
var clrOrg; // A color before the change
var TimerID; // Timer ID
if (navigator.appName.indexOf("Microsoft",0) != -1 && parseInt(navigator.appVersion) >= 4) {
Browser = true;
} else {
Browser = false;
}
if (Browser) {
document.onmouseover = doRainbowAnchor;
document.onmouseout = stopRainbowAnchor;
}
function doRainbow()
{
if (Browser && act != 1) {
act = 1;
obj = event.srcElement;
clrOrg = obj.style.color;
TimerID = setInterval("ChangeColor()",100);
}
}
function stopRainbow()
{
if (Browser && act != 0) {
obj.style.color = clrOrg;
clearInterval(TimerID);
act = 0;
}
}
function doRainbowAnchor()
{
if (Browser && act != 1) {
obj = event.srcElement;
while (obj.tagName != 'A' && obj.tagName != 'BODY') {
obj = obj.parentElement;
if (obj.tagName == 'A' || obj.tagName == 'BODY')
break;
}
if (obj.tagName == 'A' && obj.href != '') {
act = 1;
clrOrg = obj.style.color;
TimerID = setInterval("ChangeColor()",100);
}
}
}
function stopRainbowAnchor()
{
if (Browser && act != 0) {
if (obj.tagName == 'A') {
obj.style.color = clrOrg;
clearInterval(TimerID);
act = 0;
}
}
}
function ChangeColor()
{
obj.style.color = makeColor();
}
function makeColor()
{
if (elmS == 0) {
elmR = elmV; elmG = elmV; elmB = elmV;
}
else {
t1 = elmV;
t2 = (255 - elmS) * elmV / 255;
t3 = elmH % 60;
t3 = (t1 - t2) * t3 / 60;
if (elmH < 60) {
elmR = t1; elmB = t2; elmG = t2 + t3;
}
else if (elmH < 120) {
elmG = t1; elmB = t2; elmR = t1 - t3;
}
else if (elmH < 180) {
elmG = t1; elmR = t2; elmB = t2 + t3;
}
else if (elmH < 240) {
elmB = t1; elmR = t2; elmG = t1 - t3;
}
else if (elmH < 300) {
elmB = t1; elmG = t2; elmR = t2 + t3;
}
else if (elmH < 360) {
elmR = t1; elmG = t2; elmB = t1 - t3;
}
else {
elmR = 0; elmG = 0; elmB = 0;
}
}
elmR = Math.floor(elmR);
elmG = Math.floor(elmG);
elmB = Math.floor(elmB);
clrRGB = '#' + elmR.toString(16) + elmG.toString(16) + elmB.toString(16);
elmH = elmH + rate;
if (elmH >= 360)
elmH = 0;
return clrRGB;
}

// ล็อกอิน
function chkmemberlogin(tf) {
	if (tf.uname.value == "") {
		alert('ใส่ชื่อเรียกของคุณด้วย');
		tf.uname.focus();
		return false;
	}
	if (tf.upassword.value == "") {
		alert('ใส่รหัสผ่านของคุณด้วย');
		tf.upassword.focus();
		return false;
	}
}

// สมัครสมาชิก
function chkregisterdata(tf)
	{		
		if (tf.firstname.value == "") {
			alert('ใส่ชื่อจริงของคุณด้วย');
			tf.firstname.focus();
			return false;
		}
		if (tf.lastname.value == "") {
			alert('ใส่นามสกุลของคุณด้วย');
			tf.lastname.focus();
			return false;
		}		
		if (tf.mday.value==""|| tf.mmon.value==""|| tf.myea.value==""){			
			alert('ระบุวันเดือนปีเกิดของคุณด้วย');
			if (tf.mday.value==""){tf.mday.focus();}else if(tf.mmon.value==""){tf.mmon.focus()}else{tf.myea.focus()}			
			return false;
		}
		if (tf.occupation.value == "") {
			alert( 'ระบุอาชีพของคุณด้วย');
			tf.occupation.focus();
			return false;
		}		
		if (tf.address.value.length < 15) {
			alert( 'ใส่ที่อยู่ที่สามารถติดต่อได้ให้ละเอียดด้วย (เลขที่ หมู่ ตำบล อำเภอ)');
			tf.address.focus();
			return false;
		}
		if (tf.province.value == "") {
			alert('ระบุชื่อจังหวัดที่คุณอยู่ด้วย');
			tf.province.focus();
			return false;
		}
		if (tf.country.value == "") {
			alert('ระบุชื่อประเทศที่คุณอยู่ด้วย');
			tf.country.focus();
			return false;
		}
		if (tf.zip.value.length < 5) {
			alert('ใส่รหัสไปรษณีย์ให้ครบด้วย');
			tf.zip.focus();
			return false;
		}
		if (tf.tel.value == "") {
			alert('ใส่หมายเลขโทรศัพท์ที่สามารถติดต่อได้ด้วย\n(ถ้าไม่มีให้ใส่ - แทน)');
			tf.tel.focus();
			return false;
		}	
		if (tf.email.value == "") {
			alert('ใส่อีเมล์แอดเดรสของคุณด้วย');
			tf.email.focus();
			return false;
		}
		if (tf.uname.value.length < 5) {
			alert('ใส่ชื่อที่ใช้ในการล็อกอินด้วย อย่างน้อย 5 ตัวอักษร');
			tf.uname.focus();
			return false;
		}
		if (tf.upassword.value.length < 6) {
			alert('รหัสผ่านต้องมีความยาวไม่น้อยกว่า 6 ตัวอักษรนะคะ');
			tf.upassword.focus();
			return false;
		}
		if (tf.confirmpwd.value != tf.upassword.value) {
			alert('รหัสผ่าน กับ ยืนยันรหัสผ่าน ต้องใส่ให้เหมือนกัน');
			tf.confirmpwd.focus();
			return false;
		}
	}

// Talk
	function chkblanktalk(tf) {
		if (tf.talk.value == "") {
			alert('ใส่รายละเอียดด้วย ถ้าไม่ต้องการให้โชว์ที่หน้าแรก ให้ใส่เครื่องหมาย - ไว้');
			tf.talk.focus();
			return false;
		}
	}
// Change Password
	function chkpwd(tf) {
		if (tf.passwd.value.length < 6) {
			alert('ใส่รหัสผ่านใหม่อย่างน้อย 6 ตัวอักษร');
			tf.passwd.focus();
			return false;
		}
		if (tf.confirmpwd.value != tf.passwd.value ) {
			alert('ยืนยันรหัสผ่านให้ถูกต้องด้วย');
			tf.confirmpwd.focus();
			return false;
		}
	}
// Add Games
	function chkblankgame(tf) {
		if (tf.groupid.value == "") {
			alert('เลือกหมวดหมู่เกมส์ด้วย');
			tf.groupid.focus();
			return false;
		}
		if (tf.gametitle.value == "") {
			alert('ใส่ชื่อเกมส์ด้วย');
			tf.gametitle.focus();
			return false;
		}
		if (tf.gamedesc.value == "") {
			alert('ใส่คำบรรยายเกี่ยวกับเกมส์สั้นๆ ด้วย');
			tf.gamedesc.focus();
			return false;
		}
		if (tf.blob1.value == "") {
			alert('เลือกรูปภาพประกอบเกมส์ด้วย');
			tf.blob1.focus();
			return false;
		}
		if (tf.gamemanual.value == "") {
			alert('');
			tf.gamemanual.focus();
			return false;
		}
	}
	function chkblankfilegame(tf) {
		if (tf.blob2.value == "") {
			alert('');
			tf.blob2.focus();
			return false;
		}
	}
	function chkblankgame_edit(tf) {
		if (tf.groupid.value == "") {
			alert('เลือกหมวดหมู่เกมส์ด้วย');
			tf.groupid.focus();
			return false;
		}
		if (tf.gametitle.value == "") {
			alert('ใส่ชื่อเกมส์ด้วย');
			tf.gametitle.focus();
			return false;
		}
		if (tf.gamedesc.value == "") {
			alert('ใส่คำบรรยายเกี่ยวกับเกมส์สั้นๆ ด้วย');
			tf.gamedesc.focus();
			return false;
		}		
		if (tf.gamemanual.value == "") {
			alert('');
			tf.gamemanual.focus();
			return false;
		}
	}
	function chkblankgame2(tf) {		
		if (tf.blob2.value == "") {
			alert('เลือกรูปภาพประกอบเกมส์ด้วย');
			tf.blob2.focus();
			return false;
		}		
	}

// Addpicture
	function chkblankpicture2(tf) {
		if (tf.picturegroup.value == "") {
			alert('เลือกหมวดหมู่ของรูปภาพด้วย');
			tf.picturegroup.focus();
			return false;
		}
		if (tf.txtpictname.value == "") {
			alert('ใส่ชื่อรูปภาพด้วย');
			tf.txtpictname.focus();
			return false;
		}
	}
	function chkblankpicture(tf) {
		if (tf.picturegroup.value == "") {
			alert('เลือกหมวดหมู่ของรูปภาพด้วย');
			tf.picturegroup.focus();
			return false;
		}
		if (tf.txtpictname.value == "") {
			alert('ใส่ชื่อรูปภาพด้วย');
			tf.txtpictname.focus();
			return false;
		}
		if (tf.blob1.value == "") {
			alert('เลือกรูปภาพตัวอย่างด้วย');
			tf.blob1.focus();
			return false;
		}
		if (tf.blob2.value == "") {
			alert('เลือกรูปภาพแจกฟรีด้วย');
			tf.blob2.focus();
			return false;
		}
	}
// config
	function chkblankconfig(tf) {
		if (tf.sitename.value == "") {
			alert('ใส่ชื่อเว็บไซต์ด้วย');
			tf.sitename.focus();
			return false;
		}
		if (tf.sitetitle.value == "") {
			alert('ใส่ข้อความที่ต้องการให้ปรากฎที่ไตเติ้ลบาร์ด้วย');
			tf.sitetitle.focus();
			return false;
		}
		if (tf.sitedesc.value == "") {
			alert('ใส่คำอธิบายเกี่ยวกับเว็บไซต์ด้วย');
			tf.sitedesc.focus();
			return false;
		}
		if (tf.sitekeyword.value == "") {
			alert('ใส่คำค้นด้วย');
			tf.sitekeyword.focus();
			return false;
		}
		if (tf.sitefontname.value == "") {
			alert('ใส่รูปแบบตัวอักษรด้วย');
			tf.sitefontname.focus();
			return false;
		}
		if (tf.fixwidth.value == "") {
			alert('ใส่เลขจำกัดค่าความกว้างของรูปภาพขนาดเล็กด้วย');
			tf.fixwidth.focus();
			return false;
		}
		if (isNaN(tf.fixwidth.value)) {
			alert('ค่าจำกัดความกว้างใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.fixwidth.focus();
			return false
		}
		if (tf.fixheight.value == "") {
			alert('ใส่เลขจำกัดค่าความสูงของรูปภาพขนาดเล็กด้วย');
			tf.fixheight.focus();
			return false;
		}
		if (isNaN(tf.fixheight.value)) {
			alert('ค่าจำกัดความสูงใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.fixheight.focus();
			return false
		}
		if (tf.fixuploadsmallimg.value == "") {
			alert('กำหนดขนาดไฟล์อัพโหลดรูปภาพตัวอย่างด้วย');
			tf.fixuploadsmallimg.focus();
			return false;
		}
		if (isNaN(tf.fixuploadsmallimg.value)) {
			alert('ใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.fixuploadsmallimg.focus();
			return false
		}
		if (tf.fixuploadfreepict.value == "") {
			alert('กำหนดขนาดไฟล์อัพโหลดรูปภาพแจกฟรีด้วย');
			tf.fixuploadfreepict.focus();
			return false;
		}
		if (isNaN(tf.fixuploadfreepict.value)) {
			alert('ใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.fixuploadfreepict.focus();
			return false
		}
		if (tf.fixuploadgame.value == "") {
			alert('กำหนดขนาดไฟล์อัพโหลดเกมส์ด้วย');
			tf.fixuploadgame.focus();
			return false;
		}
		if (isNaN(tf.fixuploadgame.value)) {
			alert('ใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.fixuploadgame.focus();
			return false
		}
		if (tf.numdaynewgame.value == "") {
			alert('กำหนดจำนวนวันที่ต้องการให้แสดงเกมส์หรือภาพมาใหม่ด้วย');
			tf.numdaynewgame.focus();
			return false;
		} 
		if (isNaN(tf.numdaynewgame.value)) {
			alert('ใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.numdaynewgame.focus();
			return false
		}
		if (tf.pictperpage.value == "") {
			alert('กำหนดจำนวนรูปภาพแจกฟรีที่แสดงต่อหน้าด้วย');
			tf.pictperpage.focus();
			return false;
		} 
		if (isNaN(tf.pictperpage.value)) {
			alert('ใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.pictperpage.focus();
			return false
		}
		if (tf.newpictperpage.value == "") {
			alert('กำหนดจำนวนรูปภาพแจกฟรีที่แสดงต่อหน้าด้วย');
			tf.newpictperpage.focus();
			return false;
		} 
		if (isNaN(tf.newpictperpage.value)) {
			alert('ใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.newpictperpage.focus();
			return false
		}
		if (tf.gameperpage.value == "") {
			alert('กำหนดจำนวนเกมส์ที่แสดงต่อหน้าด้วย');
			tf.gameperpage.focus();
			return false;
		} 
		if (isNaN(tf.gameperpage.value)) {
			alert('ใส่ได้เฉพาะตัวเลขเท่านั้น');
			tf.gameperpage.focus();
			return false
		}
		if (tf.mailadmin.value == "") {
			alert('ใส่เมล์ที่ใช้ในระบบด้วย เช่น info@yourweb.com');
			tf.mailadmin.focus();
			return false;
		}
		if (tf.txtfoldername1.value == "") {
			alert('ระบุชื่อโฟลเดอร์ที่ใช้ในการเก็บไฟล์เกมส์ด้วย');
			tf.txtfoldername1.focus();
			return false;
		}
		if (tf.txtfoldername2.value == "") {
			alert('ระบุชื่อโฟลเดอร์ที่ใช้ในการเก็บไฟล์เกมส์ชื่อใหม่ด้วย');
			tf.txtfoldername2.focus();
			return false;
		}
		if (tf.txtfoldername1.value == tf.txtfoldername2.value then) {
			alert('กรุณาระบุชื่อโฟลเดอร์ใหม่ อย่าให้ซ้ำกับชื่อเดิม');
			tf.txtfoldername2.focus();
			return false;
		}
	}	
// Member Login
	function chkmemberloginform(tf)
	{
		if (tf.uname.value == "") {
			alert('ใส่ชื่อเรียกของคุณด้วย');
			tf.uname.focus();
			return false;
		}
		if (tf.upassword.value == "") {
			alert('ใส่รหัสผ่านของคุณด้วย');
			tf.upassword.focus();
			return false;
		}
	}
// Login
	function chkloginform(tf)
	{
		if (tf.loginname.value == "") {
			alert('ใส่ User name ของคุณด้วย');
			tf.loginname.focus();
			return false;
		}
		if (tf.upassword.value == "") {
			alert('ใส่ Password ของคุณด้วย');
			tf.upassword.focus();
			return false;
		}
	}
// gamegroup
	function chkblankgamegroup(tf) {
		if (tf.groupname.value == "") {
			alert('ใส่ชื่อหมวดหมู่เกมส์ด้วย');
			tf.groupname.focus();
			return false;
		}
	}
// picturegroup
	function chkblankpictgroup(tf) {
		if (tf.pictgroupname.value == "") {
			alert('ใส่ชื่อหมวดหมู่รูปภาพด้วย');
			tf.pictgroupname.focus();
			return false;
		}
	}
function conf(obj)
   {
   	if (confirm('การกระทำนี้ จะเป็นการลบข้อมูลอย่างถาวร\nคลิก OK เพื่อยืนยันการลบข้อมูล') == true) {
   	   return true;
   	}
   	return false;
   }
   
   function keyCheck(eventObj, obj)
{
	var keyCode

	// Check For Browser Type
	if (document.all){ 
		keyCode=eventObj.keyCode
	}
	else{
		keyCode=eventObj.which
	}

	var str=obj.value

	if(keyCode==46){ 
		if (str.indexOf(".")>0){
			return false
		}
	}

	if((keyCode<48 || keyCode >58)   &&   (keyCode != 46)){ 
		return false
	}

	return true
}
function jumptof(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->