/* Universal Thumb */

function adjust10(n) {
if(n<10) y = "0" + n;
else y = n;
return(y);
}

function unithumb(mode,fn,width,height) {

switch(mode) {

case "f": pref = ""; ext = ".jpg"; // photo
dirId = fn.substring(0,1);
imgId = fn.substring(1);
switch(dirId) {
case "b": dirIdmod = "brody"; break;
case "c": dirIdmod = "contrib"; break;
case "h": dirIdmod = "hrycak"; break;
case "l": dirIdmod = "lazurko"; break;
case "m": dirIdmod = "melnyk"; break;
case "o": dirIdmod = "ovad"; break;
case "r": dirIdmod = "ren"; break;
case "s": dirIdmod = "schule"; break;
case "v": dirIdmod = "veryha"; break;
case "w": dirIdmod = "heike"; break;
}
infun = " href=\"#view\" onclick=\"fview('" + dirIdmod + "','" + imgId + "')\"";
break;

case "m": pref = "map"; ext = ".gif";
fn = adjust10(fn);
infun = " target=\"map\" href=\"map" + fn + ".html\"";
break;

case "p": pref = "poster"; ext = ".jpg";
fn = adjust10(fn);
infun = " href=\"#view\" onclick=\"ViewPoster('" + fn + "');\"";
break;

case "s": pref = "scheme"; ext = ".gif";
infun = " target=\"scheme\" href=\"scheme" + fn + ".html\"";
break;

}

/* document.write("<table cellspacing=1 cellpadding=0 bgcolor=black><tr>"
+ "<td width=" + width + " height=" + height + " bgcolor=fdfdfd background=\""
+ pref + fn + ext + "\"><a" + infun + "><img src=\"../std.gif\" "
+ "width=" + width + " height=" + height + " title=\"збільшити\" border=0></a></td>"
+ "</tr></table>"); */

document.write("<table cellspacing=1 cellpadding=0 bgcolor=black><tr>"
+ "<td width=" + width + " height=" + height + " bgcolor=fdfdfd><a"
+ infun + "><img src=\"" + pref + fn + ext + "\" width=" + width + " height="
+ height + " title=\"збільшити\" border=0></a></td></tr></table>");

}
