var thisHOST = unescape(location.hostname);
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();

var thisAlbm = unescape(window.location.search);

if (thisHOST == "localhost")
	{
		var rootURL = "http://localhost/";
		var prodURL = "http://www.ccgcreativestudios.com/";
	}
else
	{
		if (thisHOST == "www.ccgcreativestudios.com")
			{
				var rootURL = "http://www.ccgcreativestudios.com/";
				var prodURL = rootURL;
			}
		else
			{
				var rootURL = "http://www.ccgcreations.com/";
				var prodURL = "http://www.ccgcreativestudios.com/";
			}
	};

// alert ('Testing: "' + thisAlbm + '" (Please ignore)'); // "?category=101"

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

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

// ********************************************************************
// *** Wedding and Engagement Photography                           ***
// ********************************************************************
if (thisAlbm == "?category=101")
	{
	document.write('<a class="leftnav-link-main-ON">>> Weddings and Engagements</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'photocart/index.php?category=101" class="leftnav-link-main"><b>Weddings and Engagements</b></a><br>')
	};

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

// ********************************************************************
// *** Family Portrait Photography                                  ***
// ********************************************************************
if (thisAlbm == "?category=102")
	{
	document.write('<a class="leftnav-link-main-ON">>> Family Portrait Gallery</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'photocart/index.php?category=102" class="leftnav-link-main"><b>Family Portrait Gallery</b></a><br>')
	};

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

// ********************************************************************
// *** Senior Portrait Photography                                  ***
// ********************************************************************
if (thisAlbm == "?category=103")
	{
	document.write('<a class="leftnav-link-main-ON">>> Senior Portrait Gallery</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'photocart/index.php?category=103" class="leftnav-link-main"><b>Senior Portrait Gallery</b></a><br>')
	};

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

// ********************************************************************
// *** Concert and Event Photography                                ***
// ********************************************************************
if (thisAlbm == "?category=109")
	{
	document.write('<a class="leftnav-link-main-ON">>> Concert and Event Gallery</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'photocart/index.php?category=109" class="leftnav-link-main"><b>Concert and Event Gallery</b></a><br>')
	};

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

// ********************************************************************
// *** Nature Photography                                           ***
// ********************************************************************
if (thisAlbm == "?category=100")
	{
	document.write('<a class="leftnav-link-main-ON">>> Art and Nature Gallery</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'photocart/index.php?category=100" class="leftnav-link-main"><b>Art and Nature Gallery</b></a><br>')
	};

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

// ********************************************************************
// *** Special Project Photography                                  ***
// ********************************************************************
if (thisAlbm == "?category=105")
	{
	document.write('<a class="leftnav-link-main-ON">>> Special Projects Gallery</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'photocart/index.php?category=105" class="leftnav-link-main"><b>Special Projects Gallery</b></a><br>')
	};

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

// ********************************************************************
// *** Personal Photograph Galleries (password required)            ***
// ********************************************************************
if (thisAlbm == "?do=photocart&action=accessGallery")
	{
	document.write('<a class="leftnav-link-main-ON">>> Private Gallery</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'photocart/index.php?do=photocart&action=accessGallery" class="leftnav-link-main"><b>Private Gallery</b></a><br>')
	};

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

// ********************************************************************
// *** Public Online Photograph Galleries (Using Coppermine)        ***
// ********************************************************************
if (thisPage == "PUBLIC")
	{
	document.write('<a class="leftnav-link-main-ON">>> Public Photo Sharing Site</a><br>')
	}
else
	{
	document.write('<a href="' + prodURL +'galleries/public.html" class="leftnav-link-main"><b>Public Photo Sharing Site</b></a><br>')
	};

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

// ********************************************************************
// *** Present an image if not on the Site Map                      ***
// ********************************************************************
if (URLprefix == "")
	{
	document.write(''
	+ '<p style="FONT-SIZE: 10px; FONT-FAMILY: Verdana; MARGIN-LEFT: 5px; MARGIN-RIGHT: 15px;">'
	+ '<br><br><br><br><img src="\/images\/galleries_framed_falls.jpg" alt="The Beautiful Gooseberry Falls...">'
	+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	+ '<br><br><b>Speak to the earth, and it shall<br>teach thee.<br></b></p>'
	+ '<p style="FONT-SIZE: 10px; FONT-FAMILY: Verdana; MARGIN-LEFT: 5px; FONT-WEIGHT: normal;">'
	+ '-Job 12:8</p>'
	+ '<!-- END LEFT SIDE IMAGE -->');
	};
