
function insightsTabSel(a) {
	if(a==2) {
		document.getElementById('widget_whitepapers').style.display = 'none';
		document.getElementById('widget_casestudies').style.display = 'inline';
		document.getElementById('tab-WP').className = 'off';
		document.getElementById('tab-CS').className = '';
	}
	else {
		document.getElementById('widget_whitepapers').style.display = 'inline';
		document.getElementById('widget_casestudies').style.display = 'none';
		document.getElementById('tab-WP').className = '';
		document.getElementById('tab-CS').className = 'off';
	}
}

/* Script added for rollover images for Industry landing page*/
function showimg(a)
{

for(i=1;i<=13;i++)
{
 if(i==a)
 {

   document.getElementById('show'+i).style.display="block"
   document.getElementById('link'+i).className="active";
 }
 else{
 document.getElementById('show'+i).style.display="none"
  document.getElementById('link'+i).className="";
 }
}

}



function showbg(a)
{

for(i=1;i<=13;i++)
{
  if(i==a)
  {
	  
	  document.getElementById('show'+i).style.display="block"
   document.getElementById('link'+i).className="active";
  }
  else{
	   document.getElementById('show'+i).style.display="none"
      document.getElementById('link'+i).className="";
  }
}

}

function showDefaultFromImg(e) {

	if (!e) var e = window.event;
	var relTarg = e.target || e.fromElement;


if (relTarg.nodeName == "IMG" || relTarg.nodeName == "DIV" ) {
for(i=1;i<=13;i++)
{
 document.getElementById('show'+i).style.display="none"
  document.getElementById('link'+i).className="";
 }
}

}

function showDefaultFromLI(e) {

	if (!e) var e = window.event;
	var relTarg = e.target || e.fromElement;


if (relTarg.nodeName == "A") {
for(i=1;i<=13;i++)
{
 document.getElementById('show'+i).style.display="none"
  document.getElementById('link'+i).className="";
 }
}

}

/* Script added for rollover images for Industry landing page*/

/* Script added for rollover images for Services landing page*/
function showServimg(a)
{

for(i=1;i<=17;i++)
{
 if(i==a)
 {

   document.getElementById('show'+i).style.display="block"
   document.getElementById('link'+i).className="active";
 }
 else{
 document.getElementById('show'+i).style.display="none"
  document.getElementById('link'+i).className="";
 }
}
  
}

function showServbg(a)
{
for(i=1;i<=17;i++)
{
  if(i==a)
  {
	  
	  document.getElementById('show'+i).style.display="block"
   document.getElementById('link'+i).className="active";
  }
  else{
	   document.getElementById('show'+i).style.display="none"
      document.getElementById('link'+i).className="";
  }
}

}

function showDefaultFromImgServ(e) {

	if (!e) var e = window.event;
	var relTarg = e.target || e.fromElement;


if (relTarg.nodeName == "IMG" || relTarg.nodeName == "DIV" ) {
for(i=1;i<=17;i++)
{
 document.getElementById('show'+i).style.display="none"
  document.getElementById('link'+i).className="";
 }
}

}

function showDefaultFromLIServ(e) {

	if (!e) var e = window.event;
	var relTarg = e.target || e.fromElement;


if (relTarg.nodeName == "A") {
for(i=1;i<=17;i++)
{
 document.getElementById('show'+i).style.display="none"
  document.getElementById('link'+i).className="";
 }
}

}

/* Script added for rollover images for Services landing page*/


/* Script to go to screen on Selection from Jump to dropdown */

function goToScreen(obj) {
	dropdown = document.getElementById(obj);
	url = dropdown.options[dropdown.selectedIndex].value;
	window.open(url,'_self');
}

/* Script to highlight selected left nav link on load  and  remove link from the section name in landing page*/

function selLeftNavLink(obj) {
	
	/* code to highlight the respective top nav */	
	url = location.href;
	if(url.indexOf('/industries/') != '-1') document.getElementById('industries').className = 'current';
	if(url.indexOf('/services/') != '-1') document.getElementById('services').className = 'current';
	if(url.indexOf('/approach/') != '-1') document.getElementById('approach').className = 'current';
	if(url.indexOf('/insights/') != '-1') document.getElementById('insight').className = 'current';
	if(url.indexOf('/aboutus/') != '-1') document.getElementById('company').className = 'current';
	if(url.indexOf('/news/') != '-1') document.getElementById('company').className = 'current';
	if(url.indexOf('/investors/') != '-1') document.getElementById('company').className = 'current';
	if(url.indexOf('/careers/') != '-1') document.getElementById('company').className = 'current';
	if(url.indexOf('/contactus/') != '-1') document.getElementById('company').className = 'current';
	if(url.indexOf('/company/') != '-1') document.getElementById('company').className = 'current';
	
	
	/* code to hightlight the respective left nav */	
	if(obj == 'landingPageLink') {
		parentObj = document.getElementById(obj).parentNode;
		txt = parentObj.childNodes[0].innerHTML;
		parentObj.removeChild(parentObj.childNodes[0]);
		parentObj.innerHTML = txt;
	} 
//	else {
//	document.getElementById(obj).className = "selected";
//	}
	
	var subLink = obj.substring(0,3);
	var subLinkcom = obj.substring(0,3);
	if(subLink == 'sub') {
		imgObj = document.getElementById(obj).parentNode.childNodes[0].childNodes[1];
		imgObj.src = "images/leftNav-sideArrow-sel.gif";
		
	}
	if(subLinkcom == 'sub') {
		imgObj = document.getElementById(obj).parentNode.childNodes[0].childNodes[1];
		imgObj.src = "images/leftNav-sideArrow-sel.gif";
	}
}

/* Script to display leftnav sub sections */
// function openLeftNavSubSection(obj) {
	
// 	document.getElementById(obj).style.display = "block";
//}

/* Script to link screen from topNav */

function linkFromTopNav(url) {
	
	domainName = document.domain;
	window.location.href = "http://"+domainName+"/"+url;
}

/* Scripts to include images in the header - cognizant logo and search go button */

function loadHdrImages() {
	
	domainName = document.domain;
	document.getElementById('logoImg').src = "images/cts-logo.jpg";
	// document.getElementById('goBtnImg').src = "images/go-btn.jpg";
	// document.getElementById('logoprintImg').src = "images/cts-logo-print.jpg";
	
}

/* Script to link screen from RightNav */

function linkFromRightNav(url) {
	
	domainName = document.domain;
	window.location.href = "http://"+domainName+"/"+url;
}

/* Script to link screen from GlobalNav */

function linkFromGlobalNav() {
	var url=document.getElementById('global_office').value;
	if (url != '') {
	window.open(url, "_self");
   }
}

/* Script to link screen from Footer links */

function linkFromFooter(url) {
	domainName = document.domain;
	window.location.href = "http://"+domainName+"/"+url;
} 

/* function linkFromFooter(url) {
	window.location.href = url;
}*/


/*Scripts for investors left navigation menu*/

$(document).ready(function()
{
	
	$("#menuhead45 a").click(function()
    {
		 // alert('test')
		  $('.leftNavSubmenu2 > li > a').removeClass('selected');
		  $('.leftNavSubmenu2 > li > ul > li > a').removeClass('selected');
		  $(this).addClass('selected');
        $('#sub-inv-45').css('display','block');
		  $('#sub-inv-120').css('display','none');
		  $('#sub-inv-65').css('display','none');
        $('#sub-inv-62').css('display','none');
	});
	
	$("#menuhead120 a").click(function()
    {
		 // alert('test')
		 
		  $('.leftNavSubmenu2 > li > a').removeClass('selected');
		  $('.leftNavSubmenu2 > li > ul > li > a').removeClass('selected');
		  $(this).addClass('selected');
		  $('#sub-inv-120').css('display','block');
		  $('#sub-inv-45').css('display','none');
		  $('#sub-inv-65').css('display','none');
        $('#sub-inv-62').css('display','none');
          
	});

	$("#menuhead65 a").click(function()
    {
		 // alert('test')
		 
		  $('.leftNavSubmenu2 > li > a').removeClass('selected');
		  $('.leftNavSubmenu2 > li > ul > li > a').removeClass('selected');
		  $(this).addClass('selected');
		  $('#sub-inv-65').css('display','block');
		  $('#sub-inv-45').css('display','none');
		  $('#sub-inv-120').css('display','none');
		  $('#sub-inv-62').css('display','none');
          
	});

	$("#menuhead62 a").click(function()
    {
		 // alert('test')
		 
		  $('.leftNavSubmenu2 > li > a').removeClass('selected');
		  $('.leftNavSubmenu2 > li > ul > li > a').removeClass('selected');
		  $(this).addClass('selected');
		  $('#sub-inv-62').css('display','block');
		  $('#sub-inv-45').css('display','none');
		  $('#sub-inv-120').css('display','none');
        $('#sub-inv-65').css('display','none');
          
	});
	
}); 
/*Above Scripts for investors left navigation menu*/

/* Script to change selected item in global navigation dropdown */

function selGlobalOfficeVal() {
	url = location.href;	
	pageName = url.substring(url.lastIndexOf('/')+1,url.length);
	if(pageName.indexOf('regional-article-') != '-1') {
		pageName = url.substring(url.lastIndexOf('/')+18,url.length);
	}
	if(pageName.indexOf('regional-locations-') != '-1') {
		pageName = url.substring(url.lastIndexOf('/')+20,url.length);
	}
	for(i=0;i<=document.getElementById('global_office').options.length-1;i++) {
		val = document.getElementById('global_office').options[i].value;
		val = val.substring(val.lastIndexOf('/')+1,val.length);
		if (val == pageName) {			
		document.getElementById('global_office').selectedIndex = i;
		break;
		}
		if (val == '-1'){
		document.getElementById('global_office').selectedIndex = 0;
		break;
		}
	}
}

/* Script to highlight Top Nav from individual screens */

function highlightTopNav(tab) {
	document.getElementById(tab).className = 'current';
}



/* For Footer links*/

$(document).ready(function()
{
	
	domainName = document.domain;
	
	$("#rss").click(function()
    {
	var strNewURL = "http://www.cognizant.com/scripts/rss/landingPage.asp";
   window.open(strNewURL, "_self");
    return false;
	});
	
	$("#community").click(function()
    {
	var strNewURL = "http://cognizanti.cognizant.com";
   window.open(strNewURL, "");
    return false;
	});
	
	
	$("#flickr").click(function()
    {
	var strNewURL = "http://www.flickr.com/photos/cognizant-worldwide/";
   window.open(strNewURL, "");
    return false;
	});
	
	
	$("#linkedin").click(function()
    {
	var strNewURL = "http://www.linkedin.com/companies/cognizant-technology-solutions";
   window.open(strNewURL, "");
    return false;
	});
	
	$("#slideshare").click(function()
    {
	var strNewURL = "http://www.slideshare.net/cognizant";
   window.open(strNewURL, "");
    return false;
	});
	
	$("#twitter").click(function()
    {
	var strNewURL = "http://twitter.com/cognizant";
    window.open(strNewURL, "");
    return false;
	});
	
	$("#youTube").click(function()
    {
	var strNewURL = "http://www.youtube.com/cognizant";
    window.open(strNewURL, "");
    return false;
	});
	
	$("#cog2").click(function()
    {
	var strNewURL = "http://www.cognizant.com/html/approach/cognizant-2.0.asp";
    window.open(strNewURL, "_self");
    return false;
	});
		
});

/* Script to link to white paper screen from insight on click of more link */

function linkToWhitepapers() {
	
	domainName = document.domain;	
	window.location.href = "http://"+domainName+"/html/insights/whitepapers.asp";
}

/* Script to link to case studies screen from insight on click of more link */

function linkToCasestudies() {
	
	domainName = document.domain;
	window.location.href = "http://"+domainName+"/html/insights/case-studies.asp";
}

/* Script to view info in representative client list under about us page */
 
function showDiv(a)
{	
	divItem = $('#'+a).fadeIn();
}

function hideDiv(a)
{	
	divItem = $('#'+a).fadeOut();
}
