// JavaScript Document

function goNewPage(whichDirection) {
		var currentPage = getShortLocation();
		var seriesList = new Array()
		seriesList[0]="index.html"
		seriesList[1]="wave.html"
		seriesList[2]="crowded01.html"
		seriesList[3]="libeautiful.html"
		seriesList[4]="crowded03.html"
		seriesList[5]="h_grace.html"
		seriesList[6]="mary_jesus.html"
		seriesList[7]="crowded02.html"
		seriesList[8]="bberrybush.html"
		seriesList[9]="kathleen.html"
		seriesList[10]="lovegrows.html"
		seriesList[11]="cosmo.html"
		for (var i = 0; i < seriesList.length; i++) {
			if (seriesList[i]==currentPage) {
				break;
			}
		}
		if (whichDirection=="next") {
			if (i==(seriesList.length)-1) {
				i=0;
			} else {
				i=i+1
			}
		} else {
			if (i==0) {
				i=(seriesList.length-1)
			} else {
				i=i-1;
			}
		}
		self.document.location.href=seriesList[i];
	}
	
function goPressPage(whichDirection) {
		var currentPage = getShortLocation();
		var seriesList = new Array()
		seriesList[0]="press1.html"
		seriesList[1]="press2.html"
		seriesList[2]="press3.html"
		for (var i = 0; i < seriesList.length; i++) {
			if (seriesList[i]==currentPage) {
				break;
			}
		}
		if (whichDirection=="next") {
			if (i==(seriesList.length)-1) {
				i=0;
			} else {
				i=i+1
			}
		} else {
			if (i==0) {
				i=(seriesList.length-1)
			} else {
				i=i-1;
			}
		}
		self.document.location.href=seriesList[i];
	}
	
function getShortLocation(){
		var myString = self.document.location + "";
		var myArray = myString.split("/");
		var myResult = myArray[myArray.length-1];
		if (myResult == ""){
			return "index.html";
		} else {
			return myResult;
		}
	}
	
function toggleNextById(el) {
 		var ccn="clicker";
		var clicker=document.getElementById(el);
 		clicker.className+=" "+ccn;
 		clicker.onclick=function() {toggleNext(this)}
 		toggleNext(clicker);
	}

function toggleNext(el) {
 		var next=el.nextSibling;
		while(next.nodeType != 1) next=next.nextSibling;
		next.style.display=((next.style.display=="none") ? "block" : "none");
		
	}
	
function showImageDiv(whichURL,whichTitle){
		var myDiv=document.getElementById("myFloater");
		document.images["floaterImage"].src = "images/spacer.gif";
		//clear out the old image first
		document.images["floaterImage"].src = whichURL;
		document.getElementById('paintingTitle').innerHTML = whichTitle;
		myDiv.style.top="-1300px";
		myDiv.style.height="1300px";
		myDiv.style.display="block";
		document.location.href="#topOfPage";
	}

function doHideDiv(){
		var myDiv=document.getElementById("myFloater");
		myDiv.style.display="none";
		window.back();
	}
	
function showClippingDiv(whichURL){
		var myDiv=document.getElementById("myFloater");
		document.images["floaterImage"].src = "images/spacer.gif";
		//clear out the old image first
		document.images["floaterImage"].src = whichURL;
		document.getElementById('paintingTitle').innerHTML = "";
		myDiv.style.top="-900px";
		myDiv.style.height="1000px";
		myDiv.style.display="block";
		document.location.href="#topOfPage";
	}

function goContactPage(){
		document.location.href="contact.html";
	}