si=null;
siview=null;
prev=-1;
step=0;
loadthumbnail=4;
next=2;
currentdescription="landscape50x50acrylcanvas"


thumbnailarray=new Array(
"thumbnaillandscape50x50acrylcanvas",
"thumbnailhill45x60acrylcanvas",
"thumbnailfields20x30acrylcardboard",
"thumbnaillandscape20x30acrylcardboard",
"thumbnaillandscape30x42acrylcardboard",
"thumbnaillandscape32x45acrylcardboard",
"thumbnailray45x50unknown",
"thumbnaillandscape700x100acrylcanvas1",
"thumbnaillanscape40x60acrylcanvas",
"thumbnailrad20x30acrylcardboard",
"thumbnaillandscape70x100acrylcanvas",
"thumbnailspark20x30acrylcardboard",
"thumbnaillansdcape70x100acrylcanvas2",
"thumbnailtree40x50acrylcanvas",
"thumbnaillanscape40x40acrylcardboard")


imgarray=new Array("pr", "dr", "tr","ce");



function moveup(){
if (step==1622) return false;
step++;
//window.status=step

for (i in imgarray) 
	{
	positiontop=parseInt(document.getElementById(imgarray[i]).style.top);
	positionleft=parseInt(document.getElementById(imgarray[i]).style.left);

	if(positionleft!=50) document.getElementById(imgarray[i]).style.top=(positiontop-1)+"px";

	hgt=parseInt(document.getElementById(imgarray[i]).offsetHeight);
		if((hgt+positiontop)==311) /* 472 */	/*   prije je bilo 312 danas 311*/
		{
		document.getElementById(imgarray[next]).style.left="468px";
		document.getElementById(imgarray[next++]).style.top="319px"} /*  479  319*/

		
		if((hgt+positiontop)==38)  /*198*/
		{
		document.getElementById(imgarray[i]).style.left="50px";
		document.getElementById(imgarray[i]).style.top="200px"; 

		if(thumbnailarray[loadthumbnail]){
		document.getElementById(imgarray[i]).src="images/"+thumbnailarray[loadthumbnail++]+".jpg"
		}
		else {++loadthumbnail}

		prev++;
		if(prev==4) prev=0;
		}
	if(next==imgarray.length) next=0;
	}
}


function movedown(){
if (step<=0) return false;
--step;

for (i in imgarray) 
	{
	positiontop=parseInt(document.getElementById(imgarray[i]).style.top);
	positionleft=parseInt(document.getElementById(imgarray[i]).style.left);
	if(positionleft!=50) document.getElementById(imgarray[i]).style.top=(positiontop+1)+"px";

		if(positiontop==319) /*479 */
		{
		document.getElementById(imgarray[i]).style.left="50px";
		document.getElementById(imgarray[i]).style.top="334px";
		--next;
		if (next==-1) next=3;
		}


		if(positiontop==41 && step>10) /*201*/
		{
		document.getElementById(imgarray[prev]).src="images/"+thumbnailarray[loadthumbnail-5]+".jpg";
		--loadthumbnail;
		hgt=parseInt(document.getElementById(imgarray[prev]).offsetHeight);
		document.getElementById(imgarray[prev]).style.left="468px"; 
		document.getElementById(imgarray[prev]).style.top=(34-hgt)+"px"; /*195*/ /*  35 jucer 34danas*/
		--prev;
		if(prev==-1) prev=3;
		}
	}
}






slikapreload=new Image()
slikapreload.onload=function(){compl()}



function view(picture){
document.getElementById(currentdescription).style.zIndex=1;
start=picture.indexOf("thumbnail")+9;
end=picture.length-4;
currentdescription=picture.substring(start,end);

//solving bug in opera
//begin
delete slikapreload
slikapreload=new Image()
slikapreload.onload=function(){compl()}
//end

slikapreload.src="images/"+currentdescription+".jpg"
}



function compl(){
document.getElementById('uvecana_slika').src=slikapreload.src;
offheight=parseInt(document.getElementById('uvecana_slika').offsetHeight);
document.getElementById(currentdescription).style.top=(40+offheight)+"px"
document.getElementById(currentdescription).style.left="90px"
document.getElementById(currentdescription).style.zIndex=30;

//solving rendering bug in Netscape 6 & Opera 7.11;
document.getElementById('bug').style.zIndex=5;
document.getElementById('bug').style.zIndex=0;

}