function Parabola(dynlayer,name) {
	this.dynlayer = dynlayer
	this.name = name
	this.play = ParabolaPlay
	this.slide = ParabolaSlide
	this.stop = ParabolaStop
	this.wait = ParabolaWait
}

function ParabolaPlay(type,startx,starty,distx,disty,xinc,speed,delay,fn) {
	if (!this.active) {
		this.type = type
		this.distx = Math.abs(distx)
		this.disty = Math.abs(disty)
		this.dirx = (distx>0)? 1:-1
		this.diry = (disty>0)? 1:-1
		this.xinc = xinc
		this.speed = speed
		this.delay = delay
		this.fn = fn
		this.startX = startx
		this.startY = starty
		//this.startX = eval(this.dynlayer+'.x')
		//this.startY = eval(this.dynlayer+'.y')
		this.active = false
		this.i = 0
		this.factor = this.disty/Math.pow(this.distx/this.type,2)
		this.active = true
		eval(this.dynlayer+'.'+this.name+'.slide()')
	}
}

function ParabolaSlide() {
	if (this.active && Math.abs(this.i)<this.distx) {
		this.i += this.dirx*this.xinc
		var x = this.startX + this.i
		if (this.type==1) var y = this.startY + this.diry*this.factor*Math.pow(Math.abs(this.i),2)
		if (this.type==2) var y = this.startY + this.diry*this.factor*Math.pow(this.distx/2-Math.abs(this.i),2) + this.diry*this.disty 
		eval(this.dynlayer+'.moveTo('+x+','+y+')')
		setTimeout(this.dynlayer+'.'+this.name+'.slide()',this.speed)
	}
	else {
		eval(this.dynlayer+'.hide()')
		setTimeout(this.dynlayer+'.'+this.name+'.wait()',this.delay)
		//this.active = false
		//eval(this.fn)
	}
}

function ParabolaStop() {
	this.active = false
}

function ParabolaWait() {
	if (this.active) {
		this.i=0
		eval(this.dynlayer+'.moveTo('+this.startX+','+this.startY+')')
		eval(this.dynlayer+'.show()')
		eval(this.dynlayer+'.'+this.name+'.slide()')
	}
}


function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function changeImage(layer,imgName,imgObj) {
	if (document.images) {
		if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
		else document.images[imgName].src = eval(imgObj+".src")
	}
}



function playSound(soundobj, soundURL) {
	if (is.ie) document.all['BGSOUND_ID'].src=soundURL;
	else {
	  var thissound= eval("document."+soundobj);
	  thissound.Play();
	}
}

function stopSound(soundobj) {
	if (is.ie) 
		document.all['BGSOUND_ID'].src='';
	else {
		var thissound= eval("document."+soundobj);
		thissound.Stop()
	}
}

