//<SCRIPT>

/////////////////////////////////////////////////////////////////////////////////////
// Site Specific Constants
var URL_HOME_PAGE = new String( "http://www.WeddingConcierge.com/index.html" );

/////////////////////////////////////////////////////////////////////////////////////
// General Constants
var NEW_BROWSER_WINDOW = new String( "_blank" );

document.write( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/standard.css\">" );

function LoadHeaders() 
{
	ShowPageHeader();
	ShowDirectory();
	
	return true;
}

function ShowStandardNavigation()
{
	ShowPageHeader();
	ShowDirectory();
}

/////////////////////////////////////////////////////////////////////////////////////
// Main Directory

function ShowTopicHeadingInNavBar( HeadingText )
{
	document.write( "<CENTER><BR><B>" + HeadingText + "</B></CENTER>" );
}

function BasePathIsCurrentPage( PageURL )
{
	var isCurrent = false;
	var URL = new String( "http://www.weddingconcierge.com" + PageURL );
	var Location = new String( document.location.toString() );
	var BaseLocation = new String( Location.substr( 0, URL.length ) );

	if ( BaseLocation.toUpperCase() == URL.toUpperCase() ||
	     BaseLocation.toUpperCase() == URL.toUpperCase() + "INDEX.HTML" ||
	     BaseLocation.toUpperCase() == URL.toUpperCase() + "/INDEX.HTML" )
	{
		isCurrent = true;
	}
	else
	{
		isCurrent = false;
		//document.writeln( URL + "<br/>" + Location.toUpperCase() + "<br/>" );
	}

	return isCurrent;
}

function ShowListingInDirectory( PageTitle, PageURL )
{
	if ( BasePathIsCurrentPage( PageURL ) )
		document.write( "<B>" + PageTitle + "</B><BR>" );
	else
		document.write( "<A HREF='" + PageURL + "' TARGET=_self>" + PageTitle + "</A><BR>" );
}

function ShowDirectory()
{
	document.write( "<TABLE align='left' cellpadding=0 cellspacing=0 bgcolor=#b000b0 border=0 width=16%>" );
	document.write( "		<TR>" );
	document.write( "			<TD colspan=3 align='middle' valign='center' bgcolor=#b000b0><B><FONT COLOR=WHITE>DIRECTORY</FONT></B></TD>" );
	document.write( "		</TR>" );
	document.write( "		<TR>" );
	document.write( "			<TD>&nbsp;</TD>" );
	document.write( "			<TD bgcolor=#f0f0f0 align='middle'>" );

	if ( document.location == "http://www.weddingconcierge.com/index.html" || 
		  document.location == "http://www.weddingconcierge.com/" || 
		  document.location == "http://www.weddingconcierge.com" )
	{
	}
	else
		ShowListingInDirectory( "Home", URL_HOME_PAGE );

	ShowListingInDirectory( "About Us", "/oc/about.html" );
	ShowListingInDirectory( "Cakes and Tops", "/oc/cake/" );
	ShowListingInDirectory( "Catering", "/oc/catering/" );
	ShowListingInDirectory( "Ceremony and <br/>Reception Sites", "/oc/CerSite/" );
	ShowListingInDirectory( "Coordinators and <br/>Consultants", "/oc/consult/" );
	ShowListingInDirectory( "Florists", "/OC/flower/" );
	ShowListingInDirectory( "Gowns", "/oc/Gown/" );
	ShowListingInDirectory( "Honeymoon and Travel", "/oc/travel/" );
	ShowListingInDirectory( "Invitations", "/oc/invite/" );
	ShowListingInDirectory( "Ministers and Officiants", "/oc/Minister/index.html" );
	ShowListingInDirectory( "Musicians and DJ's", "/oc/music/" );
	ShowListingInDirectory( "Photography and Video", "/oc/photo/" );
	ShowListingInDirectory( "Rings", "/oc/Ring/" );
	ShowListingInDirectory( "Transportation", "/oc/Limo/" );
	ShowListingInDirectory( "Tuxedos", "/oc/Tux/" );
	ShowListingInDirectory( "Other Services", "/oc/Other/" );
//	ShowListingInDirectory( "Wedding Links", "/oc/Links/Links.asp" );

	ShowQuickSearch();

	document.write( "			</TD>" );
	document.write( "			<TD>&nbsp;</TD>" );
	document.write( "		</TR>" );
	document.write( "		<TR>" );
	document.write( "			<TD colspan=3 height=2>&nbsp;</TD>" );
	document.write( "		</TR>" );
	document.write( "	</TABLE>" );
}

function ShowQuickSearch()
{
	document.writeln( "<form action=\"/Search.html\" method=\"get\">" );
	document.writeln( "<input type=\"text\" name=\"quicksearch\"/><br/>" );
	document.writeln( "<input type=\"submit\" value=\"Search\"/>" );
	document.writeln( "</form>" );
}

/////////////////////////////////////////////////////////////////////////////////////
// Page Header

function ShowListingInPageHeader( PageTitle, PageURL, IsFinal )
{
	document.write( "<A HREF='" + PageURL + "' TARGET='_self'><nobr>" + PageTitle + "</nobr></A>" );
	
	if ( !IsFinal )
	{
	  document.write( " - " );
	}
}

function ShowPageHeader()
{
	//rgb( 240, 248, 255 ) == #f0f8ff
	var INTERNET_EXPLORER = "Microsoft Internet Explorer";

	if ( navigator.appName == INTERNET_EXPLORER )
	{
		document.writeln( "<table bgcolor=\"#f0f8ff\" width=\"100%\"><tr><td valign=\"top\">" );
	}
	else
	{
		document.writeln( "<table width=\"100%\"><tr><td valign=\"top\">" );
	}
	
	document.writeln( "<TABLE cellpadding=0 cellspacing=0 border=0 width=\"100%\">" );
	document.writeln( "<TR>" );
	document.writeln( "<TD align=left valign=top><A href='http://www.weddingconcierge.com' target='_top'><IMG  border=0 src='/images/SmallLogo.gif'></A></TD>" );
	document.writeln( "<td valign=\"top\" align=\"right\">" );

	document.writeln( "<table>" );
	document.writeln( "<tr>" );
	document.writeln( "<td>" );
	ShowListingInPageHeader( "BridalZine", "/OC/tips/", false );
	ShowListingInPageHeader( "Announcements", "/OC/Registry/list.asp", false );
	ShowListingInPageHeader( "Advertise", "/OC/Sales/", false );
	//ShowListingInPageHeader( "Contact", "/OC/contact/", false );
	document.write( "<a href='mailto:info@weddingconcierge.com'>Contact</a> - " );

	ShowListingInPageHeader( "Search", "/Search.html", true );

	document.writeln( "</td>" );
	document.writeln( "</tr>" );
	document.writeln( "</table>" );
	document.writeln( "</td></tr></table></table>" );

	if ( navigator.appName == INTERNET_EXPLORER )
	{
		document.writeln( "<table bgcolor=\"#f0f8ff\" width=\"100%\"><tr><td valign=\"top\">" );
	}
	else
	{
		document.writeln( "<table width=\"100%\"><tr><td valign=\"top\">" );
	}
	
	document.writeln( "<tr><td><a href='http://www.weddingconcierge.com' target='_top'><img src=\"/images/title.gif\" border=\"0\"></a></td></tr>" );

	if ( navigator.appName == "Microsoft Internet Explorer" )
	{
		document.writeln( "<tr bgcolor=\"#c3e9f9\" height=\"2\"><td colspan=\"3\" valign=\"top\"></td></tr>" );
		document.writeln( "</table>" );
	}
	else
	{
		document.writeln( "</table>" );
		document.writeln( "<hr/>" );
	}

	document.writeln( "</td></tr>" );
	document.writeln( "</table>" );
	
}

/////////////////////////////////////////////////////////////////////////////////////
// Option List

function DisplayNavigationOptionList()
{
	document.writeln( "<HR>" );
	document.writeln( "<P>&nbsp;" );
	document.writeln( "<FORM>" );
	document.writeln( "<CENTER><FONT SIZE = 4 FACE=\"Garamond\">" );
	document.writeln( "Where do you want to go?" );
	document.writeln( "<SELECT>" );
	
	DisplayOption( "CWPC Homepage", "http://www.CWPC.net/index.html" );
	DisplayOption( "About CWPC", "http://www.cwpc.net/about/index.html" );
	DisplayOption( "Contact Us", "http://www.cwpc.net/Contact/index.html" );
	DisplayOption( "Search", "http://www.cwpc.net/Search.html" );
//	DisplayOption( "Wedding Links", "http://www.cwpc.net/Links/Links.asp" );
	DisplayOption( "Engagement Announcements", "http://www.cwpc.net/registry/list.asp" );
	DisplayOption( "Anaheim Chapel", "http://www.cwpc.net/Anaheim/Anaheim.html" );
	DisplayOption( "Chapman Chapel", "http://www.cwpc.net/Chapman/Chapman.html" );
	DisplayOption( "Griffith Chapel", "http://www.cwpc.net/Griffith/Griffith.html" );
	DisplayOption( "Western Weddings", "http://www.cwpc.net/Western/index.html" );
	DisplayOption( "The Crystal Room", "http://www.cwpc.net/CrystalRoom/Index.html" );
	DisplayOption( "Bonnie's Studio Photography and Video", "http://www.cwpc.net/Bonnies/bonnies.html" );
	DisplayOption( "The <em>Everything</em> Package", "http://www.cwpc.net/Everything/Index.html" );
	DisplayOption( "Invitations and Stationery", "http://www.cwpc.net/Invite/index.html" );

	document.writeln( "</SELECT>" );
	document.writeln( "<INPUT TYPE=\"button\" VALUE=\"Go!\" onClick=\"GotoUrl(this.form.elements[0])\">" );
	document.writeln( "</FONT></CENTER></FORM>" );
}

function DisplayOption( PageTitle, PageURL )
{
	if ( !BasePathIsCurrentPage( PageURL ) )
	{
		document.writeln( "<OPTION VALUE=\"" + String( PageURL ) + "\">" + String( PageTitle ) );
	}
}

function GotoUrl( list )
{
	location.href = list.options[list.selectedIndex].value
}

function SlideShow() 
{
	window.location = "index.html"
}

/////////////////////////////////////////////////////////////////////////////////////
//History

function GoBack()
{
  history.back();
}

function BackTwo()
{
  history.go( -2 );
}

/////////////////////////////////////////////////////////////////////////////////////
// SlideShow Navigation

function FileExtension( Path )
{
	var Extension;

	if ( Path.substr( Path.length - 4 ) == "html" )
		Extension = "html";
	else if ( Path.substr( Path.length - 3 ) == "htm" )
		Extension = "htm";
	else if ( Path.substr( Path.length - 3 ) == "asp" )
		Extension = "asp";

	return Extension;			
}		

function BasePath( Path, Extension )
{
	var sPath = new String( Path );
	var sExtension = new String( Extension );

	return Path.substr( 0, sPath.length - sExtension.length - 1 );
}

function SlideNumber( BasePath )
{
	var sNumber = BasePath.substr( BasePath.length - 2, 2 );
	var iNumber = new Number( sNumber );

	return iNumber;
}

function GotoLocation( NewURL )
{
	document.location = NewURL;
}

function ShowButton( Text, NewLocation )
{
	var sText = new String( Text );
	var sNewLocation = new String( NewLocation );

	document.write( "<INPUT TYPE=BUTTON VALUE='" + sText + "' ONCLICK=\"GotoLocation( '" + sNewLocation + "')\">" );
}

function SlideFileName( Base, SlideNumber, Extension )
{
	if ( SlideNumber.length == 1 )
		SlideNumber = "0" + SlideNumber;

	return Base.substr( 0, Base.length - 2 ) + SlideNumber + "." + Extension;	
}

function ShowHomeNavigation( Base, Extension )
{
	ShowButton( "Home Page", URL_HOME_PAGE, NEW_BROWSER_WINDOW );
}

function ShowFirstNavigation( Base, Extension )
{
	ShowButton( "<< First Slide", SlideFileName( Base, "01", Extension ) );
}

function ShowBackNavigation( Base, CurrentSlide, Extension )
{
	var Previous = new String( CurrentSlide - 1 );
	ShowButton( "< Previous Slide", SlideFileName( Base, Previous, Extension ) );
}

function ShowNextNavigation( Base, CurrentSlide, Extension )
{
	var Next = new String( CurrentSlide + 1 );
	ShowButton( "Next Slide >", SlideFileName( Base, Next, Extension ) );
}

function ShowSlideShowNavBar()
{
	var PathName = document.location.toString();
	var Extension = FileExtension( PathName );
	var Base = BasePath( PathName, Extension );
	var CurrentSlide = SlideNumber( Base );

	document.write( "<FORM>" );
	document.write( "<CENTER>" );
	ShowHomeNavigation( Base, Extension );

	if ( CurrentSlide > 2 )
		ShowFirstNavigation( Base, Extension );

	if ( CurrentSlide > 1 )
		ShowBackNavigation( Base, CurrentSlide, Extension );

	ShowNextNavigation( Base, CurrentSlide, Extension );

	document.write( "</CENTER>" );
	document.write( "</FORM>" );
}

function ShowFinalSlideNavBar()
{
	var PathName = document.location.toString();
	var Extension = FileExtension( PathName );
	var Base = BasePath( PathName, Extension );
	var CurrentSlide = SlideNumber( Base );

	document.write( "<FORM>" );
	document.write( "<CENTER>" );
	ShowHomeNavigation( Base, Extension );

	if ( CurrentSlide > 2 )
		ShowFirstNavigation( Base, Extension );

	if ( CurrentSlide > 1 )
		ShowBackNavigation( Base, CurrentSlide, Extension );

	document.write( "</CENTER>" );
	document.write( "</FORM>" );
}

function ShowSlideShowFooter()
{
	document.write( "<FONT SIZE=3>" );
	document.write( "<p>&nbsp;" );
	document.write( "<HR>" );
	ShowSlideShowNavBar();
	document.write( "<P>&nbsp;" );
	document.write( "<P><FONT SIZE=3><CENTER>(c) 2001 The Wedding Concierge" );
	document.write( "</FONT>" );
}

function ShowFinalSlideShowFooter()
{
	document.write( "<FONT SIZE=3>" );
	document.write( "<p>&nbsp;" );
	document.write( "<HR>" );
	ShowFinalSlideNavBar();
	document.write( "<P>&nbsp;" );
	document.write( "<P><FONT SIZE=3><CENTER>(c) 2001 The Wedding Concierge" );
	document.write( "</FONT>" );
}
