var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
var dot_html = location.href.substring(dir.length,location.href.length+1).toUpperCase();
var urlupper = location.href.toUpperCase()
var which_site_n = urlupper.indexOf('PRINCESS')
if (which_site_n > 0){which_site = 'Princess Tiger Lily'}
else {which_site = 'Yellow Bear Journey'}
var last_slash = location.href.lastIndexOf('/')+1
var prev_slash = location.href.substring(0,last_slash-1).lastIndexOf('/')+1
var subdir = location.href.substring(prev_slash,last_slash-1).toUpperCase()
var orig_subdir = 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'+'Y.COM')
  {subdir = 'YELLOWBEARJOURNE'+'Y'}
//document.write(urlupper)
if (urlupper.indexOf('PRINCESSTIGERLIL'+'Y.COM') > 0)
  {}
else
if (urlupper.indexOf('FILE:') == 0)
  {}
else
  {document.write('<font size=+3><b>Please check to make sure you are at PrincessTigerLil'+'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 top_links.js
if (subdir == 'PRINCESSTIGERLIL'+'Y')
  {myImg='menu/green2.gif'}
else
  {myImg='../menu/green2.gif'}
preload_image(myImg)
myImg = 'https://secure.newdream.net/donate4.gif'
preload_image(myImg)
//preload the image...
function preload_image(myimg) {
if (document.images)
{
    pic1= new Image(800,600); 
    pic1.src=myimg; 
}
}
//outer border
document.write('<div class="noprint" width="100%" style="border:3px solid red;border-style:ridge;background-color:#ff8000">')
document.write('<div width="100%" style="background-color:#ffd070;">')
document.write('<table width="100%" cellpadding="0"><tr><td align="center"')
if (which_site_n > 0)
  {if (subdir == 'IDEAS') {document.write(' bgcolor="#ffa050"')}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/ideas/index.html">Idea Socket</a></td>')
document.write('<td align="center"')
if (which_site_n > 0)
  {if (subdir == 'MCS') {document.write(' bgcolor="#ffa050"')}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/mcs/index.html">MCS Escape</a></font></td>')
document.write('<td align="center"')
if (which_site_n > 0)
  {if (subdir == 'SEARCH') {document.write(' bgcolor="#ffa050"')}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/search/index.html">Search Perch</a></td>')
document.write('<td align="center" style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/index.html#house">Mountain House for Sale</a></td>')
document.write('<td align="center"')
if (which_site_n > 0)
  {if (subdir == 'SSS') {document.write(' bgcolor="#ffa050"')}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/sss/index.html">Short-N-Sweet-N-Succulent Stories</a></td></tr>')
// line 2
document.write('<tr><td align="center">')
document.write('<table width="52%" cellpadding="0"><tr><td')
if (which_site_n > 0)
  {if (subdir == 'PRINCESSTIGERLILY') 
  {if (dot_html == 'INDEX.HTML') {document.write(' bgcolor="#ffa050"')}
   else {if (dot_html == '') {document.write(' bgcolor="#ffa050"')}}}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/index.html">Home</a></td>')
contact = 'a href="mail'
contact = contact + 'to:dal'
contact = contact + 'e@yellowbearjourne'
contact = contact + 'y.com">Contact&nbsp;Me</a'
document.write('<td align="right" style="font-size:smaller;font-weight:bold;"><'+contact+'></td></tr>')
document.write('<tr>')
document.write('<td align="left"')
if (which_site_n > 0)
  {if (subdir == 'PRINCESSTIGERLILY') 
  {if (dot_html == 'SITE_INDEX.HTML') {document.write(' bgcolor="#ffa050"')}}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/site_index.html">Site&nbsp;Index</a></td>')
document.write('<td align="right" style="font-size:smaller;font-weight:bold;"><a href="http://www.yellowbearjourneys.com/newsletter.html">Newsletter</a></td></tr></table></td>')
document.write('<td align="center" style="font-size:smaller;font-weight:bold;"><a href="http://www.yellowbearjourneys.com">Eco-Tours</a></td>')
document.write('<td align="center"')
if (which_site_n > 0)
  {if (subdir == 'SHOP') {document.write(' bgcolor="#ffa050"')}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/shop/index.html">Shopping Green</a></td>')
document.write('<td align="center"')
if (which_site_n > 0)
  {if (subdir == 'UNDERCURRENT') {document.write(' bgcolor="#ffa050"')}}
document.write(' style="font-size:smaller;font-weight:bold;"><a href="http://www.princesstigerlily.com/undercurrent/index.html">Prevailing Undercurrent</a></td>')
document.write('<td align="center"><table><tr><td align="center" style="font-size:smaller;"><a href="http://www.yellowbearjourney.com">Consulting</a> &#150; Life Voyage,</td></tr>')
document.write('<tr><td align="center" style="font-size:smaller;">Career, Non-Toxic, Travel, Green Car</td></tr></table></td></tr></table></div>')
if (subdir == 'PRINCESSTIGERLIL'+'Y')
  {mybase=''}
else
  {if (subdir == orig_subdir)
	{mybase='../'}
   else
	{mybase='../../'}}
document.write('<div width="100" style="position:relative;float:right;">')
document.write('<a href="'+mybase+'godeep.html">')
document.write('<img border="0" alt="This website certified Deep Green by Yellow Bear Journeys. Click here to help the earth."')
document.write('src="'+mybase+'menu/deepgreen_website_cert_mini.jpg"></a>')
document.write('</div>')
document.write('</div>')
document.write('<div class="noprint" style="position:relative;float:left;font-weight:bold;color:green;">')
document.write('<a href="http://www.dreamhost.com/donate.cgi?id=13114"><img border="0" alt="Donate towards my green web hosting bill!" src="https://secure.newdream.net/donate4.gif" /></a>')
document.write('Please help keep this website hosted by a green web server. Thanks<br />')
document.write('</div><br />')
