
function initOverLabels () {
  if (!document.getElementById) return;      

  var labels, id, field;

  // Set focus and blur handlers to hide and show 
  // labels with 'overlabel' class names.
  labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {

    if (labels[i].className == 'overlabel' || labels[i].className == 'overlabelsmall') {

      // Skip labels that do not have a named association
      // with another field.
      id = labels[i].htmlFor || labels[i].getAttribute('for');
      if (!id || !(field = document.getElementById(id))) {
        continue;
      } 

      // Change the applied class to hover the label 
      // over the form field.
      labels[i].className = labels[i].className+'-apply';

      // Hide any fields having an initial value.
      if (field.value !== '') {
        hideLabel(field.getAttribute('id'), true);
      }

      // Set handlers to show and hide labels.
      field.onfocus = function () {
        if(this.id == 'Password' || this.id == 'UserName') {
			var passfield = document.getElementById("Password");
			var userfield = document.getElementById("UserName");
			hideLabel(userfield.getAttribute('id'), true);
			hideLabel(passfield.getAttribute('id'), true);
		}
       
		hideLabel(this.getAttribute('id'), true);
      };
      field.onblur = function () {
        if(this.value === '')
			hideLabel(this.getAttribute('id'), false);
		
		if(this.id == 'Password' || this.id == 'UserName') {
			var passfield = document.getElementById("Password");
			var userfield = document.getElementById("UserName");	
			if (userfield.value === '' && passfield.value === '') {
				hideLabel(userfield.getAttribute('id'), false);
				hideLabel(passfield.getAttribute('id'), false);
			}
		}
      };
      field.onchange = function () {
        if (this.value === '') {
          hideLabel(this.getAttribute('id'), false);
        }else if(this.id=="UserName"){
          passfield = document.getElementById("Password");
          if(passfield.value!=''){
            hideLabel(passfield.getAttribute('id'), true);
          }
        }
      };
      // Handle clicks to label elements (for Safari).
      labels[i].onclick = function () {
        var id, field;
        id = this.getAttribute('for');
        if (id && (field = document.getElementById(id))) {
          field.focus();
        }
      };

    }
  }
};

function hideLabel (field_id, hide) {
  var field_for;
  var labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {
    field_for = labels[i].htmlFor || labels[i].getAttribute('for');
    if (field_for == field_id) {
      labels[i].style.textIndent = (hide) ? '-1000px' : '0px';
      return true;
    }
  }
}

function imgSwap(oImg)
{
   var strOver  = "_ovr"    // image to be used with mouse over
   var strOff = "_up"     // normal image
   var strImg = oImg.src
   //alert(strImg);
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)
}

var css_browser_selector = function() {
	var 
		ua=navigator.userAgent.toLowerCase(),
		is=function(t){ return ua.indexOf(t) != -1; },
		h=document.getElementsByTagName('html')[0],
		b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('gecko/')? 'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',
		os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';
	var c=b+os+' js';
	h.className += h.className?' '+c:c;
}();

function ImageSwap(oSpan, strNewImage, width, height){
      oSpan.src = strNewImage;
      oSpan.width = width;
      oSpan.height = height;
}

function positionElements() {
// Called in body onLoad and onResize

    // Landing Page Border
    var targ = document.getElementById('Left_Side_Box_Wrapper');
    if (targ) {
		
    	targ.style.visibility = 'hidden';
    	targ.style.top = '130px';
    	var docWidth 
        if(window.innerWidth)
        {
			docWidth = window.innerWidth - 32;
		}
		else
		{
			docWidth = window.document.documentElement.offsetWidth - 22;
		}
        if (docWidth > 960) {
            targ.style.left = ((docWidth - 960) / 2) + 0 + 'px';
        } else {
            targ.style.left = '0px';
        }
        
        targ = null;        
    }
    // Left Navigation
    var targ = document.getElementById('Left_Navigation');
    if (targ) {
        var docWidth 
        if(window.innerWidth)
        {
			docWidth = window.innerWidth - 32;
			targ.style.top = '130px';
		}
		else
		{
			docWidth = window.document.documentElement.offsetWidth - 22;
			targ.style.top = '145px';
		}	
        if (window.document.documentElement.offsetWidth > 960) {
            targ.style.left = ((docWidth - 960) / 2) + 10 + 'px';
        } else {
            targ.style.left = '0px';
        }
        targ = null;        
    } 
    
    // Our People Explorer
    var targ = document.getElementById('Our_People_Explorer');
    if (targ) {
        targ.style.top = '180px';
        var docWidth = window.document.documentElement.offsetWidth - 22;
        if (window.document.documentElement.offsetWidth > 960) {
            targ.style.left = ((docWidth - 960) / 2) + 750 + 'px';
        } else {
            targ.style.left = '0px';
        }
        
        targ = null;        
    }    
    
    // Our People Buttons
    var targ = document.getElementById('Our_People_Buttons');
    if (targ) {
        targ.style.top = '203px';
        var docWidth = window.document.documentElement.offsetWidth - 22;
        if (window.document.documentElement.offsetWidth > 960) {
            targ.style.left = ((docWidth - 960) / 2) + 270 + 'px';
        } else {
            targ.style.left = '0px';
        }
        
        targ = null;        
    }
    
    var targ = document.getElementById('Left_Side_Box_Wrapper');
    
    if (targ) {
      targ.style.visibility = 'visible';
    }
}

function showSidewords(words) {
	
	if (hasRequestedVersion) {
		 //SWF paramaters ("path to SWF file", "ID of Flash Movie", width of flash object, height of flash object, Flash version needed, leave at 8, background color)

        var so = new SWFObject("/Themes/default/en-us/SiteBuilder/Themes/Corporate/flash/corp_manual_anitext.swf ", "Sidewords", 155, 100, "8", "");
        so.addParam("quality", "high");
        so.addParam("wmode", "transparent");
        so.addParam("scale", "showall");
        so.addParam("id", "videoplayer");
        so.addParam("name", "videoplayer");
        so.addParam("allowScriptAccess", "sameDomain");
        so.addParam("type", "application/x-shockwave-flash");
        so.addParam("pluginspage", "http://www.adobe.com/go/getflashplayer");
        so.addParam("align", "middle");
        so.addParam("FlashVars", words);
        so.write("Left_Side_Box_Flash");        
	} else {  // flash is too old or we cant detect the plugin; send back to with no flash passed in querystring
		 var n=document.getElementById('Left_Side_Box_Flash');
		 n.innerHTML = displayPNGAsString(imageLanguagePath + "/shared_component/lftBox_btm_alt.png", 167, 117, 'Leadership');
	}
}
