function addBananAlbum() {
tmpbgcolor = bgcolor.replace("#","0x");
tmplinecolor = linecolor.replace("#","0x");
tmpimgcolor = imgcolor.replace("#","0x");

 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="bananalbum"><param name="movie" value="'+respath+'BananAlbum.swf?browser=true&bgcolor='+tmpbgcolor+'&imgcolor='+tmpimgcolor+'&linecolor='+tmplinecolor+addvars+'" /><param name="loop" value="false" /><param name="quality" value="best" /><PARAM NAME=bgcolor VALUE='+bgcolor+'><param name="allowFullScreen" value="true" /><embed src="'+respath+'BananAlbum.swf?browser=true&bgcolor='+tmpbgcolor+'&imgcolor='+tmpimgcolor+'&linecolor='+tmplinecolor+addvars+'" loop="false" quality="best" bgcolor='+bgcolor+' allowFullScreen="true" width="100%" height="100%" name="bananalbum" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

function downloadURL(theURL) {
	w = 240;
	h = 180;
	x = (screen.width-w)/2;
	y = (screen.height-h)/2;
	downloadWin = window.open(theURL,"BananAlbum","status=yes,toolbar=no,resizable=yes,scrollbars=yes,location=no,menubar=no,left="+x+",top="+y+",width="+w+",height="+h+"");
window.focus();
}

download = 0;
function downloadWin(theURL) {
	image = theURL;
	w = 240;
	h = 180;
	download = download+1;
	border = 36;
	x = (screen.width-w)/2;
	y = (screen.height-h)/2;
	window._w = window.open(window.respath+"download.html?image="+theURL,"BananAlbum"+download,"status=no,toolbar=no,resizable=no,scrollbars=yes,location=no,menubar=no,left="+x+",top="+y+",width="+w+",height="+h+"");
	window._w.image = theURL;
}
function movieWin(theURL) {
	movie = theURL;
	w = 740;
	h = 580;
	download = download+1;
	x = (screen.width-w)/2;
	y = (screen.height-h)/2;
	window._w = window.open(theURL,"BananAlbum"+download,"status=yes,toolbar=no,resizable=yes,scrollbars=yes,location=no,menubar=no,left="+x+",top="+y+",width="+w+",height="+h+"");
}
function resizeWin(image) {
		var detect = navigator.userAgent.toLowerCase();
		correctW = 8;
		correctH = screen.height-screen.availHeight;
		if (image.width<screen.availWidth && image.height<screen.availHeight) {
			newWidth = image.width;
			newHeight = image.height;
		} else {
			screenWH = screen.availWidth/(screen.availHeight-correctH);
			imageWH = image.width/image.height;
			if (screenWH>imageWH) {
				// use height...
				newHeight = screen.availHeight-border-correctH;
				newWidth = newHeight*imageWH;
			} else {
				// use width...
				newWidth = screen.availWidth-border;
				newHeight = newWidth/imageWH;
			}
		}
	if (document.all) {								// IE
		if (navigator.appVersion.indexOf("Mac")>-1){
			window._w.moveTo((screen.width-newWidth)/2,(screen.height-newHeight)/2-correctH);
			window._w.resizeTo(newWidth,newHeight-1);
		} else {
			window._w.moveTo((screen.width-newWidth)/2,(screen.height-newHeight-correctH)/2);
			window._w.resizeTo(newWidth+correctW,newHeight+correctH);
		}
	} else {										// Mozilla
		if (navigator.appVersion.indexOf("Mac")>-1){
			if (detect.indexOf("safari")>-1) {
				window._w.moveTo((screen.width-newWidth)/2,(screen.height-newHeight)/2);
				window._w.resizeTo(newWidth,newHeight+correctH);
			} else {
				window._w.moveTo((screen.width-newWidth)/2,(screen.height-newHeight)/2-correctH);
				window._w.resizeTo(newWidth+correctW,newHeight);
				// one more time for FireFox!
				window._w.moveTo((screen.width-newWidth)/2,(screen.height-newHeight)/2-correctH);
			}
		} else {
			window._w.moveTo((screen.width-newWidth)/2,(screen.height-newHeight+correctH)/2-correctH);
			window._w.resizeTo(newWidth+correctW,newHeight+correctH);
		}	}
}
function showDiv() {
	document.getElementById('imgShow').style.visibility="visible";
}

// Fully accessible collapsible outlines. JavaScript code
// copyright 2007, Boutell.Com, Inc.
//
// See http://www.boutell.com/newfaq/ for more information.
//
// Permission granted to use, republish, sell and otherwise
// benefit from this code as you see fit, provided you keep
// this notice intact. You may remove comments below this line.
//
// END OF NOTICE
//
// INSTRUCTIONS: this WON'T WORK unless you do the following in the
// document that includes it:
//
// 1. In the <head> element of your page, bring in this code:
//
//    <script src="resizing_background.js">
//    </script>
//
// 2. Call outlineInit() from your onLoad handler:
//
//    <body onLoad="outlineInit()">
//
//    If you need other code in onLoad, that's fine. Just separate the
//    calls with semicolons ( ; ).
//
// 3. To create your outline, write a nested list with the 
//    <ul>... <li>...</li>...  </ul> elements as you normally would.
//    Make sure the TOP <ul> element is a member of the outline class.
//    DO NOT assign the outline class to any nested <ul> elements beneath.
//
//    THIS IS THE RIGHT WAY:
//
//    <ul class="outline">
//      <li>Item One
//        <ul> <!-- This ul does NOT get class="outline" -->
//          <li>Subitem One</li>
//        </ul> 
//      </li>
//      Et cetera...
//    </ul>
//
// 4. That's it! You're good to go. Yes, really.

var outlineItems = new Array();

function outlineInit()
{
	var elements = outlineGetTopLevelLists();
	for (var i = 0; (i < elements.length); i++) {
		outlineInitOutline(elements[i]);
	}		
}

function outlineInitOutline(outline)
{
	var kids = outline.childNodes;
	for (var i = 0; (i < kids.length); i++) {
		var kid = kids[i];
		if (kid.nodeName == "LI") {
			outlineInitItem(kid);
		}
	}
}

function outlineInitItem(item)
{
	var kids = item.childNodes;
	var hasKids = false;
	var outlines = new Array();
	for (var i = 0; (i < kids.length); i++) {
		var kid = kids[i];	
		if (kid.nodeName == "UL") {
			kid.style.display = "none";
			outlineInitOutline(kid);
			hasKids = true;
			outlines[outlines.length] = kid;
		}
	}
	if (hasKids) {
		item.style.cursor = "pointer";
		var len = outlineItems.length;
		outlineItems[len] = item;
		// We can't just modify item.innerHTML, because that would
		// invalidate JavaScript objects that already refer to
		// other elements in the outlineItems array. So we use
		// the clunky DOM way of creating a span element. Then we
		// tuck the "a" element inside it so we can use
		// innerHTML for that and avoid various IE bugs.
		var span = document.createElement("span");
		span.innerHTML = "<a href='#' " +
			"onClick='outlineItemClickByOffset(" + len + 
			"); return false' " +
			"class='olink'>" +
			"<img class='oimg' alt='+' src='/images/open.jpg'></a>";
		item.insertBefore(span, kids[0]);
		item.onclick = outlineItemClick;
	}
}

function outlineGetTarget(evt)
{
	var target;
        if (!evt) {
                // Old IE
                evt = window.event;
        }
	// Prevent double event firing (sigh)
	evt.cancelBubble = true;
	if (evt.stopPropagation) {
		evt.stopPropagation();
	}
        var target = evt.target;
        if (!target) {
                // Old IE
                target = evt.srcElement;
        }
	return target;
}

function outlineItemClickByOffset(id)
{
	outlineItemClickBody(outlineItems[id]);
}

function outlineItemClick(evt)
{
	target = outlineGetTarget(evt);
	outlineItemClickBody(target);
}

function outlineItemClickBody(target)
{
	var closed = true;
	var kids = target.childNodes;
	var hasKids = false;
	for (var i = 0; (i < kids.length); i++) {
		var kid = kids[i];	
		if (kid.nodeName == "UL") {
			if (kid.style.display == "none") {
				kid.style.display = "block";
			} else {	
				kid.style.display = "none";
				closed = false;
			}
			hasKids = true;
		}
	}
	if (!hasKids) {
		// We're here because of a click on a
		// childless node. Ignore that.
		return;
	}	
	var img = outlineGetImg(target);
	if (closed) {
		// We've just opened it, show close button
		img.src = "/images/close.jpg";
		img.alt = "-";
	} else {
		img.src = "/images/open.jpg";
		img.alt = "+";
	}
}
	
function outlineGetImg(target)
{
	return outlineGetDescendantWithClassName(target, "oimg");
}

function outlineGetDescendantWithClassName(parent, cn)
{
	// Regular expression: beginning with class name, or
	// class name preceded by a space; and ending with class name, or
	// class name followed by a space. Covers the ways a single class
	// name can appear with or without others in the className attribute.
	var elements = parent.childNodes;
	var length = elements.length;
	var i;
	var regexp = new RegExp("(^| )" + cn + "( |$)");
	for (i = 0; (i < length); i++) {
		if (regexp.test(elements[i].className)) {
			return elements[i];
		}
		var result = outlineGetDescendantWithClassName(
			elements[i], cn);	
		if (result) {
			return result;
		}
	}
	return null;
}

function outlineGetTopLevelLists()
{
	// Regular expression: beginning with class name, or
	// class name preceded by a space; and ending with class name, or
	// class name followed by a space. Covers the ways a single class
	// name can appear with or without others in the className attribute.
	var cn = "outline";
	var elements = document.getElementsByTagName("ul");
	var length = elements.length;
	var i;
	var regexp = new RegExp("(^| )" + cn + "( |$)");
	var results = new Array();
	for (i = 0; (i < length); i++) {
		if (regexp.test(elements[i].className)) {
			results.push(elements[i]);
		}
	}
	return results;
}
