﻿// wld_core.js: Copyright 2001-2004 tabitabitabi.com, All Rights Reserved//----------------------------------------------------------------------------// Global variables//----------------------------------------------------------------------------	var gMenuN = new Array(6);	var gMenuH = new Array(6);	var gMenuS = new Array(6);	var gMenuCount = 6;	var gDepth = 0;	var gMenuWidth = [90, 54, 110, 77, 440, 29];	var gMenuHREF = ["../index.html", "travelogue/index.html", "discover/index.html", "tools/index.html", "", "mailto:admin@tabitabitabi.com"];	var gPathPrefix = "";	var gPageIndex = 0;					// Automatically set in asb_Initialize()	var gPhotoIndex = 0;	var gMultiLevelMenu = 0;//	var gPageType = 0;					// Defined in "PageData" file; 0 = 000.html based multi-page set; 1 = "No intro" multi-page set starting with 001.htm//	var gPageData = [];					// Defined in "PageData" file; defines pages set and popup item names and links//	var	gTextList = new Array();			// Defined in "PageData" file, along with each array element for photo description text//===================================================================================================================//================================================ CORE FUNCTIONS =====================================================//===================================================================================================================//----------------------------------------------------------------------------// asb_Initialize//----------------------------------------------------------------------------// This function creates path prefix based on depth of web page and set page index for multi-page document.// - inDepth: Depth from the root of the web site hierarchy at which the //	 calling web page resides.//----------------------------------------------------------------------------function asb_Initialize( inDepth, inMultiLevelMenu ) {	gDepth = inDepth;	gMultiLevelMenu = inMultiLevelMenu;	gPathPrefix = U_GetPathDepth( inDepth );	if ( typeof gPageData != "undefined" ) {		if ( gPageData.length ) {								// If it's a multi-page document			var docName = U_FindDocName( document.URL );				gPageIndex = U_NameToPageIndex( docName );			}	}	if ( typeof gPhotoCount != "undefined" ) {		gPhotoIndex = (gPageIndex - 1) * gPhotoCount + 1;			}}//----------------------------------------------------------------------------// asb_LoadMenuImages//----------------------------------------------------------------------------// This function caches all necessary menu images.//----------------------------------------------------------------------------function asb_LoadMenuImages( inMenuIndex ) {	for (i=0; i<gMenuCount; i=i+1) {		gMenuN[i] = gPathPrefix + "n/n" + i + ".gif"		gMenuH[i] = gPathPrefix + "n/h" + i + ".gif"	}	gMenuS[inMenuIndex] = gPathPrefix + "n/s" + inMenuIndex + ".gif"}//----------------------------------------------------------------------------// asb_GenerateStdPhotoPage//----------------------------------------------------------------------------function asb_GenerateStdPhotoPage( inMenuIndex, inTitleWidth, inTitleHeight, inPhotoStartIndex, inPhotoCount, inPhotoWidth ) {	asb_GenerateNavigation(inMenuIndex);					// Nav menu at the top of the page	asb_GenerateTitle(inTitleWidth, inTitleHeight);				// Title and page popup	asb_GenerateContentPhotoList(inPhotoStartIndex, inPhotoCount, inPhotoWidth );	// Page body - photo and text	asb_GenerateNextPrevControls();						// Nex/Prev 	asb_GenerateFooter();								// Text nav menu, copyright}//----------------------------------------------------------------------------// asb_GenerateNavigation//----------------------------------------------------------------------------// This function generates the navigation menu for the top of the page.// It is called by individual web pages at the beginning of page loading.// - inMenuIndex: Must be between 0 and 4, corresponding to selected menu item //----------------------------------------------------------------------------function asb_GenerateNavigation( inMenuIndex ) {	asb_LoadMenuImages( inMenuIndex );	// First write open the stream to the document and write out top level table	document.open("text/html");	document.writeln('<P><CENTER><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>');	document.writeln('<TR>');		// Now loop through each menu item and write selected (sl) or unselected (nm) images with right rollover (hi)	for (i=0; i<gMenuCount; i=i+1)	{		document.writeln('<TD WIDTH=' + gMenuWidth[i] + '>');		if ( i == inMenuIndex ) {					// Need to put "selected" image without rollover			document.writeln('<P><A HREF=' + gPathPrefix + gMenuHREF[i] + ' TARGET="_top"><IMG SRC=' + gMenuS[i] + ' WIDTH=' + gMenuWidth[i] + ' HEIGHT=46 BORDER=0 NAME="menuImage' + i + '"' + ' ALIGN=bottom></A></P>');		} 		else {								// Write out "unselected" image with "hilite" rollover			if ( i == (gMenuCount-2) ) {			// special case the the blank space between menus and "mail-to" icon, which doesn't have HREF				document.writeln('<P><IMG SRC=' + gMenuN[i] + ' WIDTH=' + gMenuWidth[i] + ' HEIGHT=46 BORDER=0 NAME="menuImage' + i + '"' + ' ALIGN=bottom></P>');			}			else if ( i == gMenuCount-1 ) {		// "mail-to" icon				document.writeln('<P><A HREF=' + gMenuHREF[i] + ' onClick="document.menuImage' + i + '.src=' + "'" + gMenuN[i] + "'"  + '" onMouseOver="document.menuImage' + i + '.src=' + "'" + gMenuH[i] + "'" + '" onMouseOut="document.menuImage' + i + '.src=' + "'" + gMenuN[i] + "'" + '"><IMG SRC=' + gMenuN[i] + ' WIDTH=' + gMenuWidth[i] + ' HEIGHT=46 BORDER=0 NAME="menuImage' + i + '"' + ' ALIGN=bottom></A></P>');			}			else {				document.writeln('<P><A HREF=' + gPathPrefix + gMenuHREF[i] + ' onClick="document.menuImage' + i + '.src=' + "'" + gMenuN[i] + "'; window.open('" + gPathPrefix + gMenuHREF[i] + "', '_top')" + '"' + ' onMouseOver="document.menuImage' + i + '.src=' + "'" + gMenuH[i] + "'" + '"' + ' onMouseOut="document.menuImage' + i + '.src=' + "'" + gMenuN[i] + "'" + '"' + ' TARGET="_top"><IMG SRC=' + gMenuN[i] + ' WIDTH=' + gMenuWidth[i] + ' HEIGHT=46 BORDER=0 NAME="menuImage' + i + '"' + ' ALIGN=bottom></A></P>');			}		}		document.writeln('</TD>');	}	// Finally write up the rest of the page	document.writeln('</TR>');	document.writeln('<TR><TD colspan=7><img src="' + gPathPrefix + 'i/bar_pr650x4.gif" width="800" height="4" border="0"></TD></TR>');	document.writeln('<TR><TD colspan=7 HEIGHT=10></TD></TR>');	document.writeln('</TABLE></CENTER></P>');	document.close();}//----------------------------------------------------------------------------// asb_GenerateTitle//----------------------------------------------------------------------------function asb_GenerateTitle( inTitleWidth, inTitleHeight ) {	document.open("text/html");	document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=800><TR>');	if ( inTitleWidth != 0 ) {		document.writeln('<TD VALIGN=top WIDTH=100><IMG SRC="images/title.gif" WIDTH=' + inTitleWidth + ' HEIGHT=' + inTitleHeight + ' ALIGN=bottom></TD>');	}	document.writeln('<TD VALIGN=bottom><SCRIPT LANGUAGE="JavaScript1.2">asb_GeneratePagePopup()</SCRIPT></TD></TR>');	document.writeln('<TR><TD VALIGN=top width="100" HEIGHT=10></TD><TD></TD></TR></TABLE>');	document.close();}//----------------------------------------------------------------------------// asb_GeneratePagePopup//----------------------------------------------------------------------------// This function generates popup menu for navigating between pages.//----------------------------------------------------------------------------function asb_GeneratePagePopup() {	var pageIndex = gPageIndex;	if ( gPageType == 1 ) pageIndex = pageIndex - 1;				// multi-page set without _000.htm "Intro" page - shift one  	// First open the stream to the document and write out controls for the popup menu form	document.open("text/html");	document.writeln('<P CLASS=main>');	document.writeln('<FORM ACTION="" METHOD=POST name=PagePopupFormName>');	document.writeln('<SELECT NAME=PagePopupName onChange="asb_SelectPagePopupMenu(this.options[this.selectedIndex].value, ' + pageIndex + ')">');	// Now loop through each menu item	for (i=0; i<gPageData.length; i=i+1)	{		if ( i == pageIndex ) {					// Need to put "SELECTED" 			document.writeln('<OPTION VALUE="' + gPageData[i][1] + '" SELECTED>' + gPageData[i][0]);		} 		else {								document.writeln('<OPTION VALUE="' + gPageData[i][1] + '">' + gPageData[i][0]);		}	}	// Finish up	document.writeln('</SELECT></FORM></P>');	document.close();}//----------------------------------------------------------------------------// asb_GenerateContentPhotoList//----------------------------------------------------------------------------// //----------------------------------------------------------------------------function asb_GenerateContentPhotoList( inPhotoStartIndex, inPhotoCount, inPhotoWidth ) {	var textWidth = 186;	var photoHeight = 342;	// adjust if smaller photo size instead of standard 454	if ( inPhotoWidth == 354 ) {		textWidth = 286;		photoHeight = 267;	}	document.open("text/html");	document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=650>');	for (i=inPhotoStartIndex; i < (inPhotoStartIndex + inPhotoCount); i=i+1)	{		document.writeln('<TR><TD><TABLE CLASS="photo_table"><TR>');		if ( typeof gTextList[i] == "undefined" ) {			gTextList[i] = "";								// Don't want "undefined" displayed on the page		}		if (i % 2 == 1) {									// Odd page - photo on left			document.writeln('<TD VALIGN=top><IMG SRC="i/' + U_PadNum(i) + '.jpg" WIDTH=' + inPhotoWidth + ' HEIGHT=' + photoHeight + ' ALIGN=bottom></TD>');			document.writeln('<TD WIDTH=10></TD><TD VALIGN=top WIDTH=' + textWidth + '>' + gTextList[i] + '</TD>');		}		else {			document.writeln('<TD VALIGN=top WIDTH=' + textWidth + '>' + gTextList[i] + '</TD><TD WIDTH=10></TD>');			document.writeln('<TD VALIGN=top><IMG SRC="i/' + U_PadNum(i) + '.jpg" WIDTH=' + inPhotoWidth + ' HEIGHT=' + photoHeight + ' ALIGN=bottom></TD>');		}		document.writeln('</TR></TABLE></TD></TR><TR><TD HEIGHT=20></TD></TR>');	}	document.writeln('<TR><TD HEIGHT=20></TD></TR></TABLE>');	document.close();}//----------------------------------------------------------------------------// asb_SelectPagePopupMenu//----------------------------------------------------------------------------// - inURL: URL to jump to when the menu is selected.// - inMenuIndex: Menu for this page.  Bring it back to the original state//   after user selection.//----------------------------------------------------------------------------function asb_SelectPagePopupMenu( inURL, inMenuIndex ) {	var newURL = inURL;	document.PagePopupFormName.PagePopupName.selectedIndex=inMenuIndex;	if ( gMultiLevelMenu != 0 ) {			newURL = "../" + newURL;	}	window.open( newURL, '_top' );}//----------------------------------------------------------------------------// asb_GenerateNextPrevControls//----------------------------------------------------------------------------// This function generates next/previous button controls and [x/y] indicator.//----------------------------------------------------------------------------function asb_GenerateNextPrevControls() {	var pageIndex = gPageIndex;	var pageCount = ( gPageType == 0 ) ? ( gPageData.length - 2 ) : ( gPageData.length - 1 );		// "-2" for "Intro" and "Back to XXX" items; "-1" for "Back to XXX"	var prevIndex = ( gPageType == 0 ) ? ( pageIndex - 1 ) : ( pageIndex - 2 );	var nextIndex = ( gPageType == 0 ) ? ( pageIndex + 1 ) : ( pageIndex );	var nextWidth = 90;	var prevWidth = 90;	document.open("text/html");	document.writeln('<TABLE BORDER="0" CELLSPACING="2" CELLPADDING="2"><TR>');	if ( pageIndex != gPageType ) {						// Not the first item - put "Previous" button and page indicator		// "Previous" button		var prevURL = gPageData[prevIndex][1];		if ( gMultiLevelMenu != 0 ) {			prevURL = "../" + prevURL;		}		document.writeln('<TD ALIGN="right" VALIGN="top">');		document.writeln('<A HREF="' + prevURL + '" onmouseover="document.PrevPage.src=' + "'" + gPathPrefix + "i/page_prev_red.gif'" + '" onmouseout="document.PrevPage.src=' + "'" + gPathPrefix + "i/page_prev_blk.gif'" + '" onclick="document.PrevPage.src=' + "'" + gPathPrefix + "i/page_prev_blk.gif'; window.open('" + prevURL + "','_top')" + '"><img src="' + gPathPrefix + 'i/page_prev_blk.gif" width=' + prevWidth + ' height=22 border=0 align=bottom name=PrevPage></A></TD>');		// Page indicator		document.writeln('<TD CLASS="page_indicator" ALIGN="center" VALIGN="middle">' + '[' + pageIndex + ' of ' + pageCount + ']</TD>');	}	if ( pageIndex != pageCount ) {				// Not the last item - put "Next" button		var nextURL = gPageData[nextIndex][1];		if ( gMultiLevelMenu != 0 ) {			nextURL = "../" + nextURL;		}		document.writeln('<TD ALIGN="left" VALIGN="top">');		document.writeln('<A HREF="' + nextURL + '" onmouseover="document.NextPage.src=' + "'" + gPathPrefix + "i/page_next_red.gif'" + '" onmouseout="document.NextPage.src=' + "'" + gPathPrefix + "i/page_next_blk.gif'" + '" onclick="document.NextPage.src=' + "'" + gPathPrefix + "i/page_next_blk.gif'; window.open('" + nextURL + "','_top')" + '"><img src="' + gPathPrefix + 'i/page_next_blk.gif" width=' + nextWidth + ' height=22 border=0 align=bottom name=NextPage></A></TD>');	}	document.writeln('</TR></TABLE>');	document.close();}///----------------------------------------------------------------------------// asb_GenerateFooter//----------------------------------------------------------------------------// This function generates the separater bar, text based navigation menu, and// the copyright notice.//----------------------------------------------------------------------------function asb_GenerateFooter() {	// First write open the stream to the document and write out top level table	document.open("text/html");	document.writeln('<CENTER><TABLE border="0" cellspacing="0" cellpadding="0">');	document.writeln('<TR><TD HEIGHT=20></TD></TR>');	document.writeln('<TR><TD><img src="' + gPathPrefix + 'i/bar_pr650x4.gif" width="800" height="4" border="0"></TD></TR>');	document.writeln('<TR><TD HEIGHT=10></TD></TR>');	document.writeln('<TR><TD CLASS="copyright" ALIGN="CENTER">Copyright 2001-2006 tabitabitabi.com, All Rights Reserved.</TD></TR>');	document.writeln('</TABLE></CENTER>');	document.close();}//===================================================================================================================//=========================================== NEW FUNCTIONS FOR TTT ===================================================//===================================================================================================================///----------------------------------------------------------------------------// ttt_GenerateTravelogueHeader//----------------------------------------------------------------------------function ttt_GenerateTravelogueHeader() {	document.open("text/html");	document.writeln('<CENTER><TABLE WIDTH="640" border="0" cellspacing="0" cellpadding="2">');	document.writeln('<TR BGCOLOR="#B700FF"><TD CLASS="main_light" width="80">サイト名：</TD>');	document.writeln('<TD CLASS="main"><A HREF=' + gSite_URL + ' target="_blank">' + gSite_Title + '</A></TD></TR>');	document.writeln('<TR><TD CLASS="main_light" width="80">URL：</TD>');	document.writeln('<TD CLASS="main"><A HREF=' + gSite_URL + ' target="_blank">' + gSite_URL + '</A></TD></TR>');	document.writeln('<TR><TD CLASS="main_light" width="80">国／地域：</TD>');	document.writeln('<TD CLASS="main">' + gSite_Area + '</TD></TR>');	document.writeln('<TR><TD CLASS="main_light" width="80" VALIGN="top">サイト内容：</TD>');	document.writeln('<TD CLASS="main">' + gSite_Description + '</TD></TR>');	document.writeln('<TR HEIGHT="15"><TD width="80" HEIGHT="15"></TD><TD HEIGHT="15"></TD></TR>');	document.writeln('<TR><TD COLSPAN="2"><table width="122" border="0" cellspacing="0" cellpadding="0"><TR>');	document.writeln('<TD VALIGN="middle" WIDTH="9"><A HREF="' + gSite_URL + '" target="_blank"><img src="../../i/mark-link_pr.gif" WIDTH="7" HEIGHT="13" BORDER="0"></A></TD>');	document.writeln('<TD CLASS="main"><A HREF="' + gSite_URL + '" target="_blank">このサイトへ行く</A></TD>');	document.writeln('</TR></TABLE></TD></TR>');	document.writeln('<TR height="25"><TD COLSPAN="2" VALIGN="middle" HEIGHT="25"><img src="../../i/line_gr650.gif" WIDTH="650" HEIGHT="1" BORDER="0"></TD></TR>');	document.writeln('<TR><TD CLASS="main" colspan="2"><DIV ALIGN="center">サイトからのサンプル写真</DIV></TD></TR>');	document.writeln('<TR height="15"><TD COLSPAN="2" HEIGHT="15"></TD></TR></TABLE></CENTER>');	document.close();}///----------------------------------------------------------------------------// ttt_GenerateLinkListPage//----------------------------------------------------------------------------function ttt_GenerateLinkListPage() {	var adWidth = 160;	var contentWidth = 630;	var pageWidth = 800;	var adLoc = "left";	document.open("text/html");		// outer table	if ( adWidth != 0 ) {					// need to create the outer table to contain the ad and the actual content table		document.writeln('<table width="' + pageWidth + '" border="0" cellspacing="0" cellpadding="0"><tr>');		if ( adLoc == "left" ) {			document.writeln('<td width="' + adWidth + '" valign="top">');			ttt_WriteAd160Core();			document.writeln('</td>');			document.writeln('<td width="5"></td><td valign="top">');		}		else {			document.writeln('<td valign="top">');		} 	}		document.writeln('<CENTER><TABLE WIDTH="630" BORDER="0" CELLSPACING="0" CELLPADDING="0">');	for ( j = 0; j <  gLinkData.length; j = j + 1 ) {		if ( gLinkData.length > 1 ) {				// Multi-section list - write section header			document.writeln('<TR><TD CLASS="sec_t" COLSPAN=3>' + gLinkData[j][0][0] + '</TD></TR>');			document.writeln('<TR><TD HEIGHT="10" COLSPAN=3 VALIGN="top"><img src="../i/line_gr650.gif" width="630" height="1" border="0"></TD></TR>');			document.writeln('<TR><TD HEIGHT="5" COLSPAN=3></TD></TR>');		}		for ( i = 1; i < gLinkData[j].length; i = i + 1 ) {			document.writeln('<TR><TD VALIGN="top" WIDTH="350"><TABLE WIDTH="350" BORDER="0" CELLSPACING="0" CELLPADDING="0"><tr>');			document.writeln('<TD CLASS="main_dark" VALIGN="top" BACKGROUND="../i/fd_pr-wh350.gif"><A HREF="' + gLinkData[j][i][1] + '" target="_blank">' + gLinkData[j][i][0] + '</A></TD>');			document.writeln('</TR></TABLE></TD><TD WIDTH="10"></TD>');			document.writeln('<TD CLASS="main_small" VALIGN="top" WIDTH="270">' + gLinkData[j][i][2] + '</TD></TR>');			document.writeln('<TR><TD HEIGHT="10"></TD></TR>');		}		document.writeln('<TR><TD HEIGHT="15" COLSPAN=3></TD></TR>');	}	document.writeln('</TABLE></CENTER>');	// close the outer table	if ( adWidth != 0 ) {							if ( adLoc == "right" ) {			document.writeln('</td><td width="5"></td>');			document.writeln('<td width="' + adWidth + '" valign=top>');			ttt_WriteAd160Core();			document.writeln('</td></tr></table>');		} 		document.writeln('</td></tr></table>');	}		document.close();}///----------------------------------------------------------------------------// ttt_GenerateExternalCopyRightFooter//----------------------------------------------------------------------------function ttt_GenerateExternalCopyRightFooter() {	document.open("text/html");	document.writeln('<CENTER><TABLE border="0" cellspacing="0" cellpadding="0">');	document.writeln('<TR><TD HEIGHT=10></TD></TR>');	document.writeln('<TR><TD CLASS="copyright" ALIGN="CENTER">このページに掲載されている写真の著作権はサイトオーナーに属します。</TD></TR>');	document.writeln('</TABLE></CENTER>');	document.close();}///----------------------------------------------------------------------------// ttt_GenerateStdPhotoPage//----------------------------------------------------------------------------function ttt_GenerateStdPhotoPage( inPhotoStartIndex, inPhotoCount, inPhotoWidth, inPhotoPathPrefix ) {	var textWidth = 186;	var photoHeight = 342;	// adjust if smaller photo size instead of standard 454	if ( inPhotoWidth == 354 ) {		textWidth = 286;		photoHeight = 267;	}	document.open("text/html");	document.writeln('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=650>');	for (i=inPhotoStartIndex; i < (inPhotoStartIndex + inPhotoCount); i=i+1)	{		document.writeln('<TR><TD><TABLE CLASS="photo_table"><TR>');		if ( typeof gTextList[i] == "undefined" ) {			gTextList[i] = "";								// Don't want "undefined" displayed on the page		}		if (i % 2 == 1) {									// Odd page - photo on left			document.writeln('<TD VALIGN=top><IMG SRC="i/' + U_PadNum(i) + '.jpg" WIDTH=' + inPhotoWidth + ' HEIGHT=' + photoHeight + ' ALIGN=bottom></TD>');			document.writeln('<TD WIDTH=10></TD><TD VALIGN=top WIDTH=' + textWidth + '>' + gTextList[i] + '</TD>');		}		else {			document.writeln('<TD VALIGN=top WIDTH=' + textWidth + '>' + gTextList[i] + '</TD><TD WIDTH=10></TD>');			document.writeln('<TD VALIGN=top><IMG SRC="i/' + U_PadNum(i) + '.jpg" WIDTH=' + inPhotoWidth + ' HEIGHT=' + photoHeight + ' ALIGN=bottom></TD>');		}		document.writeln('</TR></TABLE></TD></TR><TR><TD HEIGHT=20></TD></TR>');	}	document.writeln('<TR><TD HEIGHT=20></TD></TR></TABLE>');	document.close();}//----------------------------------------------------------------------------// ttt_WriteAd160Core//----------------------------------------------------------------------------function ttt_WriteAd160Core( ) {	document.writeln('<script type="text/javascript"><!--');	document.writeln('google_ad_client = "pub-0539040833160666";');	document.writeln('google_alternate_ad_url = "";');	document.writeln('google_ad_width = 160;');	document.writeln('google_ad_height = 600;');	document.writeln('google_ad_format = "160x600_as";');	document.writeln('google_ad_type = "text_image";');	document.writeln('google_ad_channel ="1126097888";');	document.writeln('google_color_border = "CCCCCC";');	document.writeln('google_color_bg = "FFFFFF";');	document.writeln('google_color_link = "000000";');	document.writeln('google_color_url = "666666";');	document.writeln('google_color_text = "333333";');	document.writeln('//--></script>');	document.writeln('<script type="text/javascript"');	document.writeln('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');	document.writeln('</script>');}//===================================================================================================================//============================================ UTILITY FUNCTIONS ====================================================//===================================================================================================================//----------------------------------------------------------------------------// U_FindDocName//----------------------------------------------------------------------------// Parameters:	//		- inURL: URL from which to extract the document name// Returns://		- Document name//----------------------------------------------------------------------------function U_FindDocName( inURL ) {   var lastSlash = inURL.lastIndexOf( "/" );   lastSlash++;										// Skip "/", or set to 0 if -1   return inURL.slice( lastSlash, inURL.length );}//----------------------------------------------------------------------------// U_NameToPageIndex//----------------------------------------------------------------------------// Parameters:	//		- inDocName: Name of the HTML document// Returns://		- Page index of the document//----------------------------------------------------------------------------function U_NameToPageIndex( inDocName ) {	var pageIndex = 0;	for ( x = 0; x < gPageData.length; x++ ) {		if ( gMultiLevelMenu != 0 ) {	// need to check for "contains" since what's defined in data.js is a path instead of exact document name			if ( gPageData[x][1].substring(4,12) == inDocName ) {				pageIndex = x;				break;			}		}		else {											if ( gPageData[x][1] == inDocName ) {				pageIndex = x;				break;			}		}	}	pageIndex = pageIndex + gPageType;			// Add 1 if 1-based document set	return pageIndex;}//----------------------------------------------------------------------------// asb_RandomImage//----------------------------------------------------------------------------//// Parameters:	//		- inImageCount: Number of images to pick from.//		- inImageIndex: Index to the image in document where the random image//		  should be displayed.//		- inSourceLocation: Path and file name prefix of the image files,//		  for example: "images/mainsplash/image_".  The random number and //		  ".jpg" suffix will be appended.//----------------------------------------------------------------------------function asb_RandomImage( inImageCount, inImageIndex, inSourceLocation ) {   randomIndex = Math.round( Math.random() * inImageCount ) + 1;	// +1 fot 0->1-based   document.images[inImageIndex].src = inSourceLocation + randomIndex + ".jpg"}//----------------------------------------------------------------------------// U_PadNum//----------------------------------------------------------------------------function U_PadNum( inNum ) {	var number = inNum;    if (inNum < 10) {    	number = "00" + inNum;    }    else {    	if (inNum < 100) {    		number = "0" + inNum;    	}    }	return number;}//----------------------------------------------------------------------------// U_GetPathDepth//----------------------------------------------------------------------------// Parameters:	//		- inDepth: Number of times "../" should be appended.//----------------------------------------------------------------------------function U_GetPathDepth( inDepth ) {	var path = "";	for (i=1; i<=inDepth; i=i+1) {		path = path + "../";	}	return path;}