     ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    // ***      ****                 //an object built on the                                                //
   //{          *   }      PRESENTS //Dynamic Layer Object                                                  //
  //   **OFT    ****               //sophisticated layer/element targeting and animation object            //
 //       }     * RODUCT          //which provides the core functionality needed in most DHTML applications/
//   ****       *                // 19990604                                                             //
// http://daverwin.homepage.com // Copyright (C) 1999 Dan Steinman                                      //
// http://daverwin.homepage.com// Distributed under the terms of the GNU Library General Public License//
// FREEWARE FREEWARE FREEWARE // Available at http://www.dansteinman.com/dynapi/                      //
///////////////////////////////////////////////////////////////////////////////////////////////////////
//                    see http://daverwin.homepage.com/ for details                                 //
//                    send comments to daverwin.hotmail.com                                        //
////////////////////////////////////////////////////////////////////////////////////////////////////
function MixUp(n,g,w,h,x,y){
	var W=w/3	
	var H=h/3
	var Lt="\<"
	this.busy=false
	this.scram=false
	this.cnt=0
	this.xx=2
	this.yy=2
	this.x=new Array()
	this.y=new Array()
	this.H=H
	this.W=W
	this.a=new Array()
	this.n=n
	this.css = css(n+'aDiv',x,y,w+10,h+35,'red') + css(n+'bDiv',5,30,w,h)
	this.div=Lt +'DIV ID='+n+'aDiv>'+Lt+'font color=blue size=5>'+Lt+'a href="javascript:'+n+'.scramble()">MixUp'+Lt+'/a>'+Lt+'font color=red>x'+Lt+'/font>'+Lt+'font color=blue>'+Lt+'a href="javascript:'+n+'.solve()">Reset'+Lt+'/a>'+Lt+'/font>'+Lt+'/font>\n'+Lt+'DIV ID='+n+'bDiv>\n'
	for(var i=0;i<3;i++){for(var j=0;j<3;j++){
		var b=i*3+j
		if(b==8)break
		this.x[b]=j,this.y[b]=i,this.a[b]=n+b		
		this.css+=css(n+b+'Div',0,0,w,h,null,null,null,'clip:rect('+(i*H)+'px '+(j*W+W)+'px '+(i*H+H)+'px '+(j*W)+'px);') 
		this.div+=Lt+'DIV ID='+n+b+'Div>'+Lt+'img src='+g+' height='+h+' width='+w+'>'+Lt+'/DIV>\n'}}
	this.div+=Lt+'/DIV>'+Lt+'/DIV>',this.init=MixUpInit,this.scramble=MixUpScram,this.solve=MixUpSol}
function MixUpInit(){
	for(var i in this.a){
		eval(this.a[i]+'.elm.onmouseover=MixUp1') 
		eval(this.a[i]+'.elm.duh="'+this.n+'"')
		eval(this.a[i]+'.elm.doh='+i)}}
function MixUpSol(){
	if(this.busy)return
	this.busy=true
	var n=this.n
	setTimeout(n+'.busy=false',2000)	
	for(var i=0;i<3;i++){for(var j=0;j<3;j++){
		var b=i*3+j
		if(b==8)break
		this.x[b]=j,this.y[b]=i
		eval(n+b+'.slideTo(0,0,25,null)')}}
	this.xx=2,this.yy=2}
function MixUpScram(n1){
	var n=(n1)?n1:this.n
	setTimeout('clearInterval(TMR)',8000)
	TMR=setInterval('MixUp1('+n+'.n)',700)}
function MixUp1(n1){
	if(n1=='[object Event]')n1=null
	var n=(n1)? n1 : this.duh
	if(eval(n+'.busy'))return
	eval(n+'.busy=true')
	var i=(n1)? eval(n+'.cnt++') : this.doh
	eval('if('+n+'.cnt==8)'+n+'.cnt=0')
	eval('var x='+n+'.x['+i+'], y='+n+'.y['+i+'], x1='+n+'.xx, y1='+n+'.yy')
	if(((x==x1)|(y==y1))&(((x-1)==x1)|((x+1)==x1)|((y-1)==y1)|((y+1)==y1))){
		eval('H='+n+'.H,W='+n+'.W')
		eval(n+i+'.slideBy(W*(x1-x),H*(y1-y),25,null,"'+n+'.busy=false")')
		eval(n+'.xx=x,'+n+'.yy=y,'+n+'.x[i]=x1,'+n+'.y[i]=y1')		}		
	else eval(n+'.busy=false')
	if(n1)MixUp1(n1)}
