Explorer=(navigator.appName=="Microsoft Internet Explorer")

var intID=0;

curPage = new Object;
Pages = new Array;           

function addPage(pageNumber, divId, width, height, maxWidth, maxHeight){
curPage=new divNavigator(divId, width, height, maxWidth, maxHeight);
curPage.hide()
Pages[pageNumber]=curPage;
}

function showPage(pageNumber){
	if (showPage.arguments.length){

// alert(showPage.arguments.pageNumber);
		curPage.hide();
		curPage=Pages[pageNumber];
	}	
	curPage.show();
}



/* div objekt */

function divNavigator(divId, width, height, maxWidth, maxHeight){
 this.obj=(Explorer)? eval(divId) : eval("document."+divId)
 // alert(this.obj.style.width);
 this.Width=maxWidth;
 this.Height=maxHeight;
 this.clTop=0;
 this.clRight=width;
 this.clBot=height;
 this.clLeft=0;
 this.pix=5;
 this.show=show;
 this.hide=hide;
 this.moveLeft=moveLeft;
 this.moveRight=moveRight;
 this.moveUp=moveUp;
 this.moveDown=moveDown;
}

function show(){
	(Explorer)? this.obj.style.visibility="visible" : this.obj.visibility="show"
} 

function hide(){
	(Explorer)? this.obj.style.visibility="hidden" : this.obj.visibility="hide"
} 


function moveLeft(){
 if   (this.Width>this.clRight)
      {this.clRight+=this.pix
       this.clLeft+=this.pix
      }
 else { clearInterval(intID)

        return}
       
 if (Explorer){
     this.obj.style.left=parseInt(this.obj.style.left)-this.pix
     this.obj.style.clip="rect("+this.clTop+"px,"+this.clRight+"px,"+this.clBot+"px,"+this.clLeft+"px)"
     }
else{
     this.obj.clip.left=this.clLeft	
     this.obj.clip.right=this.clRight
     this.obj.left-=this.pix
    }
}

function moveRight()
{
 if   (0<this.clLeft)
      {this.clRight-=this.pix
       this.clLeft-=this.pix
      }
 else { clearInterval(intID)
        return}
 if (Explorer)
     {
     this.obj.style.left=parseInt(this.obj.style.left)+this.pix
     this.obj.style.clip="rect("+this.clTop+"px,"+this.clRight+"px,"+this.clBot+"px,"+this.clLeft+"px)"
     }
else{
     this.obj.clip.left=this.clLeft	
     this.obj.clip.right=this.clRight
     this.obj.left+=this.pix
    }
}

function moveUp(){
 
 if   (this.Height>this.clBot)
      {this.clTop+=this.pix
       this.clBot+=this.pix
 }
 else { clearInterval(intID)
        return}
 if (Explorer)
     {
     this.obj.style.top=parseInt(this.obj.style.top)-this.pix
     this.obj.style.clip="rect("+this.clTop+"px,"+this.clRight+"px,"+this.clBot+"px,"+this.clLeft+"px)"
 }
else{
     this.obj.clip.top=this.clTop	
     this.obj.clip.bottom=this.clBot
     this.obj.top-=this.pix
 }
}

function moveDown()
{
 
 if   (0<=this.clTop)
      {this.clTop-=this.pix
       this.clBot-=this.pix
      }
 else { clearInterval(intID)
        return}
 if (Explorer)
     {
     this.obj.style.top=parseInt(this.obj.style.top)+this.pix
     this.obj.style.clip="rect("+this.clTop+"px,"+this.clRight+"px,"+this.clBot+"px,"+this.clLeft+"px)"
     }
else{
     this.obj.clip.top=this.clTop	
     this.obj.clip.bottom=this.clBot
     this.obj.top+=this.pix
    }
}     