//**These are the x co-ordinates of the vertical lines.  These are got by
//**trial and error!


function HgridMoveObject(	id,
				X, 
				Y){



	this.base=movingObject
	
	this.VLINEL=0

	this.base(X,Y, HgridMove, id)

	this.setz=SetZIndx

}

HgridMoveObject.prototype=new movingObject

function HgridMoveObjectContainer(	id,
				objID, 
				X, 
				Y){
	
	this.base=HgridMoveObject
	this.objShow=0
	this.objID=objID	//the id of the object associated with the box

	this.base(id,X,Y)


}

HgridMoveObjectContainer.prototype=new HgridMoveObject


lastx=0
function HgridMove(){
	
	var moving=CurrentMovingObject.moving

	//** moving=1 allows movement, moving=0 stops it	

	if (moving==1)
	{
   		moveByX=event.x-CurrentMovingObject.offX

		if(moveByX<1)
			moveByX=0

		
	//** whichVLine helps keep track of the vertical lines
	//** (event.x>lastx) means the object is moving to the right
	//** so look for event when vertical line to the right is met

		if(event.x>lastx)
			{VLINECHK=LINE[CurrentMovingObject.VLINEL+1]
			L=CurrentMovingObject.VLINEL+1}
		else
			{VLINECHK=LINE[CurrentMovingObject.VLINEL]
L=CurrentMovingObject.VLINEL}

		if(((CurrentMovingObject.X<VLINECHK-3)|(CurrentMovingObject.X>VLINECHK+3)))
		{
			CurrentMovingObject.X=(moveByX)
	
		HLineEvent(0, L)

		}
		else
		{	
			HLineEvent(1, L)
			CurrentMovingObject.X=(moveByX)

		}
	
	

	paintObj(CurrentMovingObject)

//**this bit checks what two vertical gridlines are either side of object

if(CurrentMovingObject.X>LINE[CurrentMovingObject.VLINEL+1]+3)
	CurrentMovingObject.VLINEL++
else if(CurrentMovingObject.X<LINE[CurrentMovingObject.VLINEL]-3)
	CurrentMovingObject.VLINEL--

lastx=event.x

}//if moving


}
