function doVisible(ima,selection)
{
        if(ima.options[0].selected == true)
        {
                document.all(selection).disabled=true;
        }
        else
        {
                document.all(selection).disabled=false;
        }
}
function disableControlObject(controlName) {
        document.all(controlName).disabled=true;
}

function enableControlObject(controlName) {
        document.all(controlName).disabled=false;
}


function mOvr(src,clrOver){ 
if (!src.contains(event.fromElement)){ 
	src.style.cursor = 'hand'; 
	src.style.color = '#0099FF';
	src.bgColor = clrOver; 
	} 
} 
function mOut(src,clrIn){ 
if (!src.contains(event.toElement)){ 
	src.style.cursor = 'default';
	src.style.color = '#666666';
	src.bgColor = clrIn; 
	} 
} 
function mClk(src,path){ 
if(event.srcElement.tagName=='TD')
	<!--src.pp.tags('A')[0].click(); -->
	location.href = path;
}

function chk_pass() {
        var v1 =document.pass.username.value;
	    var v2 =document.pass.password1.value;
		var v3 =document.pass.password2.value;
		var v4 =document.pass.old_password.value;
	              
	  if (v1==0 && v2 ==0 && v3==0 && v4 ==0)
		{	alert("กรอกข้อมูลให้ครบทุกช่อง");
			 return false;
		}
		else if (v1==0) 
		{	alert("Username ไม่ถูกต้อง");
			return  false;
		}
		else if (v4==0) 
		{	alert("กรุณากรอก Password เก่า");
			return  false;
		} 
		else if (v2==0) 
		{	alert("กรอก Password ใหม่");
			return  false;
		} 
		else if (v3==0) 
		{	alert("ยืนยัน Password ใหม่อีกครั้ง");
			return  false;
		}
		else if (v2 != v3) 
		{	alert("Password ใหม่ กับ ยืนยัน Password ใหม่ไม่ตรงกัน");
			return  false;
		}
		   else
				return true;
}


function chk_regis() {
        var v1 =document.register.username.value;
	    var v2 =document.register.password1.value;
		var v3 =document.register.password2.value;
		//var v4 =document.register.e_mail.value;
	              
	  if (v1==0 && v2 ==0)
		{	alert("กรอกข้อมูลไม่ถูกต้อง");
			 return false;
		}
		else if (v1==0) 
		{	alert("กรุณาเลือก Username ที่ต้องการ");
			return  false;
		}
		else if (v2==0) 
		{	alert("เลือก Password ที่ต้องการ");
			return  false;
		} 
		else if (v3==0) 
		{	alert("ยืนยัน Password อีกครั้งหนึ่ง");
			return  false;
		} 
		else if (v2 != v3) 
		{	alert("Password ทั้งสองช่องไม่ตรงกันครับ ");
			return  false;
		} 
	/*	else if (v4==0) 
		{	alert("--- E-mail ---");
			return  false;
		} 
	*/
		   else
				return true;
}

function chk_newquestion() {
        var v1 =document.newquestion.name.value;
	    var v2 =document.newquestion.topic.value;
		var v3 =document.newquestion.question.value;
	              
	  if (v1==0 && v2 ==0 && v3==0)
		{	alert("กรุณากรอกข้อมูลในช่องให้ครบทุกช่องครับ");
			 return false;
		}
		else if (v1==0) 
		{	alert("ไม่สามารถตั้งกระทู้ได้เนื่องจากคุณยังไม่ได้กรอกข้อมูล \nในส่วนของข้อมูลสมาชิกศิษย์เก่า ซึ่งคุณต้องระบุ ชื่อ นามสกุล ให้ถูกต้อง\nหากต้องการกรอกข้อมูลกรุณาคลิกที่เมนู ข้อมูลสมาชิก");
			document.location="http://anakinzone/asp1/alumni/member_info.asp?chk=2";
			return  false;
		} 
		else if (v2 == 0) 
		{	alert("กรุณากรอก หัวข้อกระทู้");
			return  false;
		} 
		else if (v3 == 0) 
		{	alert("กรุณากรอก รายละเอียดกระทู้");
			return  false;
		} 
		   else
			   document.newquestion.Enter.disabled=true;
				return true;
}


function chk_getpassword() {
		var v1 =document.getpassword.username.value;
		var v3 =document.getpassword.q_password.value;
		var v2 =document.getpassword.a_password.value;
		//var v3 =document.upload.question.value;
	              
	  if (v1==0 && v2 ==0 && v3 ==0)
		{	alert("กรุณากรอกข้อมูลบางส่วน เพื่อยืนยันการมีตัวตนของคุณ");
			 return false;
		}
		else if (v1==0) 
		{	alert("กรุณากรอก Username");
			return  false;
		}
		else if (v2==0) 
		{	alert("กรุณาเลือกคำถามเมื่อลืม Password");
			return  false;
		} 
		 else if (v3==0) 
		{	alert("กรุณากรอกคำตอบสำหรับคำถามด้านบนครับ");
			return  false;
		} 
		   else
				return true;
}	

function chk_postanswer() {
		var v1 =document.postanswer.anote.value;
	  if (v1==0)
		{	
			alert("กรุณากรอกรายละเอียดด้วยครับ");
			document.postanswer.anote.focus();
			 return false;
		}
		   else
			   document.postanswer.Enter.disabled=true;
				return true;
}	

function openpopup(c){
		var page = c;
		windowprops = "height=520,width=700,location=no," + "scrollbars=no,menubars=no,toolbars=no,resizable=no";
		window.open(page, "Popup", windowprops);
}

function popupPage(a) 
	{
		var page = a;
		windowprops = "height=278,width=220,location=no," + "scrollbars=no,menubars=no,toolbars=no,resizable=no";
		window.open(page, "Popup", windowprops);
	}
	
/* ---------------Picture check ---------------------*/

function makevisible(cur,which){
if (which==0){
cur.filters.alpha.opacity=50;
cur.style.cursor = 'hand'; 
}
else
cur.filters.alpha.opacity=100
}

<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.images.pictures.src=
/* document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value*/
document.upload.picture.value
}
//-->

 function chk_upload() {

		var cerantDate = new Date();
		var y1 = cerantDate.getYear();
		var yy = y1+543;
        var v1 =document.upload.id.value;
	    var v2 =document.upload.f_name.value;
		var v3 =document.upload.l_name.value;
		var v31=document.upload.nick_name.value;
		var v32=document.upload.sex.value;
		var v4 =document.upload.d_birth.value;
		var v5 =document.upload.m_birth.value;
		var v6 =document.upload.y_birth.value;
		var v7 =document.upload.address.value;
		var v8 =document.upload.name_alumni.value;
		var v9 =document.upload.dept_alumni.value;
		var v10 =document.upload.dept1_alumni.value;
		var v11 =document.upload.class_alumni.value;
		var v12 =document.upload.comment_alumni.value;
	              
	  if ( v1==0 && v2 ==0 && v3==0 && v31==0 && v4==0 && v5==0 && v6==0 && v7==0 && v8==0 && v9==0 && v10==0 && v11==0 && v12==0)
		{	alert("กรุณากรอกข้อมูลใสช่องที่มีเครื่องหมาย * ทุกช่องครับ ");
			document.upload.f_name.focus();
			 return false;
		}
		else if (v1==0) 
		{	alert("ขันตอนการลงทะเบียนผิดพลาด อาจเกิดจากการเลือก Username ไม่ถูกต้อง");
			document.upload.f_name.focus();
			return  false;
		}
		else if (v2==0) 
		{	alert("กรุณากรอกชื่อของคุณด้วยครับ");
		document.upload.f_name.focus();
			return  false;
		} 
		else if (v3==0) 
		{	alert("กรุณากรอกนามสกุลด้วยครับ");
		document.upload.l_name.focus();
			return  false;
		} 
		else if (v31==0) 
		{	alert("กรุณากรอกชื่อเล่นด้วยครับ");
		document.upload.nick_name.focus();
			return  false;
		}
		else if (v32==0) 
		{	alert("กรุณาเพศด้วยครับ");
			return  false;
		}
		else if (v4==0) 
		{	alert("กรุณากรอก วันที่เกิดด้วยครับ");
		document.upload.d_birth.focus();
			return  false;
		}
		else if (v5==0) 
		{	alert("กรุณากรอกเดือนเกิดด้วยครับ");
		document.upload.m_birth.focus();
			return  false;
		} 
		else if (v6==0) 
		{	alert("กรุณากรอกปีเกิดด้วยครับ");
		document.upload.y_birth.focus();
			return  false;
		} 
/*    else if (v6 <= 2400) 
		{	alert("กรอก ปีเกิดผิดพลาดกรุณากรอกเป็น พ.ศ. เช่น 2528 ");
		document.upload.y_birth.focus();
			return  false;
		} 
	
		else if (v6 > yy) 
		{	alert("ปีเกิดของคุณ มากกว่าปีปัจจุบันครับ\nกรุณาแก้ไข");
		document.upload.y_birth.value = "";
		document.upload.y_birth.focus();
			return  false;
		}
*/
		else if (v7==0) 
		{	alert("กรุณากรอกที่อยู่ที่สามารถติดต่อได้สะดวก");
		document.upload.address.focus();
			return  false;
		}
		else if (v8==0) 
		{	alert("กรุณาระบุรุ่นที่จบ");
		document.upload.name_alumni.focus();
			return  false;
		} 
		else if (v9==0) 
		{	alert("กรุณากรอกสาขาที่จบ");
		document.upload.dept_alumni.focus();
			return  false;
		} 
		else if (v10==0) 
		{	alert("กรุณากรอกแผนกที่จบ");
		document.upload.dept1_alumni.focus();
			return  false;
		}
		else if (v11==0) 
		{	alert("กรุณากรอกห้องที่จบ");
		document.upload.class_alumni.focus();
			return  false;
		} 
		else if (v12==0) 
		{	alert("กรุณากรอกความรู้สึกถึง อี.เทค");
		document.upload.comment_alumni.focus();
			return  false;
		} 
	    else
				return true;
}

function showPress(src,evt) {
    evt = (evt) ? evt : ((event) ? event : null);
    if (evt) {
        chk_key = parseInt(evt.keyCode);
		//var Str_ = String.fromCharCode(chk_key);
		if((chk_key != 32) || (chk_key >= 96 && chk_key <=105)|| (chk_key >= 48 && chk_key <=57) || chk_key == 8 || chk_key == 9 || chk_key == 13) {			
		} else {					
			alert("ใส่ตัวเลข 0 - 9 เท่านั้น ห้ามมีช่องว่าง");
			src.value = "";
		}
    }
}

function showPress1(src,evt) {
    evt = (evt) ? evt : ((event) ? event : null);
    if (evt) {
        chk_key = parseInt(evt.keyCode);
		//var Str_ = String.fromCharCode(chk_key);
		if(((chk_key != 32) && (chk_key != 222) && (chk_key != 186)) || (chk_key >= 65 && chk_key <=90) || (chk_key >= 96 && chk_key <=105) || (chk_key >= 48 && chk_key <=57) || chk_key == 8 || chk_key == 9 || chk_key == 13) {			
		} else {					
			alert("ใส่ตัวเลข 0 - 9 หรือ อักษร a - Z เท่านั้น ห้ามมีช่องว่าง");
			src.value = "";
		}
    }
}

function chk_search() {
        var v1 =document.search.QueryString.value;
		
		if (v1==0) 
		{	alert("กรุณาใส่ข้อความที่ต้องการค้นหาด้วยครับ");
			return  false;
		} 
		  else
			return true;
}
function chk_search_detel() {
        var v1 =document.search_detel.QueryString.value;
		
		if (v1==0) 
		{	alert("กรุณาใส่ข้อความที่ต้องการค้นหาด้วยครับ");
			return  false;
		} 
		  else
			return true;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  //eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

				function stopmouse(e) {
				if(navigator.appName == 'Netscape' && (e.which == 3 || e.which ==2))
				return false;
				else if
				(navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3 )) {
				return false;
				}
				return true;
				}
				document.onmousedown = stopmouse;
				if(document.layers)
				window.captureEvents(Event.MOUSEDOWN);
				window.onmousedown = stopmouse;
