function switchtab(tab) {
	if (document.getElementById) {
		for (var i = 0; i < 3; i++) {
			if (tab == 'about') {document.getElementById('about').className = 'about_on';}
			else
			if (tab == 'impact') {document.getElementById('impact').className = 'impact_on';}
			else
			if (tab == 'career') {document.getElementById('career').className = 'career_on';}
		}	
	}		
}

function switchoff(tab) {
	if (document.getElementById) {
		var strLocation = window.location.href;
		strLocation = strLocation.toLowerCase();
		if (strLocation.indexOf("/about_bcg/") > -1 && tab == 'about') {document.getElementById('about').className = 'about_on';}
		else if ((strLocation.indexOf("/impact_expertise/") > -1 || strLocation.indexOf("/subscribe/") > -1 || strLocation.indexOf("site=pubs") > -1) && tab == 'impact') {document.getElementById('impact').className = 'impact_on';}
		else if (strLocation.indexOf("/careers/") > -1 && tab == 'career') {document.getElementById('career').className = 'career_on';}
		else {		
		mytab = document.getElementById(tab);
		mytab.className = tab;
		}
	}
}

function roll(div) {
	if (document.getElementById) {

		divid = div+'content';
		topid = div+'top';
		
		divstyle = document.getElementById(divid).style;
		topdiv =  document.getElementById(topid);
		
		if (divstyle.display == '') {divstyle.display ='none'};
		divstyle.display = (divstyle.display == 'none')? 'block' : 'none';
		
		if (topid == "expertsrolltop" || topid == "expcontactsrolltop") { 
			topdiv.className = (topdiv.className == 'rolledup2')? 'rolleddown2' : 'rolledup2';
		} else {
			topdiv.className = (topdiv.className == 'rolledup')? 'rolleddown' : 'rolledup';
		}
	}
}

function cswitchtab(tabnum) {
	if (document.getElementById) {
		for (var i = 1; i < 4; i++) {
			if (i == tabnum) {
				if (tabnum==1) {
					var tabid = "tab"+tabnum;
					var contentid = "tabcontent_"+tabnum;
					var currenttab = document.getElementById(tabid);
					currenttab.className = tabid+"_active";
					
					contentstyle = document.getElementById(contentid).style;
					contentstyle.display ="block";
					
					//
					contentid = "tabcontent_2";
					currenttab = document.getElementById("tab2");
					currenttab.className = "tab2";
					contentstyle = document.getElementById("tabcontent_2").style;
					contentstyle.display ="none";

					contentid = "tabcontent_3";
					currenttab = document.getElementById("tab3");
					currenttab.className = "tab3";
					contentstyle = document.getElementById("tabcontent_3").style;
					contentstyle.display ="none";
				}

				if (tabnum==2) {
					var tabid = 'tab'+tabnum;
					var contentid = "tabcontent_"+tabnum;
					var currenttab = document.getElementById(tabid);
					currenttab.className = tabid+"_active";

					contentstyle = document.getElementById(contentid).style;
					contentstyle.display ="block";

					//
					contentid = "tabcontent_1";
					currenttab = document.getElementById("tab1");
					currenttab.className = "tab1";
					contentstyle = document.getElementById("tabcontent_1").style;
					contentstyle.display ="none";

					contentid = "tabcontent_3";
					currenttab = document.getElementById("tab3");
					currenttab.className = "tab3";
					contentstyle = document.getElementById("tabcontent_3").style;
					contentstyle.display ="none";

				}
				
				if (tabnum==3) {
					var tabid = 'tab'+tabnum;
					var contentid = "tabcontent_"+tabnum;
					var currenttab = document.getElementById(tabid);
					currenttab.className = tabid+"_active";

					contentstyle = document.getElementById(contentid).style;
					contentstyle.display ="block";

					//
					contentid = "tabcontent_1";
					currenttab = document.getElementById("tab1");
					currenttab.className = "tab1";
					contentstyle = document.getElementById("tabcontent_1").style;
					contentstyle.display ="none";

					contentid = "tabcontent_2";
					currenttab = document.getElementById("tab2");
					currenttab.className = "tab2";
					contentstyle = document.getElementById("tabcontent_2").style;
					contentstyle.display ="none";

				}

			
			}
		}
	}
}

function oswitchtab(tabnum) {
	if (document.getElementById) {
		for (var i = 1; i < 5; i++) {
			if (i == tabnum) {
				if (tabnum==1) {
					var tabid = "otab"+tabnum;
					var contentid = "otabcontent_"+tabnum;
	
					var currenttab = document.getElementById(tabid);
					
					currenttab.className = tabid+"_active";
					
					contentstyle = document.getElementById(contentid).style;
					contentstyle.display ="block";
					
					//
					contentid = "otabcontent_2";
					currenttab = document.getElementById("otab2");
					currenttab.className = "otab2";
					contentstyle = document.getElementById("otabcontent_2").style;
					contentstyle.display ="none";

					contentid = "otabcontent_3";
					currenttab = document.getElementById("otab3");
					currenttab.className = "otab3";
					contentstyle = document.getElementById("otabcontent_3").style;
					contentstyle.display ="none";
					
					contentid = "otabcontent_4";
					currenttab = document.getElementById("otab4");
					currenttab.className = "otab4";
					contentstyle = document.getElementById("otabcontent_4").style;
					contentstyle.display ="none";
				}

				if (tabnum==2) {
					var tabid = 'otab'+tabnum;
					var contentid = "otabcontent_"+tabnum;
					var currenttab = document.getElementById(tabid);
					currenttab.className = tabid+"_active";

					contentstyle = document.getElementById(contentid).style;
					contentstyle.display ="block";

					//
					contentid = "otabcontent_1";
					currenttab = document.getElementById("otab1");
					currenttab.className = "otab1";
					contentstyle = document.getElementById("otabcontent_1").style;
					contentstyle.display ="none";

					contentid = "otabcontent_3";
					currenttab = document.getElementById("otab3");
					currenttab.className = "otab3";
					contentstyle = document.getElementById("otabcontent_3").style;
					contentstyle.display ="none";
					
					contentid = "otabcontent_4";
					currenttab = document.getElementById("otab4");
					currenttab.className = "otab4";
					contentstyle = document.getElementById("otabcontent_4").style;
					contentstyle.display ="none";

				}
				
				if (tabnum==3) {
					var tabid = 'otab'+tabnum;
					var contentid = "otabcontent_"+tabnum;
					var currenttab = document.getElementById(tabid);
					currenttab.className = tabid+"_active";

					contentstyle = document.getElementById(contentid).style;
					contentstyle.display ="block";

					//
					contentid = "otabcontent_1";
					currenttab = document.getElementById("otab1");
					currenttab.className = "otab1";
					contentstyle = document.getElementById("otabcontent_1").style;
					contentstyle.display ="none";

					contentid = "otabcontent_2";
					currenttab = document.getElementById("otab2");
					currenttab.className = "otab2";
					contentstyle = document.getElementById("otabcontent_2").style;
					contentstyle.display ="none";
					
					contentid = "otabcontent_4";
					currenttab = document.getElementById("otab4");
					currenttab.className = "otab4";
					contentstyle = document.getElementById("otabcontent_4").style;
					contentstyle.display ="none";

				}

				if (tabnum==4) {
					var tabid = 'otab'+tabnum;
					var contentid = "otabcontent_"+tabnum;
					var currenttab = document.getElementById(tabid);
					currenttab.className = tabid+"_active";

					contentstyle = document.getElementById(contentid).style;
					contentstyle.display ="block";

					//
					contentid = "otabcontent_1";
					currenttab = document.getElementById("otab1");
					currenttab.className = "otab1";
					contentstyle = document.getElementById("otabcontent_1").style;
					contentstyle.display ="none";

					contentid = "otabcontent_2";
					currenttab = document.getElementById("otab2");
					currenttab.className = "otab2";
					contentstyle = document.getElementById("otabcontent_2").style;
					contentstyle.display ="none";
					
					contentid = "otabcontent_3";
					currenttab = document.getElementById("otab3");
					currenttab.className = "otab3";
					contentstyle = document.getElementById("otabcontent_3").style;
					contentstyle.display ="none";

				}
			
			}
		}
	}
}

function expertdetails(expert) {
	if (document.getElementById) {
		var popupdivstyle = document.getElementById(expert).style;
		popupdivstyle.display ="block";		
	}
}

function expertclose(expert) {
	if (document.getElementById) {
		var popupdivstyle = document.getElementById(expert).style;
		popupdivstyle.display ="none";		
	}
}

function mailpage()
{
var strTitle = document.title.replace("&","%26");
mail_str = "mailto:?subject=" + strTitle;
mail_str += "&body=I thought you might be interested in " + strTitle;
mail_str += ". You can view it at, " + location.href; 
location.href = mail_str;
}
