// JavaScript Document
// Add function by TSB 
function Open_Win( strBtn ) {
	var sBlank = "" ;
	var sCntr  = document.form.TheCntr.value ;

	if ( sCntr + sBlank != "" ) {
		var WinMode	= "scrollbars=no,toolbar=no,location=no,status=no,menubar=no" 

		if ( strBtn == "Cntr" ) {
			WinMode = WinMode + ",width=700,height=350";
			var TargetDir = "http://www.esco.co.th/esco/Home/Win_Cntr.jsp?cn=" + sCntr + "&amp;ac=List";
			Cntr_Window = window.open( TargetDir, "WinCntr", WinMode );
			Cntr_Window.focus() ;
		}
	} else { alert (" Please Input Container No! ") ; }
}

function Check_Login() {
	var sBlank = "" ;
	var TheForm = document.form ;

	if ( document.form.TheCntr.value + sBlank != "" && (document.form.TheCntr.value + sBlank).length == 11 ) {

		Open_Win( "Cntr" ) ;
	
		return false

	} else {

		if ( TheForm.wUid.value + sBlank == "" ) {
			if ( event.keyCode != 0 ) {
				alert( " Please input your ID! " );
				TheForm.wUid.focus();
			}
			return false
		}

		if ( TheForm.wPwd.value + sBlank == "" ) {
			alert( " Please input Password! " );
			TheForm.wPwd.focus();
			return false
		}
	}
}

function Change_Tmnl() {
	var sBlank = "" ;
	var TheForm = document.form ;
}

function On_KeyUser(){
	var sBlank = "" ;
	if( document.form.TheCntr.value + sBlank != "" ) {
		document.form.TheCntr.value = "" ;
	}
}

function On_KeyCntr(){
	var sBlank = "" ;
	if( document.form.wUid.value + sBlank != "" ) {
		document.form.wUid.value = "" ;
	}
}

function Check_Forms(){
	if( event.keyCode == 39 ){
		return false;
	}
}

