// Dynamic Layer Scroll Object
//  (c) FortFairlane (www.FortFairlane.nl)


function pointer(name, path) {
      if (ns4) {
                if (!path) this.p = document.layers[name]       
                else this.p = eval("document."+path+".document."+name)
                this.elm = this.event = this.p

                this.x = this.p.left
                this.y = this.p.top
                this.width = this.p.clip.width
                this.height = this.p.clip.height 
                this.doc = this.p.document
                }

        else if (ie4) {
                this.p = document.all[name].style 
                this.elm = this.event = document.all[name]
                this.x = this.elm.offsetLeft
                this.y = this.elm.offsetTop
                if (ie5) {
                        this.width = this.elm.offsetWidth
                        this.height = this.elm.offsetHeight     
                }       
                else {
                        this.width = this.p.pixelWidth
                        this.height = this.p.pixelHeight
                        
                }
        }



      this.name = name
        this.obj = name + "pointer"
        eval (this.obj+"=this")
        this.moveto = pointerMoveTo
        this.moveby = pointerMoveBy
		this.s_up = pointerScrollUp 
		this.s_down = pointerScrollDown
        this.clipto = pointerClipTo
        this.getclip = pointerGetClip
		this.show = pointerShow
}

function scrollup() {
         		move = 1
				text.s_up(0, 100)
		 	}

function scrolldown() { 
         		move = 1
		 		text.s_down(-offsetHeight, 100)
		 }

function scrollstop() {
		move = 0;
}

function pointerMoveTo(x,y) {
        this.x = x
        if (ns4) this.p.left = x
        else this.p.pixelLeft = x
        this.y = y
        if (ns4) this.p.top = y
        else this.p.pixelTop = y
}

function pointerMoveBy(x,y) {
        this.moveto(this.x+x, this.y+y)
}

function pointerGetClip(corner) {
        if (ns4) {
                if (corner == "t") return this.p.clip.top
                else if (corner == "r") return this.p.clip.right
                else if (corner == "b") return this.p.clip.bottom
                else if (corner == "l") return this.p.clip.left
        }
        else if (ie4) {
                var temp = this.p.clip.split("rect(")[1].split(")")[0].
split("px")
                if (corner == "t") return Number(temp[0])
                else if (corner == "r") return Number(temp[1])
                else if (corner == "b") return Number(temp[2])
                else if (corner == "l") return Number(temp[3])
        }
}

function pointerClipTo(t,r,b,l) {
        if (ie4) this.p.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)" 
        else if (ns4) {
                this.p.clip.top = t
                this.p.clip.right = r
                this.p.clip.bottom = b
                this.p.clip.left = l
        }
}

function pointerScrollUp(y,speed) {
        if (move) {
			if (this.y <= y) {
        	        this.moveby(0,10)
            	    setTimeout(this.obj+".s_up("+y+","+speed+")",speed)
        	}
		}
}		
		
function pointerScrollDown(y,speed) {		
 		if (move) {
       		 if (this.y >= y) {
    	         this.moveby(0,-10)
        	     setTimeout(this.obj+".s_down("+y+","+speed+")",speed)
        	}
     	}
}


function pointerShow() {
	if (ns4) this.p.visibility = "show"
	else this.p.visibility = "visible"
}


function over(a,b) { 
		if(document.images) 
			document.images[a].src=eval(b+".src");		 
		}			 
			 
