// JavaScript Document
function showcatalog(where,pagecount,jump){
 
 window.jump=jump;
 window.pagecount=pagecount;
 window.currenttop=0;
 window.topstop=0;
 window.currentpage=0;
 window.scrolldone=1;
 
 mycatalog="";

 for(p=0;p<=pagecount;p+=2){
	 mycatalog+="<div id='innercatalogpage'><img src='"+where+""+p+".jpg' border=0 align=bottom/></div>";
	 
 }
 
	document.getElementById("catalogpage").innerHTML=mycatalog;
}

function slideup(whichway){
	
	//if(((window.currentpage< window.pagecount)&&(whichway==-1))||((whichway==1)&&(window.currentpage>=2))){
	if((((whichway==1)&&(window.currentpage>=2))||((whichway==-1)&&(window.currentpage<=window.pagecount-2)))&&(window.scrolldone==1)){
		
		//if((whichway>0)&&(window.currentpage>0)){
			window.scrolldone=0;
			var slidingDiv = document.getElementById("catalogpage");
			window.topstop+=((window.jump)*whichway);
			window.whichway=whichway;
			window.currentpage+=2*(-1*whichway);
			
			mySlide = window.setInterval("slideIt()",10);
		
	
	}
	
	
	//window.currenttop+=(window.jump)*whichway;
	//+parseInt(slidingDiv.offsetTop);
	//document.getElementById("bigpicholder").innerHTML=window.topstop+"L";
	
	
}

function slideIt(){
	
	var slidingDiv = document.getElementById("catalogpage");
	window.currenttop+=20*window.whichway;//(window.jump)*whichway;
	
	//whichway=-1;
	switch(window.whichway)
	{
	case -1:
		if(parseInt(slidingDiv.offsetTop)>window.topstop){
			slidingDiv.style.top=window.currenttop+"px";	
		}else{
			//slidingDiv.style.top=window.topstop;
			window.scrolldone=1;
			clearInterval(mySlide);
		}
		break;
	case 1:
		if(parseInt(slidingDiv.offsetTop)<window.topstop){
			slidingDiv.style.top=window.currenttop+"px";	
		}else{
			//slidingDiv.style.top=window.topstop;
			window.scrolldone=1;
			clearInterval(mySlide);
		}
		break;
	}


}