// JavaScript Document
function about_(s){
	document.all('T1').style.display = 'none';
	document.all('T2').style.display = 'none';
	document.all('T3').style.display = 'none';
	document.all('T4').style.display = 'none';
	document.all('T5').style.display = 'none';
	
	switch(s){
		case 'T1':
			document.all('T1').style.display = '';
			document.all('T2').style.display = 'none';
			document.all('T3').style.display = 'none';
			document.all('T4').style.display = 'none';
			document.all('T5').style.display = 'none';
		break;
		case 'T2':
			document.all('T1').style.display = 'none';
			document.all('T2').style.display = '';
			document.all('T3').style.display = 'none';
			document.all('T4').style.display = 'none';
			document.all('T5').style.display = 'none';
		break;
		case 'T3':
			document.all('T1').style.display = 'none';
			document.all('T2').style.display = 'none';
			document.all('T3').style.display = '';
			document.all('T4').style.display = 'none';
			document.all('T5').style.display = 'none';
		break;
		case 'T4':
			document.all('T1').style.display = 'none';
			document.all('T2').style.display = 'none';
			document.all('T3').style.display = 'none';
			document.all('T4').style.display = '';
			document.all('T5').style.display = 'none';
		break;
		case 'T5':
			document.all('T1').style.display = 'none';
			document.all('T2').style.display = 'none';
			document.all('T3').style.display = 'none';
			document.all('T4').style.display = 'none';
			document.all('T5').style.display = '';
		break;
	}
}

function calcHeight()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('bodytag').contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('bodytag').height=
      the_height;
}
		var version = "other"
		browserName = navigator.appName;   
		browserVer = parseInt(navigator.appVersion);
		
		if (browserName == "Netscape" && browserVer >= 3) version = "n3";
		else if (browserName == "Netscape" && browserVer < 3) version = "n2";
		else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "e4";
		else if (browserName == "Microsoft Internet Explorer" && browserVer < 4) version = "e3";
	
		function stopError()
		{
			return true;
		}
		window.onerror = stopError;
	
		function wireOpen()
		{
			if (version == "e4")
			{
				document.write("<marquee behavior=scroll direction=up width='100%' height=80 scrollamount=1 scrolldelay=70 onmouseover='this.stop()' onmouseout='this.start()'>")
			}
		}
	
		function wireClose()

		{
			if (version == "e4")
			{
				document.write("</marquee>")
			}
		}
function imageView(imgFile,imgTitle,imgWidth,imgHeight,winPosX,winPosY){ 
preview = window.open("","","resizable=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+imgWidth+",height="+imgHeight+",left="+winPosX+",top="+winPosY+"");
preview.document.write('<html><head><title>'+imgTitle+' - Click to close - <\/title><\/head>'
+'<body onBlur="self.focus();" marginWidth="0" marginHeight="0" topmargin="0" leftmargin="0">'
+'<center>'
+'<a href="javascript:window.close()">'
+'<img border="0" alt="Image loading please wait...." src="'+imgFile+'" width="'+imgWidth+'" height="'+imgHeight+'">'
+'<\/a><\/center>'
+'<\/body><\/html>');
preview.document.close();
}
function getDetails(id){
document.location='petras_id.php?id='+id;
//mbody.innerHTML = '<table width="540" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" class="font35"><br><img src=../images/loadinge.gif><br><br><font color=green><span class="f2">กรุณารอสักครู่....</span></font></td></tr><tr><td>&nbsp;</td></tr></table>';
//new Ajax.Updater('mbody', 'petras.php?id='+id); 
}
var highlightbehavior="TR"

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TABLE")
return
while(source.tagName!=highlightbehavior && source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}

function getDetail(id){
mbody.innerHTML = '<table width="540" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" class="font35"><br><img src=../images/loadinge.gif><br><br><font color=green><span class="f2">กรุณารอสักครู่....</span></font></td></tr><tr><td>&nbsp;</td></tr></table>';
new Ajax.Updater('mbody', 'person_detail.php?id='+id); 
}

function personEdit(id){
mbody.innerHTML = '<table width="540" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" class="font35"><br><img src=../images/loadinge.gif><br><br><font color=green><span class="f2">กรุณารอสักครู่....</span></font></td></tr><tr><td>&nbsp;</td></tr></table>';
new Ajax.Updater('mbody', 'person_edit.php?id='+id); 
}
function changePass(id){
mbody.innerHTML = '<table width="540" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" class="font35"><br><img src=../images/loadinge.gif><br><br><font color=green><span class="f2">กรุณารอสักครู่....</span></font></td></tr><tr><td>&nbsp;</td></tr></table>';
new Ajax.Updater('mbody', 'password_edit.php?id='+id); 
}
function postJob(id){
mbody.innerHTML = '<table width="540" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" class="font35"><br><img src=../images/loadinge.gif><br><br><font color=green><span class="f2">กรุณารอสักครู่....</span></font></td></tr><tr><td>&nbsp;</td></tr></table>';
new Ajax.Updater('mbody', 'post_job.php?id='+id); 
}
function Register(id){
chk = confirm("กรุณายืนยันการสมัครสมาชิิิิิก");
		if(chk){
			//new Ajax.Updater('mbody', 'print_fax.php?id='+id); 
			location.href='shicu/html/person_register.php';
		}else{
			return false;
		}
}
function go()
{
	var a = window.open('','','width=560,height=200');
	a.document.open("text/html");
	a.document.write(document.getElementById('print_fax').innerHTML);
	a.document.close();
	a.print();
}
function search_next(p,n,y){
new Ajax.Updater('mbody', 'search.php?page='+p+'&names='+n+'&fyear='+y); 
}

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function job_edit(id){
	job.innerHTML = '<table width="400" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td colspan="2" align="center" valign="middle" bgcolor="#FFFFFF" class="font35"><br><img src=../images/loadinge.gif><br><br><font color=green><span class="f2">กรุณารอสักครู่....</span></font></td></tr><tr><td>&nbsp;</td></tr></table>';
new Ajax.Updater('job', 'edit_job.php?id='+id); 
}
//-->

