// JavaScript Document
featureOffice = "";
featureOfficeId = 1;
featureOfficeHeader = "";
imgFolder = "images/";
imgLeftArrow = "arrow_left.png";
imgRightArrow = "arrow_right.png";
//imgLeftArrow = "off_left_arrow.gif";
//imgRightArrow = "off_right_arrow.gif";
jobLink = "";

// --------------------------------------------------------------------------------
// City, Country, Image Link, Job Search Link, University Program Link, Career Link
// --------------------------------------------------------------------------------
office = new Array();
office[1] = ["Budapest", "Hungary", "off_budapest.jpg", "careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2287%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "http://www.morganstanley.com/about/careers/online_ap.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Funiversity%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2287%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "/about/offices/hungary.html", "budapest.html", "Hungary"];
// 
office[2] = ["Glasgow", "Scotland", "off_glasgow.jpg", "careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2351%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "http://www.morganstanley.com/about/careers/online_ap.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Funiversity%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2351%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "/about/careers/glasgow/index.html", "glasgow.html", "Scotland"];
office[3] = ["Montreal", "Canada", "off_montreal.jpg", "careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2277%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "/about/careers/online_ap.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Funiversity%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2287%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "/about/offices/canada.html", "montreal.html", "the Americas"];
office[4] = ["Baltimore", "Maryland", "off_baltimore.jpg", "careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2723%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "/about/careers/online_ap.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Funiversity%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2287%26com.peopleclick.cp.formdata.hitsPerPage%3D10", "", "", "the Americas"];

function getOffice(pos) {
	featureOffice = "";

	if (pos == 1) {
		if (featureOfficeId < office.length-1) { featureOfficeId++; }
		else { featureOfficeId = 1; }
	}
	else if (pos == -1) {
		if (featureOfficeId > 1) { featureOfficeId--; }
		else { featureOfficeId = office.length-1; }
	}
	else { featureOfficeId = 1; }
	
	if (office[featureOfficeId][1]) {
		featureOfficeHeader = office[featureOfficeId][0] + ', ' + office[featureOfficeId][1];
	}
	else {
		featureOfficeHeader = office[featureOfficeId][0];
	}

	featureOffice += '<div id="hp_featureOffice">';
	featureOffice += '<table cellpadding="0" cellspacing="0" border="0">';
	featureOffice += '<tr>';
	//featureOffice += '<td width="22"><a href="javascript: void(0);" onclick="javascript: getOffice(-1);"><img src="'+imgFolder+imgLeftArrow+'" width="22" height="101" border="0" align="absmiddle"></a></td>';
	featureOffice += '<td style="vertical-align:bottom; background:url(\''+imgFolder+office[featureOfficeId][2]+'\') repeat; width: 299px; height: 112px;">'


	featureOffice += '<div class="folinks" style="width:299px;height:26px;margin:0px 0px 0px 0px;font-size:12px;">';
	featureOffice += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
	featureOffice += '<tr>';
	featureOffice += '<td width="20%"><a href="javascript: void(0);" onclick="javascript: getOffice(-1);"><img src="'+imgFolder+imgLeftArrow+'" width="25" height="26" border="0" align="absmiddle"></a></td>';
	featureOffice += '<td align="center" valign="middle" height="26" width="60%" style="padding:5px 0px 0px 0px; vertical-align:top;">';
	if(office[featureOfficeId][6]) {
		featureOffice += '<a href="'+jobLink+office[featureOfficeId][6]+'">'+featureOfficeHeader+'</a>';
	} else {
		featureOffice += featureOfficeHeader;
	}
	featureOffice += '</td>';
	featureOffice += '<td align="right" width="20%"><a href="javascript: void(0);" onclick="javascript: getOffice(1);"><img src="'+imgFolder+imgRightArrow+'" width="25" height="26" border="0"></a></td>';
	featureOffice += '</tr>';
	featureOffice += '</table>';
	featureOffice += '</div>'
	featureOffice += '<div class="transparent"></div>';
	//featureOffice += <span>'+featureOfficeId+'/'+(office.length-1)+'</span>';

	featureOffice += '</td>';

	//featureOffice += '<td width="22"><a href="javascript: void(0);" onclick="javascript: getOffice(1);"><img src="'+imgFolder+imgRightArrow+'" width="22" height="101" border="0"></a></td>';
	featureOffice += '</tr></table>';
	featureOffice += '</div>';

	featureOffice += '<div id="hp_officeLinks" style="width:300px;"><img src="images/clear.gif" width="5" height="5"><br>';
	if (office[featureOfficeId][3]) {
		featureOffice += '<div class="hp_arrowLink"><a href="'+jobLink+office[featureOfficeId][3]+'">View '+office[featureOfficeId][0]+' Jobs for Experienced Professionals &raquo;</a></div>';
	}
	if (office[featureOfficeId][4]) {
		featureOffice += '<div class="hp_arrowLink"><a href="'+jobLink+office[featureOfficeId][4]+'">View University Program opportunities in '+office[featureOfficeId][7]+' &raquo;</a></div>';
	}
	if (office[featureOfficeId][5]) {
		featureOffice += '<div class="hp_arrowLink"><a href="'+jobLink+office[featureOfficeId][5]+'">Learn about the  '+office[featureOfficeId][0]+' Office &raquo;</a></div>';
	}
	featureOffice += '</div>';

	document.getElementById("hp_officeContainer").innerHTML = featureOffice;
}
getOffice();
				
var fopanel = ''; var hiringContent;
fopanel +='	<div id="div_foc">'
fopanel +='	</div>'
//fopanel +='	<div class="dotDivider"></div>'
fopanel +='	<div id="eventBanner" style="display:none"></div>'
fopanel +='	<table border="0" cellspacing="0" cellpadding="0" class="fotable" style="width:300px;">'
fopanel +='  <tr>'
fopanel +='    <td colspan="4" class="hp_sectiontitle">We are Hiring Around the Globe</td>'
fopanel +='    </tr>'
fopanel +='  <tr>'
fopanel +='    <td colspan="4"><img src="images/clear.gif" width="10" height="10"></td>'
fopanel +='    </tr>'
fopanel +='  <tr>'
fopanel +='    <td width="10"><img src="images/bullet_red.gif" width="9" height="8"></td>'
fopanel +='    <td width="140"><strong class="hp_linkBlue"><a href="careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2539%2C2621%2C2753%2C2487%2C2625%2C2409%2C2425%26com.peopleclick.cp.formdata.hitsPerPage%3D10">New York</a> </strong></td>'
fopanel +='    <td width="10"><img src="images/bullet_red.gif" width="9" height="8"></td>'
fopanel +='    <td width="140"><strong class="hp_linkBlue"><a href="careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2286%26com.peopleclick.cp.formdata.hitsPerPage%3D10">Hong Kong</a> </strong></td>'
fopanel +='  </tr>'
fopanel +='  <tr>'
fopanel +='    <td><img src="images/bullet_red.gif" width="9" height="8"></td>'
fopanel +='    <td><strong class="hp_linkBlue"><a href="careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2353%26com.peopleclick.cp.formdata.hitsPerPage%3D10">London</a></strong></td>'
fopanel +='    <td><img src="images/bullet_red.gif" width="9" height="8"></td>'
fopanel +='    <td><strong class="hp_linkBlue"><a href="careersearch.html?cpURL=http%3A%2F%2Fcareers.peopleclick.com%2Fcareerscp%2Fclient_ms%2Fexternal%2Fgateway.do%3FfunctionName%3DsearchFromLink%26com.peopleclick.cp.formdata.JPM_LOCATION%3D2301%26com.peopleclick.cp.formdata.hitsPerPage%3D10">Japan</a></strong></td>'
fopanel +='  </tr>'
fopanel +='  <tr>'
fopanel +='    <td>&nbsp;</td>'
fopanel +='    <td>&nbsp;</td>'
fopanel +='    <td>&nbsp;</td>'
fopanel +='    <td>&nbsp;</td>'
fopanel +='  </tr>'
fopanel +='  <tr>'
fopanel +='    <td colspan="4"><strong class="hp_linkBlue"><a href="careersearch.html"><img src="images/button.png" border="0" align="left"> Search All Jobs</a></strong></td>'
fopanel +='    </tr>'
fopanel +='</table><div style="height:20px;"></div>'
if(hiringContent == 'below') /*condition applied: Hiring Around Globe panel position changed on AboutUs page*/
document.getElementById('panelContent').innerHTML = fopanel;
else
{
var panelBreak = '';
	panelBreak += '<div class="dotDivider"></div>';
	panelBreak += fopanel;
document.write(panelBreak);
}


function loadEventBanner(lnk, imgSrc)
{
	var html = '<a href="'+lnk+'" target="_blank"><img src="images/'+imgSrc+'" width="297" border="0"></a><div class="dotDivider"></div>';
	document.getElementById('eventBanner').style.display = 'block';
	document.getElementById('eventBanner').innerHTML = html;
}
