/*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');
}



function header() {
	str = "";
	str += "<tr class='bar'><td colspan='2'>&nbsp;</td></tr>";
	str += "<tr id='header'><td colspan='2'><img src='images/header.gif' width='720' height='69' border='0'></td></tr>";
	str += "<tr class='bar'><td colspan='2'>&nbsp;</td></tr>";
  document.write(str);
}



function nav(page) {
  var str = "";
  str += "<a id='home' href='index.html'>Home</a>";
  str += "<a id='team' href='team.html'>Investment Team</a>";

  str += "<a id='contact' href='contact.html'>Contact Us</a>";
  document.write(str)
  if(document.getElementById) {
    if(page != '') {
      document.getElementById(page).className="currentpage";
    }
  }
}


  str += "<a id='partners' href='partners.html?page=cccp'>Cotton Creek Capital Partners</a>";
  //str += "<a id='criteria' href='partners.html?page=ic'>Investment Criteria</a>";
  //str += "<a id='portfolio' href='partners.html?page=wp'>Portfolio</a>";
  str += "<a id='marcellus' href='marcellus.html'>Cotton Creek Marcellus Partners</a>";


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


// ***** 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 scroll(id){
  if(document.getElementById){
    var el = document.getElementById(id);
    el.scrollTop = "0";
  } 
}

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 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);
}
