// Drag Object
// an object that makes an unlimited number DynLayers draggable
// 19991010

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

function Drag() {
	this.obj = null
	this.array = new Array()
	this.dropTargets = new Array()
	this.active = false
	this.offsetX = 0
	this.offsetY = 0
	this.zIndex = 0
	this.resort = true
	this.add = DragAdd
	this.addTargets = DragAddTargets
	this.checkTargets = DragCheckTargets
	this.targetHit == null
	this.remove = DragRemove
	this.setGrab = DragSetGrab
	this.mouseDown = DragMouseDown
	this.mouseMove = DragMouseMove
	this.mouseUp = DragMouseUp
	this.onDragStart = new Function()
	this.onDragMove = new Function()
	this.onDragEnd = new Function()
	this.onDragDrop = new Function()
}
function DragAdd() {
	for (var i=0; i<arguments.length; i++) {
		var l = this.array.length
		this.array[l] = arguments[i]
		this.array[l].dragGrab = new Array(0,this.array[l].w,this.array[l].h,0)
		this.zIndex += 1
	}
}
function DragAddTargets() {
	for (var i=0; i<arguments.length; i++) {
		var l = this.dropTargets.length
		this.dropTargets[l] = arguments[i]
		this.dropTargets[l].dragGrab = new Array(0,this.dropTargets[l].w,this.dropTargets[l].h,0)
	}
}
function DragSetGrab(dynlayer,top,right,bottom,left) { 
	dynlayer.dragGrab = new Array(top,right,bottom,left)
}
function DragRemove() {
}
function DragMouseDown(x,y) {
}
function DragMouseMove(x,y) {
// highlight img recording x-pos

		if(pageNow =="home") {
			if ((x>265 && x<281)||(x>265 && y>185 && x<336 && y<228)) {
				if (switcher!=1) white_dot(1)
			} else if ((x>360 && x<376)||(x>372 && y>207 && x<450 && y<240)) {
				if (switcher!=2) white_dot(2)
			} else if ((x>455 && x<471)||(x>455 && y>230 && x<545 && y<281)) {
				if (switcher!=3) white_dot(3)
			} else if ((x>550 && x<566)||(x>555 && y>260 && x<640 && y<290)) {
				if (switcher!=4) white_dot(4)
			} else if ((x>645 && x<661)||(x>645 && y>280 && x<725 && y<310)) {
				if (switcher!=5) white_dot(5)
			} else {
				if (switcher!=0) {
					white_squad()
					switcher=0
				}
			}
		}

// clip line for navi
	line3.clipTo(null,x-80,null,null)

// clip line and move text
		if (y>360) {
			dif = y - 360
			this.array[0].moveTo(null,y-(2*dif)-this.offsetY)
			line2.clipTo(null,null,y-(2*dif)-this.offsetY-145,null)
		} else if (y>0&&y<1300){
			this.array[0].moveTo(null,y-this.offsetY)
			line.clipTo(y-this.offsetY,null,null,null)
			line2.clipTo(null,null,y-this.offsetY-145,null)
		}
}
function DragMouseUp(x,y) {
}
function DragCheckTargets() {
}

function checkWithin(x,y,left,right,top,bottom) {
}
function checkWithinLayer(x,y,lyr) {
}

// automatically define the default "drag" Drag Object
drag = new Drag()

