var setTime = null;
function showQuickLink(obj, subMenue, objHide){
	clearTimeout(setTime);
	var hideElement = document.getElementById(objHide);
	if(objHide != null && hideElement){
		hideElement.style.display = 'none';
	}
	var linkCont = document.getElementById(subMenue);
	if(linkCont.style.display == 'none') {
		linkCont.style.display = '';
		if(obj) obj.className = 'quickLinks_on topList';
	}
}
function hideQLinkDelay(obj, subMenue) {
	setTime = setTimeout(function(){hideQuickLink(obj, subMenue);}, 1);
}
function hideQuickLink(obj, subMenue){
	var linkCont = document.getElementById(subMenue);
	linkCont.style.display = 'none';
	if(obj) obj.className = 'quickLinks_off topList';
}
function stillShowMenu(){
	clearTimeout(setTime);
}
function changeLiColor(lstItem) {
	
}

function goToPage(path, target){
	if(target != null && target == true){
		window.open(path);
	}else{
		window.location = path;
	}
}

function showProfArrowTxt(obj){
	var arrowObj = document.getElementById(obj);
	var strObj = document.getElementById(obj+'_txt');
	
	if(strObj.style.display == 'none'){		
		arrowObj.style.display = 'none'
		strObj.style.display = ''
	}else{
		strObj.style.display = 'none'
		arrowObj.style.display = ''
	}	
}
function ShowHide(divId)
{
	if(divId=='register')
	{
		document.getElementById('register').style.display='none'
		document.getElementById('more_details').style.display='block'
	}
	else if(divId=='more_details')
	{
		document.getElementById('register').style.display='block'
		document.getElementById('more_details').style.display='none'
	}
}

/* ******* below script added by Amruta t for Single Employee profile functionality *********** */
function showHideDiv(hidediv1,hidediv2,showdiv,clickedObj){
	var objShowDiv=document.getElementById(showdiv);
	var objHideDiv1=document.getElementById(hidediv1);
	var objHideDiv2=document.getElementById(hidediv2);
	var objClicked = clickedObj.parentNode;
	var downArrowList = $('li.downArrow');
	
	if (objShowDiv.style.display=='none'){
		for(i=0; i<downArrowList.length; i++){
			downArrowList[i].className = '';
		}
	
	  objShowDiv.style.display='block';
	  objHideDiv1.style.display='none';
	  objHideDiv2.style.display='none';
	  objClicked.className = 'downArrow';
	}
}
function HideDiv(objHide,objShow){
	var objHideDiv=document.getElementById(objHide);
	var objShowDiv=document.getElementById(objShow);
	var downArrowList = $('li.downArrow');
	
	for(i=0; i<downArrowList.length; i++){
		downArrowList[i].className = '';
	}
	
	if (objHideDiv.style.display=='block'){ 
		objHideDiv.style.display='none';
		objShowDiv.style.display='block';
	}
}

/* Give it away form Thank you message */
function openPOP(){
	oDiv = document.getElementById('thankPopDiv');
	oDiv.style.display='block'; 
}

/* for Flash Home page quicik link onclick fix */
function flashHomeQuickLink(obj){
	var objSubMenu = document.getElementById(obj);
	if(objSubMenu.style.display == 'none') showQuickLink(this, obj);
	else hideQLinkDelay(this, obj);
	
}

/* check clients resolution */
/*function clientResolution() {
	var clientWidth = screen.width;
	var clientHeight = screen.height;
	var objMaster = document.getElementById('master_container');
	if(clientWidth > 1024 && clientHeight > 768){
		objMaster.style.marginBottom = '-'+60+'px';
		objMaster.style.paddingBottom = 0+'px';
	}
	else if(clientWidth <= 1024 && clientHeight <= 768){
		objMaster.style.paddingBottom = 60+'px';
	}
}

window.onload = function(){
	//clientResolution();
}
*/

/* font changing */
var objCssFile = document.getElementById('fontSize');
function smallFont(){
	objCssFile.href = '';
	objCssFile.href = '/ibcareers/css/font_default.css';
}
function mediumFont(){
	objCssFile.href = '';
	objCssFile.href = '/ibcareers/css/font_medium.css';
}
function largeFont(){
	objCssFile.href = '';
	objCssFile.href = '/ibcareers/css/font_large.css';
}
function textOnly(){
	if(document.body.className == 'removeImage') document.body.className = '';
	else document.body.className = 'removeImage';
}


/* Background PNG images fix code */
// JavaScript Document
/************************************************** ********
Sleight for Backgrounds
Original code (c) 2001 Aaron Boodman, http://www.youngpup.net
This version (c) 2003 Drew McLellan, http://www.allinthehead.com
************************************************** ********/
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	//window.attachEvent("onload", alphaBackgrounds);
}

function alphaBackgrounds(){
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (i=0; i<document.all.length; i++){
		var bg = document.all[i].currentStyle.backgroundImage;
		if (itsAllGood && bg){
			if (bg.match(/\.png/i) != null){
			var mypng = bg.substring(5,bg.length-2);
			document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader (src='"+mypng+"', sizingMethod='scale')";
			document.all[i].style.backgroundImage = "url('images/home_page/footer_buttons.png')";
			}
		}
	}
}
/* Added for Email functionality */
currentemail=0;
function showDiv(id)
{
	document.getElementById(id).style.display="block";
}

function hideDiv(id)
{
	document.getElementById(id).style.display="none";	
}

function email_link()
{
  if (currentemail==0)
  {
	hideDiv("bodyContent");
	showDiv("emailContent");
	currentemail=1;
  }
  else
  {
	showDiv("bodyContent");
	hideDiv("emailContent");
	currentemail=0;
  }
}

imageArray=new Array();
numImages=new Array();
currentImage=new Array();

function switchImage(imgname)
{
	document[imgname].src=imageArray[imgname+(currentImage[imgname]+1)];
	currentImage[imgname]=(currentImage[imgname]+1)%numImages[imgname];
	setTimeout("switchImage(\""+imgname+"\")",5000);
}

function imgRollover(loadImg, onImg)
{
	// prevent this routine from running twice
	if (! loadImg.outImg)
	{
		// set src of the "on" image
		loadImg.outImg = new Image();
		loadImg.outImg.src = loadImg.src;
		loadImg.onmouseout=img_mouseOut;

		// set the src of the "over" image
		loadImg.overImg = new Image();
		loadImg.overImg.src = onImg
		loadImg.onmouseover=img_mouseOver;
	}
}
     
// event handler for OnMouseOut
function img_mouseOut()  {this.src = this.outImg.src;}
     
// event handler for OnMouseOver
function img_mouseOver() {this.src = this.overImg.src;}

function trackEndUserDetails(docTitle,cookieInfoStr,reportSuiteID) {
	
			var cookieInfo = new Array();
			cookieInfo = cookieInfoStr.split(",");	
			var cookieLength = cookieInfo.length;
			for(i=cookieLength;i<5;i++){
			    cookieInfo[i] = "N/A";
			}
			for(i=cookieLength;i<5;i++){
			    alert(cookieInfo[i]);
			}
			s.linkTrackVars="prop5,prop6,prop7,prop8,prop10";
			s.linkTrackEvents="None";
			//s.linkType="o";
			//s.linkName=docTitle;
			s.prop5=cookieInfo[0]; 
			s.prop6=cookieInfo[1]; 
			s.prop7=cookieInfo[2]; 
			s.prop8=cookieInfo[3];
			s.prop10=cookieInfo[4];
			//s.lnk=s_co(this);  			
			s.tl(this,'o',docTitle);
			//s_gi(reportSuiteID);
			s_gi("jpmorganuathcode");
			
 }

//Track using G-Code 
function trackLinks(clientLogin,parentLink,reportSuite) {		
//alert("parent link - " + parentLink ); 
//alert("client Login - " + clientLogin );
//alert("Report Suite - " + reportSuite );
s.linkTrackVars="prop9";
s.linkTrackEvents="None";
//s.linkType="o";
//s.linkName=clientLogin;
s.prop9=parentLink; 
//s_lnk=s_co(this); 
s.tl(this,'o',clientLogin);
s_gi("jpmorganuathcode");
//s_gi(reportSuite);

} 
