var thisURL  = unescape(window.location.pathname);
var currURL  = thisURL.substring(thisURL.lastIndexOf('\/') + 1);
var thisPage = currURL.substring(currURL.lastIndexOf('\\') + 1);
var thisPage = thisPage.substring(0,thisPage.length - 5);
var thisPage = thisPage.toUpperCase();

// ********************************************************************
// *** Site Map Check                                               ***
// ********************************************************************
if (thisPage == "SITEMAP")
	{
	var URLprefix = "photography/"
	}
else
	if (thisPage == "BRIDAL")
		{
		var URLprefix = "/photography/"
		}
	else
		{
		var URLprefix = ""
		};

// ********************************************************************
// *** Left Navigation Header                                       ***
// ********************************************************************
document.write('<span class="leftnav-sectionname">Photography Services</span><br><br>');

// ********************************************************************
// *** All Services Offered                                         ***
// ********************************************************************
if (thisPage == "SERVICES")
	{
	document.write('<a class="leftnav-link-main-ON">>> Complete List of Services</a><br>')
	}
else
	{
	document.write('<a href="' + URLprefix + 'services.html" class="leftnav-link-main">Complete List of Services</a><br>')
	};

// ********************************************************************
// *** Add an extra carriage return if not on the Site Map          ***
// ********************************************************************
if (URLprefix == "" || thisPage == "BRIDAL")
	{
	document.write('<br>');
	};

// ********************************************************************
// *** CREATE AND CELEBRATE - Studio Services                       ***
// ********************************************************************
if (thisPage == "STUDIO-SERVICES")
	{
	document.write('<a class="leftnav-link-main-ON">>> Photography Services</a><br>')
	StudioMenu()
	}
else
	{
	document.write('<a href="' + URLprefix + 'studio-services.html" class="leftnav-link-main">Photography Services</a><br>')

	// ****************************************************************
	// *** If one of the Studio Pages, write the Studio Menu        ***
	// ****************************************************************

	if (thisPage.indexOf("WEDDING") == 0 || thisPage.indexOf("EVENTS") == 0 || thisPage.indexOf("PORTRAITS") == 0 || thisPage.indexOf("SPORTS") == 0 || thisPage.indexOf("NATURE") == 0 || thisPage == "BRIDAL")
		{
		StudioMenu()
		}
	};

// ********************************************************************
// *** Add an extra carriage return if not on the Site Map          ***
// ********************************************************************
if (URLprefix == "" || thisPage == "BRIDAL")
	{
	document.write('<br>');
	};

// ********************************************************************
// *** RESTORE AND CORRECT - Restoration Services                   ***
// ********************************************************************
if (thisPage == "RESTORE-SERVICES")
	{
	document.write('<a class="leftnav-link-main-ON">>> Restoration Services</a><br>')
	RestoreMenu()
	}
else
	{
	document.write('<a href="' + URLprefix + 'restore-services.html" class="leftnav-link-main">Restoration Services</a><br>')

	// ****************************************************************
	// *** If one of the Restoration Pages, write the Restore Menu  ***
	// ****************************************************************

	if (thisPage.indexOf("RESTORE") == 0 || thisPage.indexOf("CORRECT") == 0 || thisPage.indexOf("TIME") == 0)
		{
		RestoreMenu()
		}
	};

// ********************************************************************
// *** Add an extra carriage return if not on the Site Map          ***
// ********************************************************************
if (URLprefix == "" || thisPage == "BRIDAL")
	{
	document.write('<br>');
	};

// ********************************************************************
// *** PRESERVE AND PRESENT - Preservation Services                 ***
// ********************************************************************
if (thisPage == "PRESERVE-SERVICES")
	{
	document.write('<a class="leftnav-link-main-ON">>> Show it Off!</a><br>')
	PreserveMenu()
	}
else
	{
	document.write('<a href="' + URLprefix + 'preserve-services.html" class="leftnav-link-main">Show it Off!</a><br>')

	// ****************************************************************
	// *** If one of the Preservation Pages, write Preserve Menu    ***
	// ****************************************************************

	if (thisPage.indexOf("MEDLEY") == 0 || thisPage.indexOf("FRAMING") == 0 || thisPage.indexOf("MEMORIES") == 0)
		{
		PreserveMenu()
		}
	};

// ********************************************************************
// *** Add an extra carriage return if not on the Site Map          ***
// ********************************************************************
if (URLprefix == "" || thisPage == "BRIDAL")
	{
	document.write('<br>');
	};

// ********************************************************************
// *** PRICING - Pricing for All Services                           ***
// ********************************************************************
if (thisPage == "PRICING")
	{
	document.write('<a class="leftnav-link-main-ON">>> Prices and Packages</a><br>')
	}
else
	{
	document.write('<a href="' + URLprefix + 'pricing.html" class="leftnav-link-main">Prices and Packages</a><br>')
	};

// ********************************************************************
// *** Add an extra carriage return if not on the Site Map          ***
// ********************************************************************
if (URLprefix == "" || thisPage == "BRIDAL")
	{
	document.write('<br>');
	};

// ********************************************************************
// *** Present an image if not on the Site Map                      ***
// ********************************************************************
if (URLprefix == "" || thisPage == "BRIDAL")
	{
	document.write(''
	+ '<p style="MARGIN-LEFT: 5px; MARGIN-RIGHT: 15px;">'
	+ '<br><img src="\/images\/photo_framed_tree.jpg" alt="Nature gnarled this tree in Arizona...">'
	+ '<br><br>Nature gives to every time and season some beauties of its own.<br></p>'
	+ '<p style="MARGIN-LEFT: 5px; FONT-WEIGHT: normal;">'
	+ '-Charles Dickens</p>'
	+ '<br><br><!-- END LEFT SIDE IMAGE -->');
	};

// --------------------------------------------------------------------

// ********************************************************************
// ********************************************************************
// ********************************************************************
// ***                                                              ***
// ***                                                              ***
// ***             SUBMENU FUNCTIONS START HERE                     ***
// ***                                                              ***
// ***                                                              ***
// ********************************************************************
// ********************************************************************
// ********************************************************************

// --------------------------------------------------------------------

// ********************************************************************
// *** Create the Studio Services Submenu when needed               ***
// ********************************************************************
function StudioMenu() {

	// ********************************************************************
	// *** Wedding Photography                                          ***
	// ********************************************************************
	if (thisPage == "WEDDING")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Wedding Photography</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'wedding.html" class="leftnav-link-sub">Wedding Photography</a><br>')
		};

	// ********************************************************************
	// *** Portrait Photography                                         ***
	// ********************************************************************
	if (thisPage == "PORTRAITS")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Portrait Photography</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'portraits.html" class="leftnav-link-sub">Portrait Photography</a><br>')
		};

	// ********************************************************************
	// *** Event Photography                                            ***
	// ********************************************************************
	if (thisPage == "EVENTS")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Concert and Event Photography</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'events.html" class="leftnav-link-sub">Concert and Event Photography</a><br>')
		};

	// ********************************************************************
	// *** Sports Team Photography                                      ***
	// ********************************************************************
	if (thisPage == "SPORTS")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Sports Team Photography</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'sports.html" class="leftnav-link-sub">Sports Team Photography</a><br>')
		};

	// ********************************************************************
	// *** Artistic Nature Photography                                  ***
	// ********************************************************************
	if (thisPage == "NATURE")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Art and Nature Photography</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'nature.html" class="leftnav-link-sub">Art and Nature Photography</a><br>')
		};

}

// --------------------------------------------------------------------

// ********************************************************************
// *** Create the Restoration Services Submenu when needed          ***
// ********************************************************************
function RestoreMenu() {

	// ********************************************************************
	// *** Photograph and Document Restoration                          ***
	// ********************************************************************
	if (thisPage == "RESTORE")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Photo and Document Restoration</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'restore.html" class="leftnav-link-sub">Photo and Document Restoration</a><br>')
		};

	// ********************************************************************
	// *** Color Correction                                             ***
	// ********************************************************************
	if (thisPage == "CORRECT")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Color Correction</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'correct.html" class="leftnav-link-sub">Color Correction</a><br>')
		};

	// ********************************************************************
	// *** Time "Machine" Tools                                         ***
	// ********************************************************************
	if (thisPage == "TIME")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Time Machine</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'time.html" class="leftnav-link-sub">Time Machine</a><br>')
		};

}

// --------------------------------------------------------------------

// ********************************************************************
// *** Create the Preservation Services Submenu when needed         ***
// ********************************************************************
function PreserveMenu() {

	// ********************************************************************
	// *** Photo Medley on CD or DVD                                    ***
	// ********************************************************************
	if (thisPage == "MEDLEY")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Photo Medley on DVD</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'medley.html" class="leftnav-link-sub">Photo Medley on DVD</a><br>')
		};

	// ********************************************************************
	// *** Matting and Framing                                          ***
	// ********************************************************************
	if (thisPage == "FRAMING")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Matting and Framing</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'framing.html" class="leftnav-link-sub">Matting and Framing</a><br>')
		};

	// ********************************************************************
	// *** Scrapbooking                                                 ***
	// ********************************************************************
	if (thisPage == "MEMORIES")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Scrapbooking</a><br>')
		}
	else
		{
		document.write('<a href="' + URLprefix + 'memories.html" class="leftnav-link-sub">Scrapbooking</a><br>')
		};

	// ********************************************************************
	// *** Photo-to-Art                                                 ***
	// ********************************************************************
	if (thisPage == "MYPHOTOART")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Photo-to-Art</a><br>')
		}
	else
		{
		document.write('<a href="' + rootURL + 'photo-to-art/myphotoart.html" class="leftnav-link-sub">Photo-to-Art</a><br>')
		};

	// ********************************************************************
	// *** Photo Products                                               ***
	// ********************************************************************
	if (thisPage == "PRODUCTS")
		{
		document.write('<a class="leftnav-link-sub-ON">>> Photo Products</a><br>')
		}
	else
		{
		document.write('<a href="' + rootURL + 'photo-to-art/products.html" class="leftnav-link-sub">Photo Products</a><br>')
		};

}

