function more (id) {
if (document.getElementById(id).style.display == 'none') {
document.getElementById(id).style.display = 'inline';
document.getElementById(id + "js").style.display = 'none';
}
}

function showone (id, thisi, maxi) {
if (document.getElementById(id + "nav")) {
document.getElementById(id + "nav").style.display = 'block';
document.getElementById(id + "navall").className = 'red';
document.getElementById(id + "fnav").style.display = 'block';
document.getElementById(id + "fnavall").className = 'red';
for (var i = 1; i <= maxi; i++) {
ti = i.toString(10);
if (!document.getElementById(id + ti + "a")) break;
if (i == thisi) {
document.getElementById(id + ti + "a").style.display = 'inline';
document.getElementById(id + ti + "nav").className = 'redbold';
document.getElementById(id + ti + "fnav").className = 'redbold';
} else {
document.getElementById(id + ti + "a").style.display = 'none';
document.getElementById(id + ti + "nav").className = 'red';
document.getElementById(id + ti + "fnav").className = 'red';
}
}
}
}

function showall (id, maxi) {
document.getElementById(id + "nav").style.display = 'block';
document.getElementById(id + "navall").className = 'redbold';
document.getElementById(id + "fnav").style.display = 'block';
document.getElementById(id + "fnavall").className = 'redbold';
for (var i = 1; i <= maxi; i++) {
ti = i.toString(10);
document.getElementById(id + ti + "a").style.display = 'inline';
document.getElementById(id + ti + "nav").className = 'red';
document.getElementById(id + ti + "fnav").className = 'red';
}
}

function shownext (id, maxi) {
thisi = 1;
for (var i = 1; i <= maxi; i++) {
ti = i.toString(10);
if (document.getElementById(id + ti + "a").style.display == 'inline') {
thisi = i;
}
}
if (thisi < maxi) {
thisi += 1;
}
showone (id, thisi, maxi);
}

function showprev (id, maxi) {
thisi = maxi;
for (var i = 1; i <= maxi; i++) {
ti = i.toString(10);
if (document.getElementById(id + ti + "a").style.display == 'inline') {
thisi = i;
}
}
if (thisi > 1) {
thisi -= 1;
}
showone (id, thisi, maxi);
}

function setvis (id, vis) {
document.getElementById(id).style.visibility = vis;
}

function galleryright (id, off) {
var wid = parseInt (document.getElementById(id).style.width, 10);
var w = parseInt (document.getElementById(id+"frame").style.width, 10);
var l = parseInt (document.getElementById(id).style.left, 10);
var destl = l - off;
if (destl < -(wid-w)) destl = -(wid-w);
id1 = id;
of1 = -3;
ds1 = destl;
ac1 = window.setTimeout ("galleryshift()", timeout);
}

function galleryleft (id, off) {
var wid = parseInt (document.getElementById(id).style.width, 10);
var w = parseInt (document.getElementById(id+"frame").style.width, 10);
var l = parseInt (document.getElementById(id).style.left, 10);
var destl = l + off;
if (destl > 0) destl = 0;
id1 = id;
of1 = 3;
ds1 = destl;
ac1 = window.setTimeout ("galleryshift()", timeout);
}

function galleryshift () {
var wid = parseInt (document.getElementById(id1).style.width, 10);
var w = parseInt (document.getElementById(id1+"frame").style.width, 10);
var l = parseInt (document.getElementById(id1).style.left, 10);
var tl;
if (l != ds1) {
l = l + of1;
tl = l.toString(10) + 'px';
document.getElementById(id1).style.left = tl;
}
if (l == 0) {
l = - (wid - w - w - fillwid);
tl = l.toString(10) + 'px';
document.getElementById(id1).style.left = tl;
ds1 = l;
}
if (l == -(wid - w)) {
l = - (w + fillwid);
tl = l.toString(10) + 'px';
document.getElementById(id1).style.left = tl;
ds1 = l;
}
if (of1 > 0) {
if (l >= ds1) {
tl = ds1.toString(10) + 'px';
document.getElementById(id1).style.left = tl;
window.clearTimeout(ac1);
} else {
ac1 = window.setTimeout ("galleryshift()", timeout);
}
} else {
if (l <= ds1) {
tl = ds1.toString(10) + 'px';
document.getElementById(id1).style.left = tl;
window.clearTimeout(ac1);
} else {
ac1 = window.setTimeout ("galleryshift()", timeout);
}
}
}

function popper (id) {
if (document.getElementById(id+'small').style.display == 'none') {
document.getElementById(id+'mid').style.display = 'none';
document.getElementById(id+'small').style.display = 'inline';
document.getElementById(id+'flow').className = 'flowsmall';
} else {
document.getElementById(id+'small').style.display = 'none';
document.getElementById(id+'mid').style.display = 'inline';
document.getElementById(id+'flow').className = 'flowmid';
}
}