/* Este Script possui alterações que
possibilitaram a implantação do mesmo em nosso
site. Caso você queira estudar o Script original, procure
a referência em http://developer.netscape.com
Master and DevEdge - ÁticaEducacional
*/

//Browser and screen resolution detection

n = (document.layers) ? 1:0
ie = (document.all) ? 1:0

//Define the properties and methods of the new object

function init() {
	obj1 = new dynLayer("Search")
	obj1.relPos(-600,116)
	}
function rollOver() {
	obj1.relSlide(126,116,20,10)
}
function rollOut() {
	obj1.relSlide(-600,116,20,10);
}

function dynLayer(id,nestref) {
	if (n) {
		windowWidth = window.innerWidth
		windowHeight = window.innerHeight
		if (nestref) {
			this.css = eval("document." + nestref + ".document." + id)
			this.ref = eval("document." + nestref + ".document." + id + ".document")
			}
		else {
			this.css = document.layers[id]
			this.ref = document.layers[id].document
			}
		this.x = this.css.left
		this.y = this.css.top
		this.width = this.css.clip.width
		this.height = this.css.clip.height        
		}
	else if (ie) {
		windowWidth = document.body.offsetWidth-20
		windowHeight = document.body.offsetHeight
		this.css = document.all[id].style
		this.ref = document
		this.x = this.css.pixelLeft
		this.y = this.css.pixelTop
		this.width = this.css.pixelWidth
		this.height = this.css.pixelHeight        
		}
	this.obj = id + "Object"
	eval(this.obj + "=this")
	this.moveBy = dynLayerMoveBy
	this.moveTo = dynLayerMoveTo
	this.show = dynLayerShow
	this.hide = dynLayerHide
	this.slideBy = dynLayerSlideBy
	this.slideTo = dynLayerSlideTo
	this.slide = dynLayerSlide
      this.id = id
      this.write = dynLayerWrite
	this.relPos = dynLayerRelPos
	this.relSlide = dynLayerRelSlide
	}

//Create the methods of the new object

function dynLayerMoveBy(x,y) {
	this.x += x
	this.css.left = this.x
	this.y += y
	this.css.top = this.y
	}
function dynLayerMoveTo(x,y) {
	this.x = x
	this.css.left = this.x
	this.y = y
	this.css.top = this.y
	}
function dynLayerShow() {
	if (n) this.css.visibility = "show"
	else if (ie) this.css.visibility = "visible"
	}
function dynLayerHide() {
	if (n) this.css.visibility = "hide"
	else if (ie) this.css.visibility = "hidden"
	}
function dynLayerSlideBy(distx,disty,inc,speed,fn) {
      if (!this.slideActive) {
	var endx = this.x + distx
		var 
	endy = this.y + disty
		var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/inc
		var dx = distx/num
		var dy = disty/num
		this.slideActive = 1
		this.slide(dx,dy,endx,endy,speed,fn)
		}
	}
function dynLayerSlideTo(endx,endy,inc,speed,fn) {
	if (!this.slideActive) {
		var distx = endx - this.x
		var disty = endy - this.y
		var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/inc
		var dx = distx/num
		var dy = disty/num
		this.slideActive = 1
		this.slide(dx,dy,endx,endy,speed,fn)
		}
	}
function dynLayerSlide(dx,dy,endx,endy,speed,fn) {
	if (!fn) fn = null
	if (this.slideActive && (Math.floor(Math.abs(dx))<Math.floor(Math.abs(endx-this.x)) || Math.floor(Math.abs(dy))<Math.floor(Math.abs(endy-this.y)))) {
		this.moveBy(dx,dy)
		setTimeout(this.obj+".slide("+dx+","+dy+","+endx+","+endy+","+speed+",\""+fn+"\")",speed)
	}
	else {
		this.slideActive = 0
		this.moveTo(endx,endy)
		eval(fn)
		}
	}
function dynLayerWrite(text) {
	if (n) {
		this.ref.write(text)
		this.ref.close()
		}
	else if (ie) document.all[this.id].innerHTML = text
	}
function dynLayerRelPos(x,y) {
	this.moveTo(x,y,2,2)
	this.show()
	}
function dynLayerRelSlide(x,y,inc,speed) {
	this.show()
	this.slideTo(x,y,inc,speed)
	}
function changezindex(name,z){
        if(n){
        document.layers[name].zIndex=z
        }
        if(ie){
        document.all[name].style.zIndex=z
        }
}