//
// Validate controls: ISBN ItemNo BacNo REservationNo ControlNo BrwrNo PrdNo
//The following line must be include in the HTML file that used this script
//
//<OBJECT classid=CLSID:80E620E0-F631-11D1-A71C-000021750386 height=1 id=CheckConn width=1></OBJECT>Conn Type :
//
    

function CVControlNo_checkValidity()
{


	if (this.value=="")
	{
		CValidateBase_invalid(this, "Empty Field");
		this.save = 0;
		return;
	}

	CheckConn.TypeAsStr = this.ConnType;

	CheckConn.Value = this.value;
	this.value = CheckConn.Value;
	 
	if (CheckConn.Completed == 0)
	{
/*
		// The following code is now handled by the control, 
		// since that would also work for Mike's new binding 
		// scheme as well (SJL 20/10/1999)

		if (CheckConn.StateAsStr == "CheckSumError")
		{	
	
			this.value = this.save;
			CheckConn.TypeAsStr = this.ConnType;
			CheckConn.Value = this.value;
			this.value = CheckConn.Value;
			if (CheckConn.Completed == 0)
			{
				CValidateBase_invalid(this, CheckConn.StateAsStr);
			}
		
		}		
		else
*/
			CValidateBase_invalid(this, CheckConn.StateAsStr);
			
		this.save = this.value;

		return;
	}

	// we may have something like CheckSumError
	this.title = CheckConn.StateAsStr;
//	this.keyFiltered = (event.returnValue==false);

}

function CVControlNo(el)
{
	CValidateBase(el);

	el.checkValidity = CVControlNo_checkValidity;
	
	// This can't be done automatically by the base class
	// ...Shame...
	el.checkValidity();
}

bindings.vcontrolno = new CBinding(CVControlNo);

