var webFolders = new Array();
var commonLink = new Array();
var menuLink = new Array();
var dropDownLink = new Array();

var idxName = 0;
var idxURL = 1;
var idxWidth = 2;

var idxHome           = 0;
var idxPortfolio      = 1;
var idxECatalog       = 2;
var idxMarketSegments = 3;
var idxServices       = 4;
var idxResources      = 5;
var idxContactUs      = 6;
var idxElitenet       = 7;
var idxSitemap        = 8;
var idxCorpPressRoom  = 9;
var idxCorpHome       = 10;
var idxCorpInvestorInfo = 11;
var idxCorpPrivacyPolicy = 12;
var idxCorpAccsStat      = 13;
var idxCorpTermsOfUse    = 14;
var idxTNC               = 15;
var idxCorpCIHome        = 16;
var idxQuickLinks	 = 17;
var idxPrintThisPage     = 18;
var idxMoreInfo          = 19;
var idxMainProducts      = 20;
var idxCloseWindow       = 21;
var idxDownload          = 22;
var idxNew               = 23;
var idxTopOfPage	 = 24;
var idxBackToTop         = 25;
var idxSuitableAppl      = 26;
var idxCatalogDownload   = 27;
var idxKeywords          = 28;

var path= '';
var goodpath= '';
var onlinepath= '';
var i,k=0;
path = document.URL;
for(i=0;i<path.length;i++){
	if((k==3) || (k==4)){ 
		if((k==3) || (path.charAt(i)!="/")){
			goodpath = goodpath+path.charAt(i);
		}
	}
	if(path.charAt(i)=="/"){
		k++;
	}
	if(k==3){
		onlinepath = onlinepath+path.charAt(i); 
	}
}

var menuBaseHref = '';
var hoststring = window.location.host.toLowerCase();
//document.write(hoststring);
/*if (hoststring.indexOf('teamsite-catalog') > 0 ||
    hoststring.indexOf('catalog.geindustrial') > 0 ||
    hoststring.indexOf('catalog-test.geindustrial') > 0) {
  menuBaseHref = "http://www.gepowercontrols.com";
}
*/
if (hoststring.indexOf('teamsite-gepc-review') != -1 ||
    hoststring.indexOf('catalog.geindustrial') > 0 ||
    hoststring.indexOf('catalog-test.geindustrial') > 0) {
 // menuBaseHref = '/ex_test'; //ex_test - used in prev. step as test fodler
 menuBaseHref = '';

}
else if (goodpath=="export/powerprotection"){
  menuBaseHref = '';
}
else if (onlinepath=="/ex"){
  menuBaseHref = '';
}
else if (window.location.href.indexOf('opencms')>-1) {
  menuBaseHref = '';
}
var siteRef = 'ex';
var cbt = null;
if (document.getElementById) {
  //supported browsers
  if (document.getElementById && !document.all) {
    cbt = 2;
  }
  else {
    cbt = 1;
  }
}
else {
  cbt = 0;
}

function conf_ups(site) {
if(confirm('Dear visitor, you are being diverted to our Power Protection Uninterrupted Power Supply (UPS) Website. Click OK if you want to continue or Cancel if you don\'t want to continue.'))
{
window.open(site);
}
}

function RelLink(name, url, target, width, left, id, refid) {
  this.name  = name;
  this.ref   = url;
  this.url   = menuBaseHref + '/' + siteRef + '/' + url;
  this.target = target;
  this.type  = 'r';
  this.width = width;
  this.left  = left;
  this.id    = id;
  this.refid = refid;
}


function AbsLink(name, url, target, width, left, id, refid) {

  this.name = name;
  this.url = url;
  this.ref = url;
  this.target = target;
  this.type = 'a';
  this.width = width;
  this.left = left;
  this.id = id;
  this.refid = refid;
}

function defineHeaderImages(textimg) {

  textimg[0] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/residential.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_0.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[1] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/residential/consumer_units/consumer_unit.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_consumerunits.gif" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[2] = '<a href="' + menuBaseHref + '/' + siteRef + '/market_segments/vertical_markets.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_12.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[3] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/industrial_components.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_2.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[4] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/industrial_enclosures.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_3.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[5] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/control_automation.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_4.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[6] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/system_equipment.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_5.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[7] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/control_automation/pushbuttons_ind_lights/p9.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_6.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[8] = '<a href="' + menuBaseHref + '/' + siteRef + '/resources/literature_library/product_brochures/downloads/d_leaflet_EN418_MSD_E-Stops.pdf"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_6_02.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';
  textimg[9] = '<a href="' + menuBaseHref + '/' + siteRef + '/product_portfolio/industrial_enclosures/subterranean_enclosures/uts.html"><img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_8_01.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" /></a>';


///	textimg[0] = '<img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_0.jpg" width="730" height="215" style="margin-bottom:0px;" alt="protect - A full range of modular devices for all applications" />';
///	textimg[1] = '<img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_2.jpg" width="730" height="215" style="margin-bottom:0px;" alt="revolutionary design - provides a complete design to the constantly evolving demands of low voltage circuit protection" />';
///  	textimg[2] = '<img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_3.jpg" width="730" height="215" style="margin-bottom:0px;" alt="reliability - the answer when your in need for permanent and safe protection of electrical and electronic equipment" />';
///  	textimg[3] = '<img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_4.jpg" width="730" height="215" style="margin-bottom:0px;" alt="safety - a superior range of elctro-mechanical load switching devices" />';
///  	textimg[4] = '<img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_5.jpg" width="730" height="215" style="margin-bottom:0px;" alt="flexibility - the functionality of a low voltage distribution switchboard and motor control centre within a single product profile" />';
///  	textimg[5] = '<img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_1.jpg" width="730" height="215" style="margin-bottom:0px;" alt="protect - GE offers a comprehensive range of pre-assembled units" />';           	
///  	textimg[6] = '<img src="' + menuBaseHref + '/' + siteRef + '/imgs/header/EN_home_headtitle_8_01.jpg" width="730" height="215" style="margin-bottom:0px;" alt="" />';           	

//  textimg[0] = '<img src="' + menuBaseHref + '/ex_test/ex/imgs/header/home_headtitle_0.jpg" width="730" height="215" style="margin-bottom:0px;" alt="protect - A full range of modular devices for all applications" />';
//  textimg[1] = '<img src="' + menuBaseHref + '/ex_test/ex/imgs/header/home_headtitle_1.jpg" width="730" height="215" style="margin-bottom:0px;" alt="revolutionary design - provides a complete design to the constantly evolving demands of low voltage circuit protection" />';
//  textimg[2] = '<img src="' + menuBaseHref + '/ex_test/ex/imgs/header/home_headtitle_2.jpg" width="730" height="215" style="margin-bottom:0px;" alt="reliability - the answer when your in need for permanent and safe protection of electrical and electronic equipment" />';
//  textimg[3] = '<img src="' + menuBaseHref + '/ex_test/ex/imgs/header/home_headtitle_3.jpg" width="730" height="215" style="margin-bottom:0px;" alt="safety - a superior range of elctro-mechanical load switching devices" />';
//  textimg[4] = '<img src="' + menuBaseHref + '/ex_test/ex/imgs/header/home_headtitle_4.jpg" width="730" height="215" style="margin-bottom:0px;" alt="flexibility - the functionality of a low voltage distribution switchboard and motor control centre within a single product profile" />';
//  textimg[5] = '<img src="' + menuBaseHref + '/ex_test/ex/imgs/header/home_headtitle_5.jpg" width="730" height="215" style="margin-bottom:0px;" alt="protect - GE offers a comprehensive range of pre-assembled units" />';


}

function addWebFolder(addr, name, hasURL, upperList) {
  
    
  webFolders['/' + siteRef + addr] = new navAddress(name, menuBaseHref + '/' + siteRef + addr, hasURL, upperList); 
}

function navAddress(name, addr, url, ul) {
  
  this.name = name;
  this.addr = addr;
  this.hasURL = true;
  this.upperList = true;
  if (url != null) {
    this.hasURL = url;
  }
  
  if (ul != null) {
    this.upperList = ul;
  }
}

function showNavigation() {

  var pos = window.location.href.indexOf('/' + siteRef + '/');
  if (pos > -1) {
    var addr = window.location.href.substring(pos+1);
    //if (addr.substring(addr.length-1)=='/') addr = addr.substring(0, addr.length - 1);
    if (addr.lastIndexOf('/')!=addr.length-1) addr += '/';
    var temp = addr.split('/');
    var tempAddr = '';

    document.write('<ul class="breadcrumb">');
    var cSel = '';
    for (i = 0; i < temp.length-1; i++) {

      if (temp[i]=='') continue;
      tempAddr += "/" + temp[i];
      cSel = (i==(temp.length-2)?' class="selected"':'');
      if (webFolders[tempAddr] != null) {
        if (webFolders[tempAddr].hasURL) {
          if (cSel.length > 0) {
            if (webFolders[tempAddr].upperList) {
              document.write('<li' + cSel + '>' + webFolders[tempAddr].name + '</li>');
             
            }
          }
          else {
                      if ( webFolders[tempAddr].name=='Home')
                      {
                         webFolders[tempAddr].addr='/home.html';
                          document.write('<li><a href="' + webFolders[tempAddr].addr + '">' + webFolders[tempAddr].name + '</a></li>');
                      }
                      else
                      {
                         document.write('<li><a href="' + webFolders[tempAddr].addr + '">' + webFolders[tempAddr].name + '</a></li>');
                      }  
                     
               }
        }
        else {
          if (cSel.length > 0 && webFolders[tempAddr].upperList) {
            document.write('<li' + cSel + '>' + webFolders[tempAddr].name + '</li>');  
            
          }
          else if (i == temp.length-3 && webFolders[tempAddr].upperList) {
            document.write('<li' + cSel + '>' + webFolders[tempAddr].name + '</li>');
            }
        }
      }
      else {
        break;
      }
    }
    document.write('</ul>');
  }
}

//String constants
//var SuitableApplications = 'Suitable Applications';

