var n;
var pageslen;

function changePages(m){
n = parseInt(document.forms[0].num.value);
if((m==1)&&(n!=0)){
if (n==pageslen) window.document.images['right'].src = "images/forward.gif";
n=n-2;
if (n==0) window.document.images['left'].src = "images/b.gif";
}

else if((m==2)&&(n!=pageslen)){
if (n==0) window.document.images['left'].src = "images/back.gif";
n=n+2;
if (n==pageslen) window.document.images['right'].src = "images/b.gif";
}

window.document.images['imgleft'].src = root + pages[n] + "_s.jpg"; 
window.document.images['imgright'].src =root +  pages[n+1] + "_s.jpg";
window.document.forms[0].num.value = n;

}

function showImg(m){
if(m==1) window.document.forms[0].img.value = pages[parseInt(window.document.forms[0].num.value)];
else window.document.forms[0].img.value = pages[parseInt(window.document.forms[0].num.value) + 1];
if (window.document.forms[0].img.value != "pusto")  window.document.forms[0].submit();

}

function helpopen(url,w,h){
var t = "resizable=yes,scrollbars=yes,height=" + h + ",width="+ w;
var help= window.open(url,"winhelp", t);
help.focus();
}

function gotofond(url){
if ((window.opener)&&(self.name=='newwin')){
self.close();
}
else location.href = url;
}
