var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
//alert(dir)
var dot_html = location.href.substring(dir.length,location.href.length+1).toUpperCase();
//alert(dot_html)
var doc_idx = dot_html.substring(0,2)
var doc_idx3 = dot_html.substring(0,3)
var doc_idx2 = dot_html.substring(0,4)
var doc_idx8 = dot_html.substring(0,8)
//alert(doc_idx7)
if (doc_idx == '  ')
  {doc_idx = 'HO'}
if (doc_idx == ' ')
  {doc_idx = 'HO'}
if (doc_idx == '')
  {doc_idx = 'HO'}
if (dot_html == 'INDEX.HTML')
  {doc_idx = 'HO'}
if (dot_html == 'INDEX2.HTML')
  {doc_idx = 'HO'}
//alert(doc_idx)
var urlupper = location.href.toUpperCase()
//alert(urlupper)
var which_site_n = urlupper.indexOf('PRINCESS')
//alert(which_site_n)
if (which_site_n > 0){which_site = 'Princess Tiger Lily'}
else {which_site = 'Yellow Bear Journey'}
var last_slash = location.href.lastIndexOf('/')+1
//alert(last_slash)
var prev_slash = location.href.substring(0,last_slash-1).lastIndexOf('/')+1
//alert(prev_slash)
var subdir = location.href.substring(prev_slash,last_slash-1).toUpperCase()
//alert(subdir)
if (subdir == 'AREAS')
  {subdir = 'MCS'}
if (subdir == 'WWTD')
  {subdir = 'MCS'}
// Make website work like PC
if (subdir == 'WWW.PRINCESSTIGERLIL'+'Y.COM')
  {subdir = 'PRINCESSTIGERLIL'+'Y'}
if (subdir == 'WWW.YELLOWBEARJOURNE'+'YS.COM')
  {subdir = 'YELLOWBEARJOURNE'+'YS'}
if (subdir == 'WWW.YELLOWBEARJOURNE'+'Y.COM')
  {subdir = 'YELLOWBEARJOURNE'+'Y'}
//alert(urlupper.indexOf(':'))
//alert(urlupper)
if (urlupper.indexOf('YELLOWBEARJOURNE'+'Y.COM') > 0)
  {}
else
if (urlupper.indexOf('FILE:') == 0)
  {}
else
  {document.write('<font size=+3><b>Please check to make sure you are at YellowBearJourne'+'y.com. Otherwise, this website may have been stolen</b></font>')}

// preload all images in html
var imgs,i;
imgs=document.getElementsByTagName('img');
for(i in imgs)
{
  preload_image(imgs[i])
}
// preload images in all javascripts, one image at a time
preload_image("menu/yellowbrick.jpg")
preload_image("menu/yellowbrick_red.jpg")
preload_image("menu/hands.jpg")
preload_image("https://secure.newdream.net/green5.png")
preload_image("https://secure.newdream.net/donate4.gif")

//preload the image...
function preload_image(myimg) {
if (document.images)
{
    pic1= new Image(800,600);
    pic1.src=myimg;
}
}

// PREFIXES USED=A, C, G, H, J, L, N, R, T
// A=ABOUT
// C=CONSULTING
// G=GALLERY
// H=HOME (INDEX)
// J=JOURNEYS
// L=LINK TO US
// N=NEWSLETTER
// R=RESOURCES, GEAR (RESOURCES->GEAR)
// T=TERMS
//
document.write('<table border=9 cellspacing=2 cellpadding=5 border bgcolor=black>')
document.write('<tr><td align=center style="font-family:Arial" background="menu/yellowbrick.jpg"><img src="menu/hands.jpg"><br><font size=+2>Yellow Bear<br>Journey</font><br><b>Olympia, WA</b><br><b>360-918-8121</b></td></tr>')
// Consulting
x=write_button_first(doc_idx,'HO', 'C_', 'x', 'y', 'z')
document.write('<a href="index.html">Consulting</a>')
x=write_button_last()
// Ecotours
x=write_button_first(doc_idx,'EC', 'w', 'x', 'y', 'z')
document.write('<a href="ecotours.html">EcoTours</a>')
x=write_button_last()
// Go Deep
x=write_button_first(doc_idx,'a', 'b', 'x', 'y', 'z')
document.write('<a href="http://godeep.yellowbearjourney.com">Go Deep</a>')
x=write_button_last()
// Networking
x=write_button_first(doc_idx,'NE', 'N_', 'x', 'y', 'z')
document.write('<a href="networking.html">Networking</a>')
x=write_button_last()
// Green Cars
x=write_button_first(doc_idx8,'GREENCAR', 'w', doc_idx, 'G_', 'z')
document.write('<a href="greencar.html">Green Cars</a>')
x=write_button_last()
// Stories
x=write_button_first(doc_idx,'ST', 'w', 'x', 'y', 'z')
document.write('<a href="stories.html">Stories</a>')
x=write_button_last()
// Certification
x=write_button_first(doc_idx,'CE', 'w', 'x', 'y', 'z')
document.write('<a href="certification.html">Certification</a>')
x=write_button_last()
// Non-Toxic
x=write_button_first(doc_idx,'NO', 'w', 'x', 'y', 'z')
document.write('<a href="nontoxic.html">Non-Toxic</a>')
x=write_button_last()
// Green
x=write_button_first(doc_idx8,'GREEN.HT', 'w', doc_idx3, 'GR_', 'z')
document.write('<a href="green.html">Green</a>')
x=write_button_last()
// Peace
x=write_button_first(doc_idx,'PE', 'P_', 'x', 'y', 'z')
document.write('<a href="peace.html">Peace</a>')
x=write_button_last()
// Search
x=write_button_first(doc_idx,'SE', 'w', 'x', 'y', 'z')
document.write('<a href="search.html">Search</a>')
x=write_button_last()
// Contact
x=write_button_first(doc_idx,'CO', 'w', 'x', 'y', 'z')
document.write('<script language=javascript src="menu/scripts/contact_us_title_case.js"></script>')
x=write_button_last()
// Our Team
x=write_button_first(doc_idx,'TE', 'T_', 'x', 'y', 'z')
document.write('<a href="team.html">Our Team</a>')
x=write_button_last()
document.write('</table>')
document.write('<a href="http://www.dreamhost.com/r.cgi?423616/green.cgi">')
document.write('<img border="0" alt="Green Web Hosting! This site hosted by DreamHost."')
document.write('src="https://secure.newdream.net/green5.png" height="75" width="75" /></a><br>')
document.write('<br><font color=green><b>Please help keep this<br>website hosted by a<br>green web server.<br>Thanks &darr;&darr;&darr;</b><br></font>')
document.write('<a href="http://www.dreamhost.com/donate.cgi?id=13115"><img border="0" alt="Donate towards my green web hosting bill!" src="https://secure.newdream.net/donate4.gif" /></a>')


function write_button_first(idx, idx_comparea, idx_compareb, idx2, idx_compare2a, idx_compare2b) {
if (idx == idx_comparea | doc_idx == idx_compareb | idx2 == idx_compare2a | idx2 == idx_compare2b)
  {var my_img = '_red'}
else
  {var my_img = ''}
document.write('<tr><td background="menu/yellowbrick')
document.write(my_img)
document.write('.jpg"><font class="ybjbutton">')
}
function write_button_last(){
document.write('&nbsp;&nbsp;</font></td></tr>')
}
