  function hideDivs(exempt)
  {
    if (!document.getElementsByTagName) {
      return null;
    }
    if (!exempt) exempt = "";
    var divs = document.getElementsByTagName("div");
    var thePeopleContainer = document.getElementById("people_bios");
	if(thePeopleContainer){
	var divs = thePeopleContainer.getElementsByTagName("div");
		for(var i=0; i < divs.length; i++)
		{
			var div = divs[i];
			div.className = "hidden_bio";
		}
	}
	
	/*for(var i=0; i < divs.length; i++)
    {
      var div = divs[i];
      var id = div.id;
      if ((id != "header") && (id != "content_row") && (id != "left_column") && (id != "sub_content_container") && (id != "well") && (id != "well_alt") && (id != "access_module") && (id != "people_bios") && (id != "page_container") && (id != "footer"))
      {
        div.className = "hidden_bio";
      }
    }*/
  }
  
  function showBios(what)
  {
	if (!document.getElementById) { return null; }
	showWhat = document.getElementById(what);
/*
	var numbios = what.length - 1;
	if (numbios < 9)
		var whichbio = what.substr(3,1);
	else
	{
		if (numbios < 99)
			var whichbio = what.substr(3,2);
		else
			var whichbio = what.substr(3,3);
	}
*/
	if (showWhat.className == "bio_action_link") 
	{/* This section hides the clicked bio */
		showWhat.className = "bio_action_link hidden_bio";
		whichLink = "show_link_";
		whichLink = whichLink.concat(what);
		linkAction = document.getElementById(whichLink);
		linkAction.className = "bio_show_link";
		whichLink = "hide_link_";
		whichLink = whichLink.concat(what);
		linkAction = document.getElementById(whichLink);
		linkAction.className = "bio_hide_link hidden_bio";
	}
	else /* This section shows the clicked bio */
	{
		showWhat.className = "bio_action_link";
		whichLink = "show_link_";
		whichLink = whichLink.concat(what);
		linkAction = document.getElementById(whichLink);
		linkAction.className = "bio_show_link hidden_bio";
		whichLink = "hide_link_";
		whichLink2 = whichLink.concat(what);
		linkAction = document.getElementById(whichLink2);
		linkAction.className = "bio_hide_link";
	}
//    hideDivs(what);
  }

  function showWebinar(which_data)
  {
	if (!document.getElementById) { return null; }
	showWhat = document.getElementById(which_data);
    var first_split = which_data.split("_");
    var new2Show = first_split[0];
    var data_length = first_split[1];
    var webinarID = first_split[2];
	showWhat.className = "hidden_bio";
	if (data_length == "short")
		new2Show = new2Show + "_full_";
	else
		new2Show = new2Show + "_short_";
	new2Show = new2Show + webinarID;
	showWhat = document.getElementById(new2Show);
	showWhat.className = "";
//    hideDivs(what);
  }



function initFancyForm() {
	var d = document;
	var b = navigator.userAgent.toLowerCase();
	var safari = (b.indexOf('safari') != -1 || b.indexOf('webkit') != -1);
    if(!d.getElementById || !d.createTextNode) return;
    var l = d.getElementsByTagName('label');
    for (var i = 0; i < l.length; i++) {
        if (l[i].className == 'label_check') {
            l[i].className = (safari) ? (l[i].getElementsByTagName('input')[0].checked == true) ? 'label_check c_on' : 'label_check c_off' : (l[i].getElementsByTagName('input')[0].checked) ? 'label_check c_on' : 'label_check c_off';
            l[i].onmousedown = check_it;
        }
        if (l[i].className == 'label_radio') 
        {
 			l[i].className = 'label_radio r_off';
            l[i].onmousedown = turn_radio;
        };
    };
};
function turn_radio() {
	var d = document;
	var b = navigator.userAgent.toLowerCase();
	var safari = (b.indexOf('safari') != -1 || b.indexOf('webkit') != -1);
	 if (this.className == 'label_radio r_off' || this.getElementsByTagName('input')[0].checked) {
        var ls = d.getElementsByTagName('label');
        for (var i = 0; i < ls.length; i++) {
            if (ls[i].className.indexOf('label_radio') != -1) {
                ls[i].className = 'label_radio r_off';
            }
        };
        this.className = 'label_radio r_on';
        if (safari) this.getElementsByTagName('input')[0].checked = true;
    } else {
        this.className = 'label_radio r_off';
        if (safari) this.getElementsByTagName('input')[0].checked = false;
    };
};

function openWindow(mypage, w, h, scroll, resizable, menubar, toolbar) {
    var winl = 30;  //(screen.width - w) / 2;
    var wint = 30;  //(screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable+',menubar='+menubar+',toolbar='+toolbar;
    win = window.open(mypage,'',winprops)
}

function openCenteredWindow(mypage, w, h, scroll, resizable, menubar, toolbar) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable+',menubar='+menubar+',toolbar='+toolbar;
    win = window.open(mypage,'',winprops)
}

function openInfoRequest() {
//	    openWindow('http://www.ppg.com/ppgaf/pittsburgh/poplocater.htm?Brand=1','620','430','yes','no','no','no');
    openCenteredWindow('\/info_request.htm','880','520','yes','no','no','no');
}

function openRoadmap() {
//	    openWindow('http://www.ppg.com/ppgaf/pittsburgh/poplocater.htm?Brand=1','620','430','yes','no','no','no');
    openCenteredWindow('\/product_roadmap.htm','805','620','yes','no','no','no');
}

function openDiabetesmap() {
//	    openWindow('http://www.ppg.com/ppgaf/pittsburgh/poplocater.htm?Brand=1','620','430','yes','no','no','no');
    openCenteredWindow('\/diabetes_map.htm','760','640','yes','no','no','no');
}

function openPositionmap() {
//	    openWindow('http://www.ppg.com/ppgaf/pittsburgh/poplocater.htm?Brand=1','620','430','yes','no','no','no');
    openCenteredWindow('\/positioning_map.htm','755','620','yes','no','no','no');
}

function webinarRegister(webinarId) {
	var loadURL = "http://www.signup4.net/public/ap.aspx?EID=CFYH10E&OID=130"; /* + webinarId; */
  openCenteredWindow(loadURL,'880','700','yes','no','no','no');
}

function webinarLibraryRegister() {
	var webinarIds = document.current_webinars.webinar_id;
	var qs = "";
	var j = 0;
	if (webinarIds.length)
	{
		for (var i = 0;i<webinarIds.length;i++)
		{
			if (webinarIds[i].checked == true)
			{
				qs = qs + "&webinarIds=" + webinarIds[i].value;
			}
			else
			{
				j = j + 1;
			}
		}
	}
	else
		qs = "webinarIds=" + webinarIds.value;
	if (j == webinarIds.length)
		alert("Please select a Webinar");
	else
	{
		loadURL = "webinar_library_request.jsp?" + qs;
    	openCenteredWindow(loadURL,'880','700','yes','no','no','no');
   }
}

function highlightPassword ()
{
	alert("The password you entered was incorrect. Please try again.");
//	pField.className = "error";
}

/* Onload function hides bio divs on initial display 
(Edit 6/21/2007)
Original Use: /company/people/index.htm
Added: /company/investors.htm
*/
window.onload=function() 
{
	if (!document.getElementsByTagName) {
      return null;
    }
	var bodyid = document.body.id;
	if ((bodyid == "people")|(bodyid == "investors"))
	{
		//startList();
		hideDivs("");
	}
	else
	{
		if (bodyid == "contact")
		{
			//startList();
			initFancyForm("");
		}
		else
		{
			//startList();
		}
	}
}

/* Edited for "What's Hot" */



/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;(function($){
	$.fn.superfish = function(op){
		$(".shadow").hide();

		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			var menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 0,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: true,
		dropShadows : true,
		disableHI	: false,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('> div').hide();
			var $divs = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('> div .shadow').hide().css({'display': 'none'});
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('> div:hidden');
				$divs = this.addClass(o.hoverClass)
					.find('> div .shadow:hidden').css({'display': 'block'});
			sf.IE7fix.call($ul);
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

$(document).ready(function(){
 	jQuery(function(){
			$('ul.sf-menu').superfish({ delay: 500, animation: {opacity:'show',height:'show'}, speed: 'fast', autoArrows: false, dropShadows: false, hoverClass: 'over' });
	});
});

