/*initialize variables*/
var num = (Math.round(Math.random()*2))+4;
var MM_contentVersion = 5;
var isIE = navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if(plugin) {
  var words = navigator.plugins["Shockwave Flash"].description.split(" ");
  for (var i = 0; i < words.length; ++i){
    if (isNaN(parseInt(words[i])))
    continue;
    var MM_PluginVersion = words[i]; 
  }
  var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
  document.write('on error resume next \n');
  document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
  document.write('</SCR' + 'IPT\> \n');
}


// ***** functions *****

function moveTree() {
  f = document.getElementById("footer").offsetTop;
  if (document.getElementById && document.body.style) {
    if(isIE) {
    document.getElementById('tree').style.position = "absolute";
    document.getElementById('tree').style.top = (f-54)+"px";
    } else {
    tree = document.getElementById('tree');
    tree.style.position = "absolute";
    tree.style.top = (f-54)+"px";
    }
  }
}

function showItem(item){
  if (document.getElementById && document.body.style) {
    theLast = document.getElementById(lastItem);
    theItem = document.getElementById(item);
    theLast.style.visibility = "hidden";
    theItem.style.visibility = "visible";
  }
  else if (document.all) {
    theLast = document.all(lastItem).style;
    theItem = document.all(item).style;
    theLast.visibility = "hidden";
    theItem.visibility = "visible";
    } 
  else if (document.layers) {
    theLast = document.layers[lastItem];
    theItem = document.layers[item];
    theLast.visibility = "hide";
    theItem.visibility = "show";
    } 
  lastItem = item;  
}

function nav(page) {
  var str = "";
  str += "<a id='home' href='index.html'>Home</a>";
  str += "<a id='services' href='services.html'>Overview of Services</a>";
  str += "<a id='about' href='about-the-firm.html'>About the Firm</a>";
  str += "<a id='taxplanning' href='tax-planning.html'>Gift and Estate Tax Planning</a>";
  str += "<a id='advisoryservices' href='advisory-services.html'>Investment Advisory Services</a>";
  str += "<a id='lifeinsurance' href='life-insurance.html'>Life Insurance Due Diligence</a>";
  str += "<a id='management' href='company-management.html'>Interim Company Management / <br>Board Representation</a>";
  str += "<a id='risk' href='risk-management.html'>Family Risk Management</a>";
  str += "<a id='wealth' href='wealth-education.html'>Family Wealth Education</a>";
  str += "<a id='downloads' href='downloads.html'>Downloads</a>";
  str += "<a id='contact' href='contact.html'>Contact Us</a>";
  document.write(str)
  if(document.getElementById) {
    if(page != '') {
      document.getElementById(page).className="currentpage";
    }
  }
}

function footer() {
  str = "";
  str += "<a href='privacy.html'>Privacy Policy</a>";
  str += " | ";
  str += "<a href='ADV Part II and Schedule F 2011-01.10.pdf'>Form ADV</a>";
  document.write(str);
}

function header() {
  str = "";
  str += "<table width='775' cellspacing='0'>";
  str += "<tr id='row1'><td><img src='images/logo.jpg' height='32' width='291' alt='logo'></td></tr>";
  str += "<tr id='row2'><td>&nbsp;</td></tr>";
  str += "<tr id='row3'><td>";
  /*flash*/  
  str += "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'";
  str += "  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'";
  str += " ID='header' WIDTH=775 HEIGHT=120 ALIGN=''>";
  str += " <PARAM NAME=movie VALUE='images/header.swf";
  if(home) str += "?theFrame=1'>";  
  else str += "?theFrame=" + num + "'>"; 
  str += " <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#18472C>  "; 
  str += " <EMBED src='images/header.swf";
  if(home) str += "?theFrame=1' "; 
  else str += "?theFrame=" + num + "'"; 
	str += " loop=false menu=false quality=high bgcolor=#18472C  ";
	str += " swLiveConnect='FALSE' WIDTH='775' HEIGHT='120' NAME='header' ALIGN=''";
	str += " TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>";
	str += " </EMBED>";
	str += " </OBJECT>";
  str += "</td></tr>";
  str += "<tr id='row4'><td>&nbsp;</td></tr>";
  str += "</table>";
  document.write(str);
}

function email(s) {
  str = "";
  str += "<a href='mailto:" + s;
  str += "@brownliebraden.com?subject=Thank you for Contacting our Website'>";
  str += s + "@brownliebraden.com";
  str += "</a>";
  document.write(str);
}
