function OpenImg(id,catalog) {
	FotoWindow = window.open("/catalog/fotoalbom/one_image.php?id="+id+"&catalog="+catalog, "pop2", "Width=900px, Height=750px, center=yes, location=0, status=1, menubar=0, scrollbars=1, resizable=1, help=0, toolbar=no");
	FotoWindow.focus();
}

function OpenAward(id,catalog) {
	FotoWindow = window.open("/awards/one_image.php?id="+id+"&catalog="+catalog, "pop2", "Width=900px, Height=750px, center=yes, location=0, status=1, menubar=0, scrollbars=1, resizable=1, help=0, toolbar=no");
	FotoWindow.focus();
}



/******************/
function closeWin() {window.close();}
function setScroll(){document.body.setExpression("scroll","checkScroll()","JScript");}
function checkScroll(){
	var o=document.body;
	document.body.scroll=(o.scrollHeight>o.clientHeight || o.scrollWidth>o.clientWidth ? "yes":"no");
}


function init() {
	if(navigator.appName.substring(0,3)=='Mic') setScroll();
	print();
}

function print() {		
	var leftie = document.getElementById("leftie");
	var rightie = document.getElementById("rightie");
	var k_img = document.getElementById("kasseta_img");
	var k_text = document.getElementById("kasseta_text");

	if(curpic==0) {
		leftie.style.display = "none";
	}

	if(curpic==picz.length-1) {
		rightie.style.display = "none";;
	}

	if(curpic > 0) {
		leftie.style.display = "block";
	}

	if(curpic < picz.length-1) {
		rightie.style.display = "block";
	}

    k_img.src = picz[curpic];

	if(textz[curpic])
    	  k_text.innerHTML = textz[curpic]+ "<br><img src='/images/em.gif' height=10 widht=1>";
    else
          k_text.innerHTML = "<img src='/images/em.gif' height=1 widht=1>";
}

function prev() {
	curpic--;
	if(curpic<0)  curpic=0;
	print();
}

function nextie() {
	curpic++;
	if(curpic>picz.length-1)  curpic=picz.length-1;
	print();
}
