if (window.self != window.top) window.top.location = window.self.location; //break any frame pirates...

function makeScrollButtons() {
if (document.getElementById("smallColumn")) {

smallCol = document.getElementById("smallColumn");// find the side column...
smallColHgt = smallCol.offsetHeight; // find the height of that col...
smallColWdt = smallCol.offsetWidth; // find the height of that col...
portHgt = document.documentElement.clientHeight || window.innerHeight;// find current viewport height...
scrollHgt = document.body.scrollHeight; // find total body height...
upButton= false;

firstDiv = smallCol.getElementsByTagName("DIV")[0];

if ((firstDiv.className == "thumb-pop-parent") && (!upButton)) { // checks for thumbs and makes arrows if needed...

	buttonHolder = document.createElement("div");
	buttonHolder.id = "buttonHolder"; // This button goes at the top...

	upButton = document.createElement("div");
	upButton.id = "upbutton"; // This button goes at the top...
	upButton.onmouseover = scrollSmallColUp; 
	upButton.onmouseout = scrollSmallColStop; 
	upButton.style.visibility = "hidden"; // arrows hidden by default...

	downButton = document.createElement("div");
	downButton.id = "downbutton"; // This button goes at the bottom...
	downButton.onmouseover = scrollSmallColDown; 
	downButton.onmouseout = scrollSmallColStop; 
	downButton.style.visibility = "hidden"; // arrows hidden by default...

	smallCol.appendChild(buttonHolder);
	buttonHolder.appendChild(upButton);
	buttonHolder.appendChild(downButton);
} 
	
if (firstDiv.className != "thumb-pop-parent") {
		smallCol.style.width = smallColWdt + 31 + 'px'; // if no thumbs, widen col to fill in where arrows aren't shown.
		smallCol.style.left = "-5px"; // ..and move the col to the left by the same amount.
}

if ((smallColHgt + 150) > portHgt) { // show arrows if arrow-scrolling is possible...
		upButton.style.visibility = "visible"; 
		downButton.style.visibility = "visible"; 
}

if (smallCol.currentStyle) { // sets colTop to smallCol top value, as a string: "XXXpx"...
	colTop = smallCol.currentStyle.top;
	} else if (window.getComputedStyle) {
		colTop = window.getComputedStyle(smallCol, "").top;
		} else { return;
} 

// now colTop gets the "px" is shaved off, is converted to a number, which is permanently saved in colTopSave...
var j = colTop.indexOf("p");
colTop = colTop.substring(0,j);
colTopSave = colTop = parseInt(colTop);

}
}// end makeScrollButtons


function scrollSmallColUp() {
	scrollInt = setInterval("scrollUp()", 30);
	}

function scrollSmallColDown() {
	scrollInt = setInterval("scrollDown()", 30);
	}

function scrollUp() {
	offsetNum = smallColHgt + colTop - portHgt; 

	if (offsetNum < 0) {
		scrollSmallColStop();
		return; }

	colTop = colTop - 15;  // sets px jumps for scrolling up...
	smallCol.style.top = colTop + "px";
}

function scrollDown() {

	if (colTop >= colTopSave) {
		scrollSmallColStop();
		return; }

	colTop = colTop + 15; // sets px jumps for scrolling down... 
	smallCol.style.top = colTop + "px";	
}

function scrollSmallColStop() {
	clearInterval(scrollInt);
	}

// call getElementsByClass() function with quoted target class as argument; will only work for divs. 
function getElementsByClass(tokenClass) {
	var        spacedClass = " " + tokenClass + " ";
    var         my_array = document.getElementsByTagName("DIV");
	var         retvalue = new Array();
    var        i;
    var        j;
    for (i = 0, j = 0; i < my_array.length; i++)
        {
        var c = " " + my_array[i].className + " ";
        if (c.indexOf(spacedClass) != -1)
        retvalue[j++] = my_array[i];
		}
    return retvalue;
    }




window.onload = function() {
	makeScrollButtons(); // builds hover-arrows for scrolling of thumb-links...
	} // these functions run on page load...

