// Developer:  Web Solutions Team, property of Detroit Edison.
/* COPYRIGHT INFORMATION All pages within a SITE are the property of DTE Energy or its Affiliate, unless other ownership is indicated. All 
   information and content including any software programs available on or through a SITE is protected by copyright. A user is permitted to 
   download information from a SITE which, by its nature or context, is to be copied in order to use SITE-related services. A user is 
   permitted to download information from a SITE for private personal use. A user is prohibited from modifying, copying, distributing, 
   transmitting, displaying, publishing, selling, licensing, creating derivative works or using any Content available on or through a SITE 
   for any commercial or public purpose unless the user has the prior written permission of DTE Energy or its Affiliate. */

var bcHomeLink = "DTE Sustainability Report";
var sitePath = "/crreport/index.html";

var localNav = new Array();
//The format for making your localNav is like so:
//localNav Number | Text Display | path to document | link attr
/*Link Attr Legend:
  0 = open link in same window
	1 = open link in a new target window
	h = hide link from left nav, but show in breadcrumbs
*/

/*
localNav[localNav.length] = "0|contact us|/contactUs.html|0";
localNav[localNav.length] = "1|site map|/siteMap.html|0";
localNav[localNav.length] = "2|search |/search.html|0";
*/           

function openVideo (vidPromo,w,h) {
  if (w == undefined) { 
    width = 320; 
  } else {
    width = w;
  }
  if (h == undefined) { 
    height = 220; 
  } else {
    height = h;
  }
  //alert ("Called openVideo with the following: \n  f = " + vidPromo + "\n  w = " + width + "\n  h = " + height);
  varOptions = "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height
  window.open(vidPromo, 'popupWindow',varOptions);
}

/* 
   Some AJAX functions that will allow us to store the reference to the complimentary secured URL prefix 
   in a single place - namely a .html file - that can be acessed both by the browser at runtime via a simple
   AJAX call or a server side include in the case where value of the variable is needed from within an html or 
   server side evaluation.
*/

function getLeftNav() {
  <!-- // Required to be compliant with XHTML-->
  var xmlHttp=null; // Defines that xmlHttp is a new variable.

  // Try to get the right object for different browser
  try {
    // Firefox, Opera 8.0+, Safari, IE7+
    xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
  } catch (e) {
    // Internet Explorer
    try {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  xmlHttp.onreadystatechange = function() {
  if (xmlHttp.readyState == 4)
    try { // In some instances, status cannot be retrieved and will produce 
      // an error (e.g. Port is not responsive)
      if (xmlHttp.status == 200) {
        // Set the main HTML of the body to the info provided by the 
        // Ajax Request
        document.getElementById("sideNavigation").innerHTML = xmlHttp.responseText;
      }
    } catch (e) {
      document.getElementById("sideNavigation").innerHTML = "Error on Ajax return call : " + e.description;
    }
  
  }
  xmlHttp.open("get","includes/leftNav.html"); // .open(RequestType, Source);
  xmlHttp.send(null); // Since there is no supplied form, null takes its place as a new form.
}


function getRightNav() {

  <!-- // Required to be compliant with XHTML-->
  var xmlHttp=null; // Defines that xmlHttp is a new variable.

  // Try to get the right object for different browser
  try {
    // Firefox, Opera 8.0+, Safari, IE7+
    xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
  } catch (e) {
    // Internet Explorer
    try {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  xmlHttp.onreadystatechange = function() {
  if (xmlHttp.readyState == 4)
    try { // In some instances, status cannot be retrieved and will produce 
      // an error (e.g. Port is not responsive)
      if (xmlHttp.status == 200) {
        // Set the main HTML of the body to the info provided by the 
        // Ajax Request
        document.getElementById("contentAreaRightNav").innerHTML = xmlHttp.responseText;
      }
    } catch (e) {
      document.getElementById("contentAreaRightNav").innerHTML = "Error on Ajax return call : " + e.description;
    }
  
  }
  xmlHttp.open("get","includes/rightNav.html"); // .open(RequestType, Source);
  xmlHttp.send(null); // Since there is no supplied form, null takes its place as a new form.
}


// CSS Top Menu- By JavaScriptKit.com (http://www.javascriptkit.com)
// Adopted from SuckerFish menu
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// Please keep this credit intact
function startMenu() {

  if (document.all&&document.getElementById) {
    crrMenu = document.getElementById("topMenu");
    for (i=0; i<crrMenu.childNodes.length; i++) {
      node = crrMenu.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function(){                  
          this.className=this.className.replace(" over", "")
        }
      }
    }
  }
}

if (window.attachEvent)
  window.attachEvent("onload", startMenu)
else
  window.onload=startMenu;
 