var loca = window.location.href;
var s1 = loca.indexOf("/",7) + 1;
var secwfile = loca.substring(s1,loca.length);
var s2 = secwfile.indexOf("/");
Section = secwfile.substring(0,s2);
var cap = Section.substring(0,1).toUpperCase();
Section = cap + Section.substring(1,Section.length);
if ( s2 == -1 ) { Section = "Main"; }

preload();
function preload() {
var prepics = new Array();
prepics[0] = new Image();
prepics[0] = "/images/bg_blue.jpg";
prepics[1] = new Image();
prepics[1] = "/images/bg_dark.jpg";
prepics[2] = new Image();
prepics[2] = "/images/logo.png";
prepics[3] = new Image();
prepics[3] = "/images/nav/Main.png";
prepics[4] = new Image();
prepics[4] = "/images/nav/Training.png";
prepics[5] = new Image();
prepics[5] = "/images/nav/Photos.png";
prepics[6] = new Image();
prepics[6] = "/images/nav/Nature.png";
prepics[7] = new Image();
prepics[7] = "/images/nav/Health.png";
prepics[8] = new Image();
prepics[8] = "/images/nav/Writing.png";
prepics[9] = new Image();
prepics[9] = "/images/nav/Reading.png";
prepics[10] = new Image();
prepics[10] = "/images/nav/Music.png";
prepics[11] = new Image();
prepics[11] = "/images/nav/Blog.png";
}


function Navbar() {
Submenu(Section);
}

function footer() {
var prelastmod = document.lastModified; 
var lastmod = prelastmod.substring(0,10);
var year = prelastmod.substring(6,10); 
document.write('<br class="half">Design and content &reg; 2004 - ' + lastmod.substring(6,10) + '; this page updated ' + lastmod + '. Live well!');
}


/////////////// USER TOOLS (BOOKMARKING ETC.) //////////////////
function addtools() {
document.write('<span align="center"><hr color="white"><div name="extra" id="extra"></div>');
//document.write('<b>PAGE TOOLS:</b> &nbsp; ');
document.write('<a href="javascript:bookmark();" onMouseOver="say(\'bookmark\');" class="nav"><img src="/images/share/bookmark.gif" align="top"> &nbsp;BOOKMARK</a> &nbsp;  ');
var addthis_pub = "bluescreenlife";
document.write('<a href="http://www.addthis.com/bookmark.php" onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this);" onmouseover="say(\'sharing\');" class="nav" target="_blank"><img src="/images/share/addthis.gif" align="top"> &nbsp;SHARE</a> &nbsp; ')
document.write('<script src="', 'http://s7.addthis.com/js/widget.php?v=10', '" type="text/JavaScript"><\/script>');
document.write('<a href="/email.html?page=' + document.title + '" onMouseOver="say(\'email\');" class="nav"><img src="/images/share/email.gif" align="top"> &nbsp;EMAIL</a> &nbsp; ');
document.write('<a href="/rss.xml" class="nav" onMouseOver="say(\'rss\');" ><img src="/images/share/rss.gif" align="top"> &nbsp;SUBSCRIBE </img></a> &nbsp; ');
document.write('<a href="javascript:printpage();" onMouseOver="say(\'print\');" class="nav"><img src="/images/share/print.gif" align="top"> &nbsp;PRINT</a> &nbsp; ');
//document.write('<a href="javascript:comment();" onMouseOver="say(\'comment\');" class="nav"><img src="/images/share/print.gif" align="top"> &nbsp;COMMENT</a>');
document.write('<hr color="white"><div name="tool" id="tool"></div></span>');
}


function say(aspect) {
var saying = '';
if ( aspect == "bookmark" ) { saying += "Add this page to your favorites."; }
if ( aspect == "email" ) { saying += "Email this page to your friends."; }
if ( aspect == "rss" ) { saying += "Subscribe to the RSS feed for Blue Screen Life."; }
if ( aspect == "sharing" ) { saying += "Share this page on MySpace, Facebook, Digg and over 30 other sites."; }
if ( aspect == "print" ) { saying += "Print a hard copy of this page."; }
if ( aspect == "comment" ) { saying += "Read and write comments on this page."; }
saying = saying + '<hr color="white">';
document.getElementById("tool").innerHTML = saying;
}





function bookmark() {
if (window.sidebar) { window.sidebar.addPanel(document.title, location.href,""); }
else if( window.opera && window.print ) {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',location.href);
    mbm.setAttribute('title',document.title);
    mbm.click(); }
else if( document.all ) { window.external.AddFavorite(location.href,document.title); }
}

function printpage() { 
alert("Please make sure background colours are deactivated in your printer settings, to avoid wasting ink.") ;
window.print();
}


/*

function comment() {
if ( on == "no" || on == "eyes" || on == "eno" ) { on = "cno" }
if ( on == "cyes" ) { 
document.getElementById("extra").innerHTML = ""; 
on = "cmaybe";
}

if ( on == "cno" ) {
var form = '<form action="comment.pl" method="POST"><table><tr><td width="120"><br></td><td align="center">Comment on this page!</td><td width="120"><br></td></tr><tr><td align="right">Name:&nbsp;&nbsp;</font></td><td><input type="text" name="Name" size="48" /></td><td><br></td></tr><tr><td align="right">Email:&nbsp;&nbsp;</font></td><td><input type="text" name="Email" size="48" /></td><td><br></td></tr><tr><td align="right">Website:&nbsp;&nbsp;</font></td><td><input type="text" name="Website" size="48" /></td><td><br></td></tr><tr><td align="right" valign="top">Comments:&nbsp;&nbsp;</td><td><textarea rows="2" cols="36" name="Comments"></textarea></td><td><br></td></tr><tr><td><br></td><td align="center"><input type="submit" value="Comment" name="B1"> <input type="reset" value="Clear" name="B2"></td><td><br></td></tr></table></form><hr color="' + hrcolor + '">';
document.getElementById("extra").innerHTML = form;
on = "cyes";
}
if ( on == "cmaybe" ) { on = "cno"; }

window.location="#pagetools";
}

</script><br>

<a name="pagetools" id="pagetools"></a>

*/
















/////////////////// GOOGLE ADS /////////////////////



// blue = 002080

function searchbox() {
document.write('<form method="get" action="http://www.google.ca/custom" target="google_window">');
document.write('<table border="1" cellspacing="0" cellpadding="5" align="right" bgcolor="#11337A"><tr><td nowrap="nowrap">');
document.write('<input type="hidden" name="domains" value="BlueScreenLife.com"></input>');
document.write('<label for="sbi" style="display: none">Enter your search terms</label>');
document.write('<input type="text" name="q" size="16" maxlength="255" value="" id="sbi"></input> ');
document.write('<label for="sbb" style="display: none">Submit search form</label>');
document.write('<input type="submit" name="sa" value="Google Search" id="sbb"></input>');
document.write('<br><br style="font-size:2px;">');
document.write('<input type="radio" checked name="sitesearch" value="BlueScreenLife.com" id="ss1"></input>');
document.write('<label for="ss1" title="Search BlueScreenLife.com"><font size="-1" color="#ffffff">BlueScreenLife.com</font></label> &nbsp; ');
document.write('<input type="radio" name="sitesearch" value="" id="ss0"></input>');
document.write('<label for="ss0" title="Search the Web"><font size="-1" color="#ffffff">Web</font></label>');
document.write('<input type="hidden" name="client" value="pub-7904257793727443"></input>');
document.write('<input type="hidden" name="forid" value="1"></input>');
document.write('<input type="hidden" name="channel" value="5034358978"></input>');
document.write('<input type="hidden" name="ie" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="oe" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="safe" value="active"></input>');
document.write('<input type="hidden" name="cof" value="GALT:#FFFFFF;GL:1;DIV:#002080;VLC:3399FF;AH:center;BGC:002080;LBGC:002080;ALC:FFFFFF;LC:FFFFFF;T:99CCFF;GFNT:99CCFF;GIMP:99CCFF;FORID:1"></input>');
document.write('<input type="hidden" name="hl" value="en"></input>');
document.write('</td></tr></table></form>');
}


function linkunit() {
google_ad_client = "pub-7904257793727443";
google_ad_width = 728;
google_ad_height = 15;
if ( Section == 'Training' ) { google_ad_slot = "0919287696"; } 
if ( Section == 'Photos' ) { google_ad_slot = "6132677707"; } 
if ( Section == 'Nature' ) { google_ad_slot = "9521818509"; } 
if ( Section == 'Health' ) { google_ad_slot = "0516441647"; } 
if ( Section == 'Writing' ) { google_ad_slot = "7378713197)"; } 
if ( Section == 'Reading' ) { google_ad_slot = "7360480431"; } 
if ( Section == 'Music' ) { google_ad_slot = "5563578100"; } 
if ( Section == 'Blog' ) { google_ad_slot = "0658925950"; } 
if ( Section == 'Love' ) { google_ad_slot = "2158721869"; } 
if ( Section == 'Main' ) { google_ad_slot = "0076434003"; }  
}

function midbanner() {
google_ad_client = "pub-7904257793727443";
google_ad_width = 728;
google_ad_height = 90;
if ( Section == 'Training' ) { google_ad_slot = "3457444181"; } 
if ( Section == 'Photos' ) { google_ad_slot = "2549531855"; } 
if ( Section == 'Nature' ) { google_ad_slot = "0779042446"; } 
if ( Section == 'Health' ) { google_ad_slot = "8894485842"; } 
if ( Section == 'Writing' ) { google_ad_slot = "9905076307"; } 
if ( Section == 'Reading' ) { google_ad_slot = "9143150668"; } 
if ( Section == 'Music' ) { google_ad_slot = "5566363770"; } 
if ( Section == 'Blog' ) { google_ad_slot = "2666537618"; } 
if ( Section == 'Love' ) { google_ad_slot = "8360919156"; } 
if ( Section == 'Main' ) { google_ad_slot = "7457407938"; }  
}


function lobanner() {
google_ad_client = "pub-7904257793727443";
google_ad_width = 728;
google_ad_height = 90;
if ( Section == 'Training' ) { google_ad_slot = "0208087677"; } 
if ( Section == 'Photos' ) { google_ad_slot = "5764281170"; } 
if ( Section == 'Nature' ) { google_ad_slot = "4792383374"; } 
if ( Section == 'Health' ) { google_ad_slot = "4293945752"; } 
if ( Section == 'Writing' ) { google_ad_slot = "1483402912"; } 
if ( Section == 'Reading' ) { google_ad_slot = "1524305488"; } 
if ( Section == 'Music' ) { google_ad_slot = "2354447955"; } 
if ( Section == 'Blog' ) { google_ad_slot = "3391110721"; } 
if ( Section == 'Love' ) { google_ad_slot = "2804946181"; } 
if ( Section == 'Main' ) { google_ad_slot = "3683558272"; }  
}


function bookmark() {
if (window.sidebar) { window.sidebar.addPanel(document.title, location.href,""); }
else if( window.opera && window.print ) {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',location.href);
    mbm.setAttribute('title',document.title);
    mbm.click(); }
else if( document.all ) { window.external.AddFavorite(location.href,document.title); }
}

function emailpreview()
{
var from = document.getElementById("fromemail").value;
var to = document.getElementById("to").value;
var comment = document.getElementById("comments").value;
var prevtext = "<textarea cols=\"60\" rows=\"16\">From: " + from + "\nTo: " + to + "\nSubject: " + from + " recommends this webpage\n____________________\n\n" + from + " has sent you a link to \"" + rtitle + "\" at BlueScreenLife.com.\n\nTheir comments: \"" + comment + "\".\n\nClick the link below, or copy the text into your web browser, if you'd like to check it out.\n\n" + location.href + "\n\nThanks and live well!</textarea>";

document.getElementById("previ").innerHTML = prevtext; 
}

function clearp() { document.getElementById("previ").innerHTML = "<br>"; }


















////////////////// NAVIGATION ////////////////////

pastsect = "none";

function Submenu(sect)  {

document.getElementById(sect).src = '/images/nav/' + sect + '2.png'; 
if ( ( pastsect != "none" ) && ( pastsect != sect ) ) { document.getElementById(pastsect).src = '/images/nav/' + pastsect + '.png'; }
pastsect = sect;

subm = new Array(8);
surl = new Array(8);

if ( sect == "Main" ) {
sublength = 7;
direct = "/"
subm[0] = "Dreaming";
//subm[2] = "Drinking";
subm[1] = "Silliness";
subm[2] = "64 Arts";
subm[3] = "Contact";
subm[4] = "Whitelist";
subm[5] = "Wallpaper";
subm[6] = "Links";
surl[0] = "greendream";
//sur[2] = "beer";
surl[1] = "goats";
surl[2] = "64";
surl[3] = "contact";
surl[4] = "whitelist";
surl[5] = "wallpaper";
surl[6] = "links";
}
else if (sect == "Training") {
sublength = 6;
direct = "/training/"
subm[0] = "Introduction";
subm[1] = "Programs";
subm[2] = "Technique";
subm[3] = "Equipment";
subm[4] = "Breathing";
subm[5] = "Cardio";
surl[0] = "intro";
surl[1] = "programs";
surl[2] = "technique";
surl[3] = "equipment";
surl[4] = "breathing";
surl[5] = "cardio";
}
else if (sect == "Photos") {
sublength = 3;
direct = "/photos/"
subm[0] = "Colour Gallery 1";
subm[1] = "Colour Gallery 2";
subm[2] = "Black & White Gallery";
surl[0] = "colour1";
surl[1] = "colour2";
surl[2] = "grey";
}
else if (sect == "Nature") {
sublength = 5;
direct = "/nature/"
subm[0] = "Canoeing";
subm[1] = "Composting";
subm[2] = "Environmentalism";
subm[3] = "Green Lifestyles";
subm[4] = "Links";
surl[0] = "canoeing";
surl[1] = "compost";
surl[2] = "environmentalism";
surl[3] = "greentips";
surl[4] = "links";
}
else if (sect == "Health") {
sublength = 5;
direct = "/health/"
subm[0] = "Non-Smoking";
subm[1] = "Yoga";
subm[2] = "Partner Yoga";
subm[3] = "Healthy Eating";
subm[4] = "Your Body";
surl[0] = "non-smoking";
surl[1] = "yoga";
surl[2] = "partner_yoga";
surl[3] = "diet";
surl[4] = "tips";
}
else if (sect == "Writing") {
sublength = 5;
direct = "/writing/"
subm[0] = "Aphorisms";
subm[1] = "Newer Poems";
subm[2] = "Older Poems";
subm[3] = "Ideas";
subm[4] = "Fiction";
surl[0] = "aphorisms";
surl[1] = "poems";
surl[2] = "oldpoems";
surl[3] = "thoughts";
surl[4] = "terran";
}
else if (sect == "Reading") {
sublength = 5;
direct = "/reading/"
subm[0] = "Authors";
subm[1] = "Ken Wilber";
subm[2] = "Steve Martin";
subm[3] = "Leonard Cohen";
subm[4] = "Taoism";
surl[0] = "authors";
surl[1] = "wilber";
surl[2] = "martin";
surl[3] = "cohen";
surl[4] = "taoism";
}
else if (sect == "Music") {
sublength = 5;
direct = "/music/"
subm[0] = "Albums";
subm[1] = "Mix CDs";
subm[2] = "Guitar";
subm[3] = "Lyrics";
subm[4] = "Links";
surl[0] = "albums";
surl[1] = "mixes";
surl[2] = "guitar";
surl[3] = "lyrics";
surl[4] = "links";
}
else if (sect == "Blog") {
sublength = 6;
direct = "/blog/"
subm[0] = "03-04";
subm[1] = "04-05";
subm[2] = "05-06";
subm[3] = "06-08";
subm[4] = "08-09";
subm[5] = "Bio";
surl[0] = "journal3";
surl[1] = "journal4";
surl[2] = "journal5";
surl[3] = "journal6";
surl[4] = "journal8";
surl[5] = "bio";
}
else if (sect == "Love") {
sublength = 6;
direct = "/love/"
subm[0] = "Connection";
subm[1] = "Intimacy";
subm[2] = "Separation";
subm[3] = "Solitude";
subm[4] = "Sexuality";
subm[5] = "Links";
surl[0] = "connection";
surl[1] = "intimacy";
surl[2] = "separation";
surl[3] = "solitude";
surl[4] = "sex";
surl[5] = "links";
}
else if (sect == "Sex") {
sublength = 6;
direct = "/sex/"
subm[0] = "Health";
subm[1] = "Foreplay";
subm[2] = "Positions";
subm[3] = "Variations";
subm[4] = "Solo Sex";
subm[5] = "Erotica";
surl[0] = "health";
surl[1] = "foreplay";
surl[2] = "positions";
surl[3] = "variations";
surl[4] = "solo";
surl[5] = "erotica";
}

if ( sect == "Main" ) { lside = 'Leftside2'; }
else { lside = 'Leftside'; }

if ( ( sect == "Blog" ) || ( sect == "Sex" ) ) { rside = 'Rightside2'; }
else { rside = 'Rightside'; }

subtable = '<table cellpadding="0" cellspacing="0" width="100%"><tr><td width="5"><img src="/images/nav/' + lside + '.png"></td>';

//tdwid = 100 / sublength;  <td width="' + tdwid + '%" background

for(i = 0; i < sublength; i++ ) 
{ subtable += '<td background="/images/nav/Bottom.png"><a href="' + direct + surl[i] + '.html"><img src="/images/nav/' + subm[i] + '.png" id="' + subm[i] + '" onMouseOver="up(\'' + subm[i] + '\')" onMouseOut="down(\'' + subm[i] + '\')"></a></td>'; }

subtable += '<td width="5"><img src="/images/nav/';
subtable += rside;
subtable += '.png"></td></tr></table>';

document.getElementById('secondmenu').innerHTML = subtable;


} 


function up(imu) { document.getElementById(imu).src = '/images/nav/' + imu + '2.png'; }
function down(imd) { document.getElementById(imd).src = '/images/nav/' + imd + '.png'; }


