
// *************************************************************************************
// This breadcrumbs script created in Feb 2005 by Vivian Black, www.BlacksDesign.com.
// A few parts of this script came from evolt.org, but the script has been almost entirely re-written.

function breadcrumbs(){
	// The key to the breadcrumbs function is the urlTree array.  The 0th element of each array
	// position is the url of every page in the site - a one-to-one mapping. The 1st element is the 
	// url of the parent page. The 3rd element is the actual breadcrumb name you wish to use.  
	// It is critical to load this array properly. Function breadcrumbs identifies the current page, 
	// looks up the currrent page in the urlTree array, extracts the parent page url plus the page's 
	// breadcrumb name, and stores the name in breadCrumbList array.  Function breadcrumbs then starts 
	// looping to find each successive parent page url, putting the url into the breadCrumbsList as it 
	// goes. When function breadcrumbs sees "theEnd" as the parent name, it knows it has reached the
	// root of the tree. Breadcrumbs then stops looping and prints out the array breadCrumbsList.
	
	var COUNT = 0, MAXLOOPS = 100;  // these form the safety break, just in case code goes out of control
	var delimiter = '>';
	var f1 = false
	var treeRoot = "theEnd"; 
	var urlTree = new Array();   // Array should be formed like this: [page url, parent url, breadcrumb name]
	urlTree[0] = ["/", treeRoot, "Home"]; // the zero-th entry should be the root of your tree (home page)
	urlTree[1] = ["about.html", "/", "About Us"];
	urlTree[2] = ["ideas.html", "/", "Ideas"];
	urlTree[3] = ["contact.html", "/", "Contact"];
	urlTree[4] = ["error.html", "/", "Error"];
	urlTree[5] = ["thankyou.html", "/", "Thank You"];
	urlTree[6] = ["viewer/index.html", "/", "Panoramic Image"];
	urlTree[7] = ["viewer/", "/", "Panoramic Image"];
	urlTree[8] = ["silver/index.html", "/", "Silver Artist"];
	urlTree[9] = ["silver/", "/", "Silver Artist"];
	urlTree[10] = ["vivianblack.html", "about.html", "Silver Sculpture"];
	urlTree[11] = ["services.html", "/", "Services"];
	urlTree[12] = ["webdesigns.html", "/", "Portfolio: Selected Web Design Projects"];
	urlTree[13] = ["webapplications.html", "/", "Portfolio: Selected Web-Based Application Projects"];
	urlTree[14] = ["payments/index.html", "/", "Online Payments"];
	urlTree[15] = ["payments/", "/", "Online Payments"];
	urlTree[16] = ["testimonials.html", "/", "Client Testimonials"];
	urlTree[17] = ["notfound.html", "/", "Page not found"]; // make the last one your customized 404 Page Not Found page
	var breadCrumbList = new Array();
	var i = 0, j, k = 0;
	var outputStr = "", parentName = "";
    var urlString = (location.pathname.indexOf('?') != -1) ? location.pathname.substring(0, location.pathname.indexOf('?')) : location.pathname;
        urlString = (location.pathname.charAt(0) == '/') ? location.pathname.substring(1) : location.pathname;
    // var aURL = sURL.split('/');
	
	outputStr = '<A HREF="' + urlTree[0][0] + '">' + urlTree[0][2] + '</A> ' + delimiter + ' ';
	while (i < urlTree.length && !f1) {
		if (urlString == urlTree[i][0]) {
			// get the breadcrumb name and stick it into the list
			breadCrumbList[k] = urlTree[i][2];
			k++;
			// now find the parents of the current page and start building the breadcrumb list
			j = 0;
			parentName = urlTree[i][1];
			while ((j < urlTree.length) && (COUNT < MAXLOOPS)) {
				COUNT++;
				if (parentName == urlTree[j][0]) {
					if (urlTree[j][1] != treeRoot) {
						// we found a parent and we're not at the root of the tree yet; add parent 
						// to breadcrumb list and grab the next parent name to look for
						breadCrumbList[k] = '<A HREF="/' + urlTree[j][0] + '">' + urlTree[j][2] + '</A> ' + delimiter + ' '; 
						k++;
						parentName = urlTree[j][1];
						j = -1;
					} // end if (urlTree)
					else {
						j = urlTree.length;
					} // end else (urlTree)
				} // end if (parentName)
				j++;
			} // end middle while
			// we found the page name so set flag to true to knock ourselves out of the loop
			f1 = true;
		} // end if (urlString)
		i++;
	} // end outer while
	
	// comment out this next if statement if you don't use a customized 404 Page Not Found page
	if (!f1) {
		// we never found the page name - time to generate the 404 not found page
		breadCrumbList[k] = urlTree[urlTree.length - 1][2]; 
	}
	
    // now extract the breadcrumbs out of array breadCrumbList and format for output to HTML
	for (i = breadCrumbList.length - 1; i >= 0; i--) {
		outputStr += breadCrumbList[i];
	} // end for
    document.write(outputStr);
} // end  function breadcrumbs


// ************************************************************************************
var reeferSeal = new Array();  
	reeferSeal[0] = ["webDevelopment1/image1.html"]; 
	reeferSeal[1] = ["webDevelopment1/image2.html"];
	reeferSeal[2] = ["webDevelopment1/image3.html"];
	reeferSeal[3] = ["webDevelopment1/image4.html"];
	reeferSeal[4] = ["webDevelopment1/image5.html"];

function imageGalleryLinks(urlArray){
	// This is a modification of original breadcrumbs function written by Vivian Black, Black's Design,
	// Feb 2005.  This modification builds simple "Next >>" and "<< Previous" links for an image gallery.
	// This version of breadcrumbs needs an input array that defines the pages in the gallery, in order.
	
	var fl = false;
	var i = 0;
	var outputStr = "";
    var urlString = (location.pathname.indexOf('?') != -1) ? location.pathname.substring(0, location.pathname.indexOf('?')) : location.pathname;
        urlString = (location.pathname.charAt(0) == '/') ? location.pathname.substring(1) : location.pathname;

	if (urlString == urlArray[0]) {
			// We have the first page, build only the Next link and set the flag so to avoid the while loop
			outputStr = '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
			outputStr += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
			outputStr += '<a href="/' + urlArray[1] + '">Next &gt;&gt;</a>';
			fl = true;
	} // end if
	else {
		if (urlString == urlArray[urlArray.length-1]) {
			// We have the last page, build only the Previous link and set the flag so to avoid the while loop
			outputStr = '<a href="/' + urlArray[urlArray.length-2] + '">&lt;&lt; Previous</a>';
			outputStr += '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;';
			outputStr += '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
			fl = true;
		} // end inner if
	} // end else if

	while (i < urlArray.length && !fl) {
		
		if (urlString == urlArray[i]) {
			// We have a page in the middle, build both the Next and Previous links
			outputStr = '<a href="/' + urlArray[i-1] + '">&lt;&lt; Previous</a>';
			outputStr += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
			outputStr += '<a href="/' + urlArray[i+1] + '">Next &gt;&gt;</a>';
			fl = true;
		} // end if
		i++;
	} // end outer while
	
	// add Home link
	outputStr += '<br /><br /><a href="../portfolio.html">Return to Portfolio</a>';
    document.write(outputStr);
} // end  function imageGalleryLinks

function LinkOver(obj) {
	 obj.style.color = '#0F0';
	 obj.style.textDecoration = 'none';
}

function LinkOut(obj) {
     obj.style.color = '#009';
	 obj.style.textDecoration = 'none';
}