//7059 mod start
//This function is added to render the tab name appended with URL.
/****************************  Modification History  ***********************************************
Sl No:	Date		Modified by	        Description
***************************************************************************************************
[1]	07/17/10	  Neha Grover 	        Phase 2B Enhancement Changes for Product Page
[2] 08/9/10      Nishant Singh         	Phase 2B Enhancement Changes for Printable Product Page
[3] 12/10/10		Abhinandan			Product page tab formatting edits-389613
***************************************************************************************************/
var initTab = "aboutthebook";	
function renderTab()
{	
	var hasURLString = window.location.href.indexOf('#');	
	if (hasURLString != -1) 
	{
		var	strURLString = window.location.href.substring(hasURLString+1, window.location.href.length).toLowerCase();
		//if(!(initTab == strURLString))
		//369560: Commented the above line and added a check for strURLString
		if(!(initTab == strURLString) && strURLString != "")
		{
			initTab = strURLString;			
			var tabId = "";
// [1] Mod Start
			var pattCrs="course";
			var pattDiscipline="discipline";
			var resultCrs=strURLString.indexOf("course");
			var resultDiscipline=strURLString.indexOf("discipline");
			if(resultCrs != "-1") tabId = "tabcontent4";
			if(resultDiscipline != "-1") tabId = "tabcontent4";
			if(strURLString == 'aboutthebook')		tabId = "tabcontent1";
			if(strURLString == 'takeacloserlook')	tabId = "tabcontent2";
			if(strURLString == 'elearning')			tabId = "tabcontent3";
			if(strURLString == 'studentaccess')			tabId = "tabcontent3";
			if(strURLString == 'studentaccess1')			tabId = "tabcontent3";
			if(strURLString == 'instructoraccess')			tabId = "tabcontent3";
			if(strURLString == 'website')			tabId = "tabcontent3";
			if(strURLString == 'resources')			tabId = "tabcontent4";
			if(strURLString == 'downlaoddiv')		tabId = "tabcontent4";
			
			if(strURLString == 'websiteresource')			tabId = "tabcontent4";
			if(strURLString == 'studentaccessresource')			tabId = "tabcontent4";
			//[3]
			if(strURLString == 'downloadableinstructorresources')			tabId = "tabcontent4";
			if(strURLString == 'otherinstructorresources')			tabId = "tabcontent4";
			//[3]
			if(strURLString == 'tabbed')   tabId = "tabcontent4";
			if(strURLString == 'instructoraccessresource')			tabId = "tabcontent4";
				if(strURLString == 'accesscodecard')			tabId = "tabcontent4";
			if(strURLString == 'websitecourse')			tabId = "tabcontent4";
			if(strURLString == 'otherresource')			tabId = "tabcontent4";
			if(strURLString == 'choices'){
				tabId = "tabcontent5";
				strURLString = 'pearsonChoices';
			}
			if(strURLString == 'series')			tabId = "tabcontent6";
			if(strURLString == 'downloads')			tabId = "tabcontent7";
			if(strURLString == 'packages')			tabId = "tabcontent8";
			if(strURLString == 'aboutthispackage'){
				tabId = "tabcontent9";
				strURLString = 'aboutThisPackage';
			}
		
			if(resultCrs != "-1" || resultDiscipline != "-1" ||  strURLString == 'accesscodecard' || strURLString == 'websitecourse' || strURLString == 'otherresource' || strURLString == 'websiteresource' || strURLString == 'studentaccessresource' || strURLString == 'instructoraccessresource' || strURLString == 'studentaccess' || strURLString == 'instructoraccess' || strURLString == 'website' ||  strURLString == 'studentaccess1' || strURLString == 'downlaoddiv'){
				//showHideTab('elearning');
			}else if(document.getElementById(tabId)) {
					showHideTab(strURLString);
//[1] Mod end

			} else {
				showHideTab('aboutthebook');
			}			
		}
	}
	setTimeout("renderTab()",1000);
}
//7059 mod end.


function showHideTab(tabName)
{

	//[3]
	if(tabName == 'downloadableinstructorresources' || tabName == 'otherinstructorresources' || tabName == 'tabbed') {
	tabName = 'resources';
	}
		
	//alert( tabName == 'elearning');
	
	
	//Hiding all Tabs
	
	if(document.getElementById('tabcontent1')!=null)
		{		
			document.getElementById('tabcontent1').style.display = "none";
			document.getElementById('t1').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive_01.gif)";
			document.getElementById('t1').style.className = "";
	}
	if(document.getElementById('tabcontent2')!=null)
		{
			document.getElementById('tabcontent2').style.display = "none";	
			
			document.getElementById('t2').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab2Li').style.className = "";
	}
	if(document.getElementById('tabcontent3')!=null)
		{
			document.getElementById('tabcontent3').style.display = "none";
			document.getElementById('t3').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab3Li').style.className = "";		
	}
	if(document.getElementById('tabcontent4')!=null)
		{
			document.getElementById('tabcontent4').style.display = "none";
			document.getElementById('t4').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab4Li').style.className = "";				
	}
	if(document.getElementById('tabcontent5')!=null)
		{
			document.getElementById('tabcontent5').style.display = "none";
			document.getElementById('t5').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab5Li').style.className = "";	
	}
	if(document.getElementById('tabcontent6')!=null)
		{
			document.getElementById('tabcontent6').style.display = "none";
			document.getElementById('t6').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab6Li').style.className = "";	
	}
	if(document.getElementById('tabcontent7')!=null)
		{
			document.getElementById('tabcontent7').style.display = "none";
			document.getElementById('t7').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab7Li').style.className = "";	
	}
	if(document.getElementById('tabcontent8')!=null)
		{
			document.getElementById('tabcontent8').style.display = "none";
			document.getElementById('t8').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab8Li').style.className = "";	
	}
	if(document.getElementById('tabcontent9')!=null)
		{
			document.getElementById('tabcontent9').style.display = "none";
			document.getElementById('t9').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";
			document.getElementById('tab9Li').style.className = "";	
	}
	
	
	
	//alert("after loading inactive images");
	
	//checking which tab has been selected
	
	
	if(tabName == 'aboutthebook')
	{
	
	document.getElementById('t1').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_01.gif)";
		//alert('In about the book');
		document.getElementById('tabcontent1').style.display = "block";
		document.getElementById('subTabContent1').style.display = "block";
		//document.getElementById('subtabcontent1a').style.display = "block";
		//document.getElementById('subtabTopcontent1a').className = "selected";
		
		
	}
	
	
	
	
	
	if(tabName == 'takeacloserlook')
	{
	
		//alert('in Take a closer look');
		document.getElementById('t2').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
		
		document.getElementById('tabcontent2').style.display = "block";
		document.getElementById('subTabContent2').style.display = "block";
		document.getElementById('tab2Li').style.className = "selected";	
		var tclPromoCount = 0;
		if(document.getElementById('tclPromoCount') != null)
			{
				tclPromoCount = document.getElementById('tclPromoCount').value;
			}
		if(document.getElementById('subtabTopcontent2f') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent2f').style.className = "selected";
			//showHideSubTabs('takeacloserlook','subtabTopcontent2f','subtabcontent2f');
			//11th dec mod end
			var promo =0;
			var promo1= null;
			/* if(document.getElementById('cmaEditButtonsubtabcontentTclPromo21')!=null)
			{ */
				//document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).style.display = "block"; 
				for(var x = 1; x <= tclPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentTclPromo2'+x;
							promo1 = 'TclPromo2'+x;  

						}
				document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).style.className = "none";
					}
				}
				if(promo!=0)
				{
					document.getElementById(promo).style.display = "block";
					document.getElementById(promo).style.className = "selected";
					document.getElementById('subtabcontent2f').style.display = "none";
                    showHideSubTabs('takeacloserlook','subtabTopcontent'+promo1,'subtabcontent'+promo1);
				}
		}
		else
		{
			document.getElementById('tabcontent2').style.display = "block";
                document.getElementById('subTabContent2').style.display = "block";
                document.getElementById('tab2Li').style.className = "selected";

			/* if(document.getElementById('cmaEditButtonsubtabcontentTclPromo21')!=null)
			{ */
			var promo = 0;
			var promo1 = null;
				for(var x = 1; x <= tclPromoCount; x++)
				{
					//if(document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x) != null)
					if(document.getElementById('subtabTopcontentTclPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'subtabTopcontentTclPromo2'+x;
							promo1 = 'TclPromo2'+x;
						}
				/* document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).className = "none";
				var childNodes = document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).childNodes;
				var last = childNodes.length;
						for (var i = 0; i < last; i++)
						{
							var child = childNodes[i];
							if ( child.name == 'EditPromotion')
								child.style.display = "none";
						}*/
					}
				}
				if(promo!=0)
				{
					//document.getElementById(promo).style.display = "block";
					document.getElementById(promo).style.className = "selected";
					
                    showHideSubTabs('takeacloserlook','subtabTopcontent'+promo1,'subtabcontent'+promo1);
				}
		}
		
	}
	
	
	
	if(tabName == 'elearning')
	{
	
		//alert('in eLearning');
		document.getElementById('t3').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
				
		document.getElementById('tabcontent3').style.display = "block";
		document.getElementById('subTabContent3').style.display = "block";

		if(document.getElementById('subtabcontent3a') != null)
		{
								
			document.getElementById('subtabcontent3a').style.display = "block";
			document.getElementById('subtabTopcontent3a').className = "selected";
			
			if(document.getElementById('subtabcontent3b')!=null)
			document.getElementById('subtabcontent3b').style.display = "none";
			if(document.getElementById('subtabTopcontent3b')!=null)
			document.getElementById('subtabTopcontent3b').className = "";
			
			
			//Hiding the other Promotion Subtabs
		var elaPromoCount = 0;
						
				//alert(document.getElementById('tclPromoCount'));
					
				if(document.getElementById('elaPromoCount') != null)
				{
				//alert("Getting Tcl Promo Count");
				elaPromoCount = document.getElementById('elaPromoCount').value;
				}
						
				//alert("tcl Promo Count : " + tclPromoCount);
						
						
				for(var elaPromoCntr = 1;elaPromoCntr<= elaPromoCount;elaPromoCntr++)
				{
					if(document.getElementById('subtabcontentElaPromo2' + elaPromoCntr)!=null &&
					document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr)!=null )
					{
							
						//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
					   document.getElementById('subtabcontentElaPromo2' + elaPromoCntr).style.display = "none";
					   document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr).className = "";
							}
				}

		}
		
		
		//11th dec mod start
		/* else if(document.getElementById('subtabcontent3b') != null)
		{
								
			document.getElementById('subtabcontent3b').style.display = "block";
			document.getElementById('subtabTopcontent3b').className = "selected";
		} */
		//11th dec mod end
		var elaPromoCount = 0;
		if(document.getElementById('elaPromoCount') != null)
			{
				elaPromoCount = document.getElementById('elaPromoCount').value;
			}
		if(document.getElementById('subtabTopcontent3b') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent3b').style.className = "selected";
			//showHideSubTabs('elearning','subtabTopcontent3b','subtabcontent3b');
			//11th dec mod end
			/* if(document.getElementById('cmaEditButtonsubtabcontentElaPromo21')!=null)
			{ */
			var promo = 0;
			var promo1 = null;
				for(var x = 1; x <= elaPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentElaPromo2'+x;
							promo1 = 'ElaPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x).style.className = "none";
					}
				}
			if(document.getElementById('subtabcontent3a') == null)
			{
				if(promo!=0)
				{	
					document.getElementById(promo).style.display = "block";
					document.getElementById(promo).style.className = "selected";
					document.getElementById('subtabcontent3b').style.display = "none";
                    showHideSubTabs('elearning','subtabTopcontent'+promo1,'subtabcontent'+promo1);
				}
			}
		}
		else
		{
			document.getElementById('tabcontent3').style.display = "block";
                document.getElementById('subTabContent3').style.display = "block";
			//11th dec mod start
			/* if(document.getElementById('subtabcontentElaPromo21')!=null)
            { */
				for(var x = 1; x <= elaPromoCount; x++)
				{
					if(document.getElementById('subtabcontentElaPromo2'+x) != null)
					{
						//alert('subtabcontentElaPromo2'+x);
	                    document.getElementById('subtabcontentElaPromo2'+x).style.display = "none";
        	        }
				}
             // } //05th jan mod end
	        //11th dec mod end
			/* if(document.getElementById('cmaEditButtonsubtabcontentElaPromo21')!=null)
			{ */
			var promo = 0;
			var promo1 = null;
				for(var x = 1; x <= elaPromoCount; x++)
				{
					//if(document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x) != null)
					if(document.getElementById('subtabTopcontentElaPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'subtabTopcontentElaPromo2'+x;
							promo1 = 'ElaPromo2'+x;

						}
								/* document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x).className = "none";
                                var childNodes = document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x).childNodes;
                                var last = childNodes.length;
                                                for (var i = 0; i < last; i++)
                                                {
                                                        var child = childNodes[i];
                                                        if ( child.name == 'EditPromotion')
                                                                child.style.display = "none";
                                                } */
                                        }
                                }
					if(document.getElementById('subtabcontent3a') == null)
					{
						if(promo!=0)
						{	
							document.getElementById(promo).style.display = "block";
							document.getElementById(promo).style.className = "selected";
					showHideSubTabs('elearning','subtabTopcontent'+promo1,'subtabcontent'+promo1);
						}
					}
                }
	
	}
	
	
	
	
	if(tabName == 'resources')
		{
		
			//alert('in Take a closer look');
			document.getElementById('t4').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
			
			document.getElementById('tabcontent4').style.display = "block";
			document.getElementById('subTabContent4').style.display = "block";
		var resPromoCount = 0;
		if(document.getElementById('resPromoCount') != null)
			{
				resPromoCount = document.getElementById('resPromoCount').value;
			}
		if(document.getElementById('subtabTopcontent4e') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent4e').style.className = "selected";
			//showHideSubTabs('resources','subtabTopcontent4e','subtabcontent4e');
			//For CQ5063 START
			/* if(document.getElementById('subtabTopcontent4a') != null)
			{
				document.getElementById('subtabTopcontent4a').style.className = "selected";
				showHideSubTabs('resources','subtabTopcontent4a','subtabcontent4a');
			} */
			//For 	CQ5063 END
			//11th dec mod end
			/* if(document.getElementById('cmaEditButtonsubtabcontentResPromo21')!=null)
			{ */
			var promo =0;
			var promo1= null;
				for(var x = 1; x <= resPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentResPromo2'+x;
							promo1= 'ResPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x).style.className = "none";
					}
				}
			if(promo!=0)
			{
				document.getElementById(promo).style.display = "block";
				document.getElementById(promo).style.className = "selected";
				document.getElementById('subtabcontent4e').style.display = "none";
                showHideSubTabs('resources','subtabTopcontent'+promo1,'subtabcontent'+promo1);
			}
			//For CQ5063 START
			if(document.getElementById('subtabTopcontent4a') != null)
			{
				document.getElementById('subtabTopcontent4a').style.className = "selected";
				showHideSubTabs('resources','subtabTopcontent4a','subtabcontent4a');
			}
			//For 	CQ5063 END
		}

		else
		{
			document.getElementById('tabcontent4').style.display = "block";
                        document.getElementById('subTabContent4').style.display = "block";
			//For CQ5063 25th dec mod START
			/* if(document.getElementById('subtabTopcontent4a') != null)
			{
				document.getElementById('subtabTopcontent4a').style.className = "selected";
				showHideSubTabs('resources','subtabTopcontent4a','subtabcontent4a');
			} */
			//For CQ5063 25th dec mod END
			/* if(document.getElementById('cmaEditButtonsubtabcontentResPromo21')!=null)
			{ */
			var promo = 0;
			var promo1 = null;
				for(var x = 1; x <= resPromoCount; x++)
				{
					//if(document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x) != null)
					if(document.getElementById('subtabTopcontentResPromo2'+x) != null)
					{
						if(promo == 0)
						{
							//promo = 'cmaEditButtonsubtabcontentResPromo2'+x;
							promo = 'subtabTopcontentResPromo2'+x;
							promo1 = 'ResPromo2'+x;
						}
					/* document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x).className = "none";
                                var childNodes = document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x).childNodes;
                                var last = childNodes.length;
                                                for (var i = 0; i < last; i++)
                                                {
                                                        var child = childNodes[i];
                                                        if ( child.name == 'EditPromotion')
                                                                child.style.display = "none";
                                                } */
                                        }
                                }
			if(promo!=0)
			{
				//document.getElementById(promo).style.display = "block";
				document.getElementById(promo).style.className = "selected";
                showHideSubTabs('resources','subtabTopcontent'+promo1,'subtabcontent'+promo1);
			} else if(document.getElementById('subtabTopcontent4a') != null)
			{
				//Payal: changed here
			//05th jan mod end
			//For CQ5063 25th dec mod START
			
				//alert('subtabTopcontent4a');
				document.getElementById('subtabTopcontent4a').style.className = "selected";
				showHideSubTabs('resources','subtabTopcontent4a','subtabcontent4a');
			}
			//For CQ5063 25th dec mod END
		} //11th jan mod start and end

	}
	
	
	if(tabName == 'pearsonChoices')
		{
			
			//alert('in Take a closer look');
			document.getElementById('t5').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
				
			document.getElementById('tabcontent5').style.display = "block";
			document.getElementById('subTabContent5').style.display = "block";
				
			if(document.getElementById('subtabcontent5b')!=null)
			document.getElementById('subtabcontent5b').style.display = "none";
			if(document.getElementById('subtabTopcontent5b')!=null)
			document.getElementById('subtabTopcontent5b').className = "";
			
			
	if(document.getElementById('subtabcontent5a') != null)
		{
								
			document.getElementById('subtabcontent5a').style.display = "block";
			document.getElementById('subtabTopcontent5a').className = "selected";
			
			
			
			//Hiding the other Promotion Subtabs
		var pcPromoCount = 0;
						
				//alert(document.getElementById('tclPromoCount'));
					
				if(document.getElementById('pcPromoCount') != null)
				{
				//alert("Getting Tcl Promo Count");
				pcPromoCount = document.getElementById('pcPromoCount').value;
				}
						
				//alert("tcl Promo Count : " + tclPromoCount);
						
						
				for(var pcPromoCntr = 1;pcPromoCntr<= pcPromoCount;pcPromoCntr++)
				{
					if(document.getElementById('subtabcontentPcPromo2' + pcPromoCntr)!=null &&
					document.getElementById('subtabTopcontentPcPromo2' + pcPromoCntr)!=null )
					{
							
						//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
					   document.getElementById('subtabcontentPcPromo2' + pcPromoCntr).style.display = "none";
					   document.getElementById('subtabTopcontentPcPromo2' + pcPromoCntr).className = "";
							}
				}

		}
	//11th dec mod start
	/* else if(document.getElementById('subtabcontent5b') != null)
		{
								
			document.getElementById('subtabcontent5b').style.display = "block";
			document.getElementById('subtabTopcontent5b').className = "selected";
		}*/
	//11th dec mod end
			
			
		var pcPromoCount = 0;
		if(document.getElementById('pcPromoCount') != null)
			{
				pcPromoCount = document.getElementById('pcPromoCount').value;
			}
		if(document.getElementById('subtabTopcontent5b') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent5b').style.className = "selected";
			//showHideSubTabs('pearsonChoices','subtabTopcontent5b','subtabcontent5b');
			//11th dec mod end
			//5074 mod start
			if(document.getElementById('subtabcontent5a')== null)
			{
				document.getElementById('subtabTopcontent5b').style.className = "selected";
        	                showHideSubTabs('pearsonChoices','subtabTopcontent5b','subtabcontent5b');
			}
			// 5074 mod end
			/* if(document.getElementById('cmaEditButtonsubtabcontentPcPromo21')!=null)
			{ */
			var promo =0;
			var promo1 = null;
				for(var x = 1; x <= pcPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentPcPromo2'+x;
							promo1 = 'PcPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x).style.className = "none";
					}
				}
			if(document.getElementById('subtabcontent5a') == null)
			{
				if(promo!=0)
				{	
					document.getElementById(promo).style.display = "block";
					document.getElementById(promo).style.className = "selected";
					document.getElementById('subtabcontent5b').style.display = "none";
					showHideSubTabs('pearsonChoices','subtabTopcontent'+promo1,'subtabcontent'+promo1);

				}
			}
		}
		else
		{
			 //11th dec mod start
			/* if(document.getElementById('subtabcontentPcPromo21')!=null)
                        { */
			var promo =0;
			var promo1 = null;
					 for(var x = 1; x <= pcPromoCount; x++)
	                                 {
						 if(document.getElementById('subtabcontentPcPromo2'+x) != null)
                                        	{
                                                	//alert('subtabcontentPcPromo2'+x);
	                                                document.getElementById('subtabcontentPcPromo2'+x).style.display = "none";
        	                                }
					}
	        //11th dec mod end
			document.getElementById('tabcontent5').style.display = "block";
                        document.getElementById('subTabContent5').style.display = "block";

				/* if(document.getElementById('cmaEditButtonsubtabcontentPcPromo21')!=null)
				{ */
				var promo =0;
				var promo1 = null;
				for(var x = 1; x <= pcPromoCount; x++)
				{
						//if(document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x) != null)
						if(document.getElementById('subtabTopcontentPcPromo2'+x) != null)
						{
						if(promo == 0)
						{
							promo = 'subtabTopcontentPcPromo2'+x;
							promo1 = 'PcPromo2'+x;
						}
						}
                    }
					if(document.getElementById('subtabcontent5a') == null)
					{
						if(promo!=0)
						{	
							document.getElementById(promo).style.display = "block";
							document.getElementById(promo).style.className = "selected";
							showHideSubTabs('pearsonChoices','subtabTopcontent'+promo1,'subtabcontent'+promo1);
							/* var childNodes = document.getElementById(promo).childNodes;
                            var last = childNodes.length;
                            for (var i = 0; i < last; i++)
                            {
								var child = childNodes[i];
                                if ( child.name == 'EditPromotion')
									child.style.display = "none";
                            } */
                                        }
                                }
                }

			
			
		}
	
	
	
	
	
	
	
	if(tabName == 'series')
			{
				
				//alert('in Take a closer look');
				document.getElementById('t6').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
					
				document.getElementById('tabcontent6').style.display = "block";
				document.getElementById('subTabContent6').style.display = "block";
				if(document.getElementById('subtabcontent61') != null)
				{
					if(document.getElementById('subtabcontent6b')!=null)
					document.getElementById('subtabcontent6b').style.display = "none";
					if(document.getElementById('subtabTopcontent6b')!=null)
					document.getElementById('subtabTopcontent6b').className = "";
				}
				//11th dec mod start
				/* else
				{
					if(document.getElementById('subtabcontent6b')!=null)
					document.getElementById('subtabcontent6b').style.display = "block";
					if(document.getElementById('subtabTopcontent6b')!=null)
					document.getElementById('subtabTopcontent6b').className = "selected";
				} */
				//11th dec mod end
		var serPromoCount = 0;
		if(document.getElementById('serPromoCount') != null)
			{
				serPromoCount = document.getElementById('serPromoCount').value;
			}
		if(document.getElementById('subtabTopcontent6b') !=null)
		{
			//11th dec mod start
			//5074 mod start
			document.getElementById('subtabTopcontent6b').style.className = "selected";
                        showHideSubTabs('series','subtabTopcontent6b','subtabcontent6b');
			//5074 mod end
			//document.getElementById('subtabTopcontent6b').style.className = "selected";
			//showHideSubTabs('series','subtabTopcontent6b','subtabcontent6b');
			//11th dec mod end
			//05th jan mod start
			/* if(document.getElementById('cmaEditButtonsubtabcontentSerPromo21')!=null)
			{*/
			var promo = 0;
			var promo1 = null;
				for(var x = 1; x <= serPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentSerPromo2'+x;
							promo1 = 'SerPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x).style.className = "none";
					}
				}
			if(promo!=0)
			{
				document.getElementById(promo).style.display = "block";
				document.getElementById(promo).style.className = "selected";
				document.getElementById('subtabcontent6b').style.display = "none";
				showHideSubTabs('series','subtabTopcontent'+promo1,'subtabcontent'+promo1);

			}
		}

		else
		{
			document.getElementById('tabcontent6').style.display = "block";
                                document.getElementById('subTabContent6').style.display = "block";

			/* if(document.getElementById('cmaEditButtonsubtabcontentSerPromo21')!=null)
			{ */
			var promo =0 ;
			var promo1 = null;
				for(var x = 1; x <= serPromoCount; x++)
				{
					//if(document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x) != null)
					if(document.getElementById('subtabTopcontentSerPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'subtabTopcontentSerPromo2'+x;
							promo1 = 'SerPromo2'+x;
						}
				/*document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x).className = "none";
                                var childNodes = document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x).childNodes;
                                var last = childNodes.length;
                                                for (var i = 0; i < last; i++)
                                                {
                                                        var child = childNodes[i];
                                                        if ( child.name == 'EditPromotion')
                                                                child.style.display = "none";
                                                } */
                                        }
                                }
			if(promo!=0)
			{
				document.getElementById(promo).style.display = "block";
				document.getElementById(promo).style.className = "selected";
				//document.getElementById('subtabcontent6b').style.display = "none";
				showHideSubTabs('series','subtabTopcontent'+promo1,'subtabcontent'+promo1);
			}
                }
					
			}
	
	
	if(tabName == 'downloads')
			{
					
					//alert('in Take a closer look');
			document.getElementById('t7').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
						
			document.getElementById('tabcontent7').style.display = "block";
			document.getElementById('subTabContent7').style.display = "block";
						
			}
			
			
	if(tabName == 'aboutThisPackage')
			{
					
					//alert('in Take a closer look');
			document.getElementById('t9').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
						
			document.getElementById('tabcontent9').style.display = "block";
			document.getElementById('subTabContent9').style.display = "block";
						
			}		
	
	if(tabName == 'packages')
			{
					
					//alert('in Take a closer look');
			document.getElementById('t8').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active.gif)";
						
			document.getElementById('tabcontent8').style.display = "block";
			document.getElementById('subTabContent8').style.display = "block";
						
			}	

}







function showHideSubTabs(tabName,subtabId,subtabContentId)
{
	
	//alert(tabName + subtabId + subtabContentId);
	
	
	
	
	if(tabName == 'aboutthebook')
	{
		if(document.getElementById('subtabTopcontent1a')!=null)
		{
			document.getElementById('subtabTopcontent1a').className = "";
			document.getElementById('subtabcontent1a').style.display = "none";
		}
		
		
		
		if(document.getElementById('subtabTopcontent1b')!=null)
				{
					document.getElementById('subtabTopcontent1b').className = "";
					document.getElementById('subtabcontent1b').style.display = "none";
		}
		
		if(document.getElementById('subtabTopcontent1c')!=null)
				{
					document.getElementById('subtabTopcontent1c').className = "";
					document.getElementById('subtabcontent1c').style.display = "none";
		}
		
		if(document.getElementById('subtabTopcontent1d')!=null)
				{
					document.getElementById('subtabTopcontent1d').className = "";
					document.getElementById('subtabcontent1d').style.display = "none";
		}
		
		if(document.getElementById('subtabTopcontent1e')!=null)
				{
					document.getElementById('subtabTopcontent1e').className = "";
					document.getElementById('subtabcontent1e').style.display = "none";
		}
		
		if(document.getElementById('subtabTopcontent1f')!=null)
				{
					document.getElementById('subtabTopcontent1f').className = "";
					document.getElementById('subtabcontent1f').style.display = "none";
		}
		if(document.getElementById('subtabTopcontent1g')!=null)
				{
					document.getElementById('subtabTopcontent1g').className = "";
					document.getElementById('subtabcontent1g').style.display = "none";
		}
		if(document.getElementById('subtabTopcontent1h')!=null)
				{
					document.getElementById('subtabTopcontent1h').className = "";
					document.getElementById('subtabcontent1h').style.display = "none";
		}
	
		if(document.getElementById('subtabTopcontent1i')!=null)
				{
					document.getElementById('subtabTopcontent1i').className = "";
					document.getElementById('subtabcontent1i').style.display = "none";
		}
	
	}
	
	
	if(tabName == 'takeacloserlook')
	{
		
		if(document.getElementById('subtabTopcontent2a')!=null)
		{
			
			document.getElementById('subtabTopcontent2a').className = "";
			document.getElementById('subtabcontent2a').style.display = "none";
		}
		
		
		
		if(document.getElementById('subtabTopcontent2b')!=null)
		{	
			
			document.getElementById('subtabTopcontent2b').className = "";
			
			document.getElementById('subtabcontent2b').style.display = "none";
			
		}
		
		if(document.getElementById('subtabTopcontent2c')!=null)
				{
			document.getElementById('subtabTopcontent2c').className = "";
			document.getElementById('subtabcontent2c').style.display = "none";
		}
		
		if(document.getElementById('subtabTopcontent2d')!=null)
				{
			document.getElementById('subtabTopcontent2d').className = "";
			document.getElementById('subtabcontent2d').style.display = "none";
		}	
		if(document.getElementById('subtabTopcontent2e')!=null)
						{
			document.getElementById('subtabTopcontent2e').className = "";
			document.getElementById('subtabcontent2e').style.display = "none";
		}
		var tclPromoCount = 0;
		if(document.getElementById('tclPromoCount') != null)
		{
			tclPromoCount = document.getElementById('tclPromoCount').value;
		}
		if(document.getElementById('subtabTopcontent2f')!=null)
		{	
			document.getElementById('subtabTopcontent2f').className = "";
			document.getElementById('subtabcontent2f').style.display = "none";
			if(document.getElementById('cmaEditButton') !=null)
				document.getElementById('cmaEditButton').style.display = "none";
			var search = subtabId.search("TclPromo2");
			if(search == '-1')
			{
				for(var x = 1; x <= tclPromoCount; x++)
				{
						if(document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x) != null)
				document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).style.display = "none";
				}
			}
			else
			{
				for(var x = 1; x <= tclPromoCount; x++)
				{
					if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					{
						//Prabina MOD START
						/* var length = subtabContentId.length;
						var tempSubTabContentId = subtabContentId.substring(0,length-1);
						if( document.getElementById('cmaEditButton'+tempSubTabContentId+x) != null)
							document.getElementById('cmaEditButton'+tempSubTabContentId+x).style.display = "none"; */
						if(document.getElementById('cmaEditButton'+'subtabcontentTclPromo2'+x) != null)
							document.getElementById('cmaEditButton'+'subtabcontentTclPromo2'+x).style.display = "none";

					 //Prabina MOD END
					}
				}
				if(document.getElementById('cmaEditButton'+subtabContentId) != null)
				{
					document.getElementById('cmaEditButton'+subtabContentId).style.display = "block";
				}
			}

		}
		
		
		
		var tclPromoCount = 0;
				
		//alert(document.getElementById('tclPromoCount'));
			
		if(document.getElementById('tclPromoCount') != null)
		{
		//alert("Getting Tcl Promo Count");
		tclPromoCount = document.getElementById('tclPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var tclPromoCntr = 1;tclPromoCntr<= tclPromoCount;tclPromoCntr++)
		{
			if(document.getElementById('subtabcontentTclPromo2' + tclPromoCntr)!=null &&
			document.getElementById('subtabTopcontentTclPromo2' + tclPromoCntr)!=null )
			{
					
				//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
			   document.getElementById('subtabcontentTclPromo2' + tclPromoCntr).style.display = "none";
			   document.getElementById('subtabTopcontentTclPromo2' + tclPromoCntr).className = "";
					}
		}
		
		
		
		
		
		
	
	}
	
	
	
	
	if(tabName == 'elearning')
	{
	
		if(document.getElementById('subtabTopcontent3a')!=null)
						{
			document.getElementById('subtabTopcontent3a').className = "";
			if(document.getElementById('subtabcontent3a')!=null)
			document.getElementById('subtabcontent3a').style.display = "none";
		}	
		
				if(document.getElementById('subtabTopcontent3b')!=null)
						{
			document.getElementById('subtabTopcontent3b').className = "";
			document.getElementById('subtabcontent3b').style.display = "none";
		}	
//[1] Add Start		
		if(document.getElementById('subtabTopcontent3c')!=null)
			{
	
				document.getElementById('subtabTopcontent3c').className = "";
				document.getElementById('subtabcontent3c').style.display = "none";
			}
			if(document.getElementById('subtabTopcontent3d')!=null)
			{
				document.getElementById('subtabTopcontent3d').className = "";
				document.getElementById('subtabcontent3c').style.display = "none";
			}
			if(document.getElementById('subtabTopcontent3e')!=null)
			{
				document.getElementById('subtabTopcontent3e').className = "";
				document.getElementById('subtabcontent3c').style.display = "none";
			}
//[1] Add End		
		
		var elaPromoCount = 0;
				
		//alert(document.getElementById('tclPromoCount'));
			
		if(document.getElementById('elaPromoCount') != null)
		{
		//alert("Getting Tcl Promo Count");
		elaPromoCount = document.getElementById('elaPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var elaPromoCntr = 1;elaPromoCntr<= elaPromoCount;elaPromoCntr++)
		{
			if(document.getElementById('subtabcontentElaPromo2' + elaPromoCntr)!=null &&
			document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr)!=null )
			{
					
				//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
			   document.getElementById('subtabcontentElaPromo2' + elaPromoCntr).style.display = "none";
			   document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr).className = "";
					}
		}
			
		var elaPromoCount = 0;
		if(document.getElementById('elaPromoCount') != null)
		{
			elaPromoCount = document.getElementById('elaPromoCount').value;
		}
		if(document.getElementById('subtabTopcontent3b')!=null)
		{
			document.getElementById('subtabTopcontent3b').className = "";
			document.getElementById('subtabcontent3b').style.display = "none";
			var search = subtabId.search("ElaPromo2");
			if(search == '-1')
			{
				for(var x = 1; x <= elaPromoCount; x++)
				{
						if(document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x) != null)
				document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x).style.display = "none";
				}
			}
			else
			{
				for(var x = 1; x <= elaPromoCount; x++)
				{
					if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					{
						//Prabina MOD START
						/* var length = subtabContentId.length;
						var tempSubTabContentId = subtabContentId.substring(0,length-1);
						if(document.getElementById('cmaEditButton'+tempSubTabContentId+x) != null)
							document.getElementById('cmaEditButton'+tempSubTabContentId+x).style.display = "none"; */
						if(document.getElementById('cmaEditButton'+'subtabcontentElaPromo2'+x) != null)
							document.getElementById('cmaEditButton'+'subtabcontentElaPromo2'+x).style.display = "none";

					 //Prabina MOD END
					}
				}
				if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					document.getElementById('cmaEditButton'+subtabContentId).style.display = "block";
			}

		}
	
		
		 var elaPromoCount = 0;
	
		if(document.getElementById('elaPromoCount') != null)
		{
		elaPromoCount = document.getElementById('elaPromoCount').value;
		}
		for(var elaPromoCntr = 1;elaPromoCntr<= elaPromoCount;elaPromoCntr++)
		{
			if(document.getElementById('subtabcontentElaPromo2' + elaPromoCntr)!=null &&
			document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr)!=null )
			{
			   document.getElementById('subtabcontentElaPromo2' + elaPromoCntr).style.display = "none";
			   document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr).className = "";
			}
		}
			
			
	}
	
	
	
	if(tabName == 'resources')
	{
		
			if(document.getElementById('subtabTopcontent4a')!=null)
			{
				
				document.getElementById('subtabTopcontent4a').className = "";
				document.getElementById('subtabcontent4a').style.display = "none";
			}
			
			
			
			if(document.getElementById('subtabTopcontent4b')!=null)
			{	
				
				document.getElementById('subtabTopcontent4b').className = "";
				
				document.getElementById('subtabcontent4b').style.display = "none";
				
			}
			
			if(document.getElementById('subtabTopcontent4c')!=null)
					{
				document.getElementById('subtabTopcontent4c').className = "";
				document.getElementById('subtabcontent4c').style.display = "none";
			}
			
			if(document.getElementById('subtabTopcontent4d')!=null)
					{
				document.getElementById('subtabTopcontent4d').className = "";
				document.getElementById('subtabcontent4d').style.display = "none";
			}		
			if(document.getElementById('subtabTopcontent4e')!=null)
							{
				document.getElementById('subtabTopcontent4e').className = "";
				document.getElementById('subtabcontent4e').style.display = "none";
			}
		

		
			var resPromoCount = 0;
				
			//alert(document.getElementById('tclPromoCount'));
				
		if(document.getElementById('resPromoCount') != null)
		{
			//alert("Getting Tcl Promo Count");
			resPromoCount = document.getElementById('resPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var resPromoCntr = 1;resPromoCntr<= resPromoCount;resPromoCntr++)
		{
			if(document.getElementById('subtabcontentResPromo2' + resPromoCntr)!=null &&
			document.getElementById('subtabTopcontentResPromo2' + resPromoCntr)!=null )
			{
			
				//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
				document.getElementById('subtabcontentResPromo2' + resPromoCntr).style.display = "none";
				document.getElementById('subtabTopcontentResPromo2' + resPromoCntr).className = "";
				
			}
		}
						
			
		var resPromoCount = 0;
		if(document.getElementById('resPromoCount') != null)
		{
			resPromoCount = document.getElementById('resPromoCount').value;
		}
		if(document.getElementById('subtabTopcontent4e')!=null)
		{
			document.getElementById('subtabTopcontent4e').className = "";
			document.getElementById('subtabcontent4e').style.display = "none";
			var search = subtabId.search("ResPromo2");
			if(search == '-1')
			{
				//alert('Other Tab');
				for(var x = 1; x <= resPromoCount; x++)
				{
						if(document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x) != null)
				document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x).style.display = "none";
				}
			}
			else
			{
				for(var x = 1; x <= resPromoCount; x++)
				{
					if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					{
						//Prabina Mod start
						/* var length = subtabContentId.length;
						var tempSubTabContentId = subtabContentId.substring(0,length-1);
						if(document.getElementById('cmaEditButton'+tempSubTabContentId+x) != null)
				document.getElementById('cmaEditButton'+tempSubTabContentId+x).style.display = "none"; */
				if(document.getElementById('cmaEditButton'+'subtabcontentResPromo2'+x) != null)
					document.getElementById('cmaEditButton'+'subtabcontentResPromo2'+x).style.display = "none";
						//Prabina MOD END
					}
				}
				if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					document.getElementById('cmaEditButton'+subtabContentId).style.display = "block";
			}

		}
			
			
	
	
	}
	
	
	
	if(tabName == 'pearsonChoices')
	{
	
		if(document.getElementById('subtabTopcontent5a')!=null)
						{
			document.getElementById('subtabTopcontent5a').className = "";
			document.getElementById('subtabcontent5a').style.display = "none";
		}	
		if(document.getElementById('subtabTopcontent5b')!=null)
						{
			document.getElementById('subtabTopcontent5b').className = "";
			document.getElementById('subtabcontent5b').style.display = "none";
		}	
		
		
		
		
		
		var pcPromoCount = 0;
				
		//alert(document.getElementById('pcPromoCount'));
			
		if(document.getElementById('pcPromoCount') != null)
		{
		//alert("Getting Tcl Promo Count");
		pcPromoCount = document.getElementById('pcPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var pcPromoCntr = 1;pcPromoCntr<= pcPromoCount;pcPromoCntr++)
		{
			if(document.getElementById('subtabcontentPcPromo2' + pcPromoCntr)!=null &&
			document.getElementById('subtabTopcontentPcPromo2' + pcPromoCntr)!=null )
			{
					
				//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
			   document.getElementById('subtabcontentPcPromo2' + pcPromoCntr).style.display = "none";
			   document.getElementById('subtabTopcontentPcPromo2' + pcPromoCntr).className = "";
			}
		}
			
		var pcPromoCount = 0;
		if(document.getElementById('pcPromoCount') != null)
		{
			pcPromoCount = document.getElementById('pcPromoCount').value;
		}
		if(document.getElementById('subtabTopcontent5b')!=null)
		{
			document.getElementById('subtabTopcontent5b').className = "";
			document.getElementById('subtabcontent5b').style.display = "none";
			var search = subtabId.search("PcPromo2");
			if(search == '-1')
			{
				//alert('Other Tab');
				for(var x = 1; x <= pcPromoCount; x++)
				{
						if(document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x) != null)
				document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x).style.display = "none";
				}
			}
			else
			{
				for(var x = 1; x <= pcPromoCount; x++)
				{
					if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					{
						/* var length = subtabContentId.length;
						var tempSubTabContentId = subtabContentId.substring(0,length-1);
					if(document.getElementById('cmaEditButton'+tempSubTabContentId+x) != null)
				document.getElementById('cmaEditButton'+tempSubTabContentId+x).style.display = "none"; */
					if(document.getElementById('cmaEditButton'+'subtabcontentPcPromo2'+x) != null)
				document.getElementById('cmaEditButton'+'subtabcontentPcPromo2'+x).style.display = "none";
					}
				}
				if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					document.getElementById('cmaEditButton'+subtabContentId).style.display = "block";
			}

		}
	
	}
	
	
	
	
	
	
	if(tabName == 'series')
	{
		
		
		
		var serPromoCount = 0;
				
		//alert(document.getElementById('pcPromoCount'));
			
		if(document.getElementById('serPromoCount') != null)
		{
		
		serPromoCount = document.getElementById('serPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var serPromoCntr = 1;serPromoCntr<= serPromoCount;serPromoCntr++)
		{
			if(document.getElementById('subtabcontentSerPromo2' + serPromoCntr)!=null &&
			document.getElementById('subtabTopcontentSerPromo2' + serPromoCntr)!=null )
			{
					
				//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
			   document.getElementById('subtabcontentSerPromo2' + serPromoCntr).style.display = "none";
			   document.getElementById('subtabTopcontentSerPromo2' + serPromoCntr).className = "";
			}
		}
					
		
		
		
		var count = 0;
		
		if(document.getElementById('seriesCount')!=null)
		{
			count = document.getElementById('seriesCount').value;
		}
		
		
		var cnt = 1;
			
			
			
		for(cnt=1;cnt<=count;cnt++)
		{
			if(document.getElementById('subtabcontent6'+cnt) != null && 
			document.getElementById('subtabTopcontent6'+cnt)!=null)
			{
					
				document.getElementById('subtabcontent6'+cnt).style.display = "none";
				document.getElementById('subtabTopcontent6'+cnt).className = "none";
					
			}	

		}	
		
		var serPromoCount = 0;
		if(document.getElementById('serPromoCount') != null)
		{
			serPromoCount = document.getElementById('serPromoCount').value;
		}
		if(document.getElementById('subtabTopcontent6b')!=null)
		{
			document.getElementById('subtabTopcontent6b').className = "";
			document.getElementById('subtabcontent6b').style.display = "none";
			var search = subtabId.search("SerPromo2");
			if(search == '-1')
			{
				//alert('Other Tab');
				for(var x = 1; x <= serPromoCount; x++)
				{
						if(document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x) != null)
				document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x).style.display = "none";
				}
			}
			else
			{
				for(var x = 1; x <= serPromoCount; x++)
				{
					if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					{
						/* var length = subtabContentId.length;
						var tempSubTabContentId = subtabContentId.substring(0,length-1);
				if( document.getElementById('cmaEditButton'+tempSubTabContentId+x) != null)
				document.getElementById('cmaEditButton'+tempSubTabContentId+x).style.display = "none"; */
				if( document.getElementById('cmaEditButton'+'subtabcontentSerPromo2'+x) != null)
				document.getElementById('cmaEditButton'+'subtabcontentSerPromo2'+x).style.display = "none";
					}
				}
				if(document.getElementById('cmaEditButton'+subtabContentId) != null)
					document.getElementById('cmaEditButton'+subtabContentId).style.display = "block";
			}

		}
	
	}
	

	document.getElementById(subtabId).className = "selected";

	document.getElementById(subtabContentId).style.display = "block";
	

	
}






function initializeTabs()
{
	//alert('initializeTabs : Start');

	
	//For the default tab : about the book / Package
	
	
	
	
	
	
	
	
	
	//Initialize tab images
	
	if(document.getElementById('t1')!=null)
	{
		document.getElementById('t1').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
	}
	
	
	if(document.getElementById('t2')!=null)
	{
		document.getElementById('t2').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";	
	}
	
	if(document.getElementById('t3')!=null)
		{
			document.getElementById('t3').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";	
	}
	
	if(document.getElementById('t4')!=null)
	{
		document.getElementById('t4').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";	
	}	
	
	if(document.getElementById('t5')!=null)
	{
		document.getElementById('t5').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";	
	}
	
	if(document.getElementById('t6')!=null)
	{
		document.getElementById('t6').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";	
	}	
	
	if(document.getElementById('t7')!=null)
		{
			document.getElementById('t7').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";	
	}
	
	
	if(document.getElementById('t9')!=null)
		{
			document.getElementById('t9').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive.gif)";	
	}
	
	if(document.getElementById('t8')!=null)
		{
			document.getElementById('t8').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_inactive_last.gif)";	
	}
	
	
	//alert('After setting images');
	
	
		//About the book
		
		if(document.getElementById('tabcontent1')!=null)
		{
			document.getElementById('tabcontent1').style.display = "none";
		}	
			
		if(document.getElementById('subTabContent1')!=null)
			document.getElementById('subTabContent1').style.display = "none";
		
		
		
		if(document.getElementById('subtabcontent1a')!=null)
		{	document.getElementById('subtabcontent1a').style.display = "block";
	
			document.getElementById('subtabTopcontent1a').className = "selected";
		}
		else if(document.getElementById('subtabcontent1b')!=null)
		{	document.getElementById('subtabcontent1b').style.display = "block";
	
			document.getElementById('subtabTopcontent1b').className = "selected";
		}
		else if(document.getElementById('subtabcontent1c')!=null)
		{	document.getElementById('subtabcontent1c').style.display = "block";
	
			document.getElementById('subtabTopcontent1c').className = "selected";
		}
		else if(document.getElementById('subtabcontent1d')!=null)
		{	document.getElementById('subtabcontent1d').style.display = "block";
	
			document.getElementById('subtabTopcontent1d').className = "selected";
		}
		else if(document.getElementById('subtabcontent1e')!=null)
		{	document.getElementById('subtabcontent1e').style.display = "block";
			
			document.getElementById('subtabTopcontent1e').className = "selected";
		}
		else if(document.getElementById('subtabcontent1f')!=null)
		{	document.getElementById('subtabcontent1f').style.display = "block";
					
			document.getElementById('subtabTopcontent1f').className = "selected";
		}
		else if(document.getElementById('subtabcontent1g')!=null)
		{	document.getElementById('subtabcontent1g').style.display = "block";
					
			document.getElementById('subtabTopcontent1g').className = "selected";
		}
		else if(document.getElementById('subtabcontent1h')!=null)
		{	document.getElementById('subtabcontent1h').style.display = "block";
					
			document.getElementById('subtabTopcontent1h').className = "selected";
		}
		else if(document.getElementById('subtabcontent1i')!=null)
		{	document.getElementById('subtabcontent1i').style.display = "block";
					
			document.getElementById('subtabTopcontent1i').className = "selected";
		}
	
		//alert('1');
		
	
	
		//For the Tab Take a closer look
	
	
		if(document.getElementById('tabcontent2')!=null)
		{
			document.getElementById('tabcontent2').style.display = "none";
		}
		
		if(document.getElementById('subTabContent2')!=null)
		document.getElementById('subTabContent2').style.display = "none";
		
		
		
		var isTclPromoPresent = false;
		
		
		var tclPromoCount = 0;
				
		//alert(document.getElementById('tclPromoCount'));
				
		if(document.getElementById('tclPromoCount') != null)
		{
			//alert("Getting Tcl Promo Count");
			tclPromoCount = document.getElementById('tclPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var tclPromoCntr = 1;tclPromoCntr<= tclPromoCount;tclPromoCntr++)
		{
			if(document.getElementById('subtabcontentTclPromo2' + tclPromoCntr)!=null &&
			document.getElementById('subtabTopcontentTclPromo2' + tclPromoCntr)!=null )
			{
					
				//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
				document.getElementById('subtabcontentTclPromo2' + tclPromoCntr).style.display = "block";
				document.getElementById('subtabTopcontentTclPromo2' + tclPromoCntr).className = "selected";
				
				isTclPromoPresent = true;
				break;
					}
		}
		
		
		//alert(isTclPromoPresent);
		
		if(isTclPromoPresent)
		{
			//alert(isTclPromoPresent);
		}
		else if(document.getElementById('subtabcontent2a') != null)
		{
			
			document.getElementById('subtabcontent2a').style.display = "block";
			document.getElementById('subtabTopcontent2a').className = "selected";
			
		}
		else if(document.getElementById('subtabcontent2b') != null)
		{
			document.getElementById('subtabcontent2b').style.display = "block";
			document.getElementById('subtabTopcontent2b').className = "selected";
		}
		else if(document.getElementById('subtabcontent2c') != null)
		{
			document.getElementById('subtabcontent2c').style.display = "block";
			document.getElementById('subtabTopcontent2c').className = "selected";
		}
		else if(document.getElementById('subtabcontent2d') != null)
		{
			document.getElementById('subtabcontent2d').style.display = "block";
			document.getElementById('subtabTopcontent2d').className = "selected";
		}
		else if(document.getElementById('subtabcontent2e') != null)
		{
			document.getElementById('subtabcontent2e').style.display = "block";
			document.getElementById('subtabTopcontent2e').className = "selected";
		}	
		
	else if(document.getElementById('subtabcontent2f') != null)
		{
				document.getElementById('subtabcontent2f').style.display = "block";	
			document.getElementById('subtabTopcontent2f').className = "selected";
		}
		
	
	//alert(2);
	if(document.getElementById('subtabTopcontent2f') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent2f').style.className = "selected";
			//showHideSubTabs('takeacloserlook','subtabTopcontent2f','subtabcontent2f');
			//11th dec mod end
			var promo =0;
			var promo1= null;
			/* if(document.getElementById('cmaEditButtonsubtabcontentTclPromo21')!=null)
			{ */
				//document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).style.display = "block"; 
				 if(document.getElementById('tclPromoCount') != null)
        		        {
	                	        //alert("Getting Tcl Promo Count");
	        	                tclPromoCount = document.getElementById('tclPromoCount').value;
        	        	}

				for(var x = 1; x <= tclPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentTclPromo2'+x;
							promo1 = 'TclPromo2'+x;  

						}
				document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentTclPromo2'+x).style.className = "none";
					}
				}
				if(promo!=0)
				{
					document.getElementById(promo).style.display = "block";
					document.getElementById(promo).style.className = "selected";
					document.getElementById('subtabcontent2f').style.display = "none";
                    showHideSubTabs('takeacloserlook','subtabTopcontent'+promo1,'subtabcontent'+promo1);
				}
		}
	
	//For the tab : eLearning 
		
		if(document.getElementById('tabcontent3')!=null)
		document.getElementById('tabcontent3').style.display = "none";
		
		if(document.getElementById('subTabContent3'))
		document.getElementById('subTabContent3').style.display = "none";
					
					
			
		//alert();			
		if(document.getElementById('subtabcontent3a') != null)
		{
						
			document.getElementById('subtabcontent3a').style.display = "block";
			document.getElementById('subtabTopcontent3a').className = "selected";
		}
//[1] Add Start
		if(document.getElementById('subtabcontent3c') != null)
			document.getElementById('subtabcontent3c').style.display = "block";
		/*else if(document.getElementById('subtabcontent3b') != null)
		{
						
			document.getElementById('subtabcontent3b').style.display = "block";
			document.getElementById('subtabTopcontent3b').className = "selected";
		}*/
//[1] Add End
		else{
		
		//alert();
		var elaPromoCount = 0;
				
		//alert(document.getElementById('elaPromoCount'));
				
		if(document.getElementById('elaPromoCount') != null)
		{
			//alert("Getting ELA Promo Count");
			elaPromoCount = document.getElementById('elaPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var elaPromoCntr = 1;elaPromoCntr<= elaPromoCount;elaPromoCntr++)
		{
			if(document.getElementById('subtabcontentElaPromo2' + elaPromoCntr)!=null &&
			document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr)!=null )
			{
					
				//alert("Found Ela Promo Sub tab for index : " + elaPromoCntr);
				document.getElementById('subtabcontentElaPromo2' + elaPromoCntr).style.display = "block";
				document.getElementById('subtabTopcontentElaPromo2' + elaPromoCntr).className = "selected";
				break;
					}
		}	
		
		}
		
		
		
		
	//alert('after Tab 3');
	if(document.getElementById('subtabTopcontent3b') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent3b').style.className = "selected";
			//showHideSubTabs('elearning','subtabTopcontent3b','subtabcontent3b');
			//11th dec mod end
			/* if(document.getElementById('cmaEditButtonsubtabcontentElaPromo21')!=null)
			{ */
			var promo = 0;
			var promo1 = null;
			if(document.getElementById('elaPromoCount') != null)
	                {
        	                //alert("Getting ELA Promo Count");
                	        elaPromoCount = document.getElementById('elaPromoCount').value;
	                }

				for(var x = 1; x <= elaPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentElaPromo2'+x;
							promo1 = 'ElaPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentElaPromo2'+x).style.className = "none";
					}
				}
			if(document.getElementById('subtabcontent3a') == null)
			{
				if(promo!=0)
				{	
					document.getElementById(promo).style.display = "block";
					document.getElementById(promo).style.className = "selected";
					document.getElementById('subtabcontent3b').style.display = "none";
                    showHideSubTabs('elearning','subtabTopcontent'+promo1,'subtabcontent'+promo1);
				}
			}
		}
	
	//For the Tab : Resources
			
			if(document.getElementById('tabcontent4')!=null)
			document.getElementById('tabcontent4').style.display = "none";
			
			if(document.getElementById('subTabContent4')!=null)
			document.getElementById('subTabContent4').style.display = "none";
			
			
			//alert();
			
			
			
			var isResPromoPresent = false;
		
		
			var resPromoCount = 0;
				
			//alert(document.getElementById('tclPromoCount'));
				
		if(document.getElementById('resPromoCount') != null)
		{
			//alert("Getting Tcl Promo Count");
			resPromoCount = document.getElementById('resPromoCount').value;
		}
				
		//alert("tcl Promo Count : " + tclPromoCount);
				
				
		for(var resPromoCntr = 1;resPromoCntr<= resPromoCount;resPromoCntr++)
		{
			if(document.getElementById('subtabcontentResPromo2' + resPromoCntr)!=null &&
			document.getElementById('subtabTopcontentResPromo2' + resPromoCntr)!=null )
			{
					
				//alert("Found Tcl Promo Sub tab for index : " + tclPromoCntr);
				document.getElementById('subtabcontentResPromo2' + resPromoCntr).style.display = "block";
				document.getElementById('subtabTopcontentResPromo2' + resPromoCntr).className = "selected";
				
				isResPromoPresent = true;
				break;
					}
		}
					
			
			
			
			
			
			
			if(isResPromoPresent)
			{
			
			}
			
			else if(document.getElementById('subtabcontent4a') != null)
			{
				
				document.getElementById('subtabcontent4a').style.display = "block";
				document.getElementById('subtabTopcontent4a').className = "selected";
			}
			else if(document.getElementById('subtabcontent4b') != null)
			{
				document.getElementById('subtabcontent4b').style.display = "block";
				document.getElementById('subtabTopcontent4b').className = "selected";
			}
			else if(document.getElementById('subtabcontent4c') != null)
			{
				document.getElementById('subtabcontent4c').style.display = "block";
				document.getElementById('subtabTopcontent4c').className = "selected";
			}
			else if(document.getElementById('subtabcontent4d') != null)
			{
				document.getElementById('subtabcontent4d').style.display = "block";
				document.getElementById('subtabTopcontent4d').className = "selected";
			}
			else if(document.getElementById('subtabcontent4e') != null)
			{
				document.getElementById('subtabcontent4e').style.display = "block";
				document.getElementById('subtabTopcontent4e').className = "selected";
			}
	
	//alert('after Tab 4');
	if(document.getElementById('subtabTopcontent4e') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent4e').style.className = "selected";
			//showHideSubTabs('resources','subtabTopcontent4e','subtabcontent4e');
			//For CQ5063 START
			/* if(document.getElementById('subtabTopcontent4a') != null)
			{
				document.getElementById('subtabTopcontent4a').style.className = "selected";
				showHideSubTabs('resources','subtabTopcontent4a','subtabcontent4a');
			} */
			//For 	CQ5063 END
			//11th dec mod end
			/* if(document.getElementById('cmaEditButtonsubtabcontentResPromo21')!=null)
			{ */
			var promo =0;
			var promo1= null;
			 if(document.getElementById('resPromoCount') != null)
                        {
                                 //alert("Getting Tcl Promo Count");
                                resPromoCount = document.getElementById('resPromoCount').value;
                        }

			 if(document.getElementById('resPromoCount') != null)
	                {
        			 //alert("Getting Tcl Promo Count");
	                        resPromoCount = document.getElementById('resPromoCount').value;
        	        }

				for(var x = 1; x <= resPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentResPromo2'+x;
							promo1= 'ResPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentResPromo2'+x).style.className = "none";
					}
				}
			if(promo!=0)
			{
				document.getElementById(promo).style.display = "block";
				document.getElementById(promo).style.className = "selected";
				document.getElementById('subtabcontent4e').style.display = "none";
                showHideSubTabs('resources','subtabTopcontent'+promo1,'subtabcontent'+promo1);
			}
			//For CQ5063 START
			if(document.getElementById('subtabTopcontent4a') != null)
			{
				document.getElementById('subtabTopcontent4a').style.className = "selected";
				showHideSubTabs('resources','subtabTopcontent4a','subtabcontent4a');
			}
			//For 	CQ5063 END
		}
	
	//Pearson Choices
		if(document.getElementById('tabcontent5')!=null)
			document.getElementById('tabcontent5').style.display = "none";
				
		if(document.getElementById('subTabContent5')!=null)
			document.getElementById('subTabContent5').style.display = "none";
			
		if(document.getElementById('subtabcontent5a') != null)
		{
							
			document.getElementById('subtabcontent5a').style.display = "block";
			document.getElementById('subtabTopcontent5a').className = "selected";
		}
		if(document.getElementById('subtabcontent5b') != null)
		{
							
			document.getElementById('subtabcontent5b').style.display = "block";
			document.getElementById('subtabTopcontent5b').className = "selected";
		}
		
		else{
				
				//alert();
			var pcPromoCount = 0;
						
			//alert(document.getElementById('pcPromoCount'));
						
			if(document.getElementById('pcPromoCount') != null)
			{
				//alert("Getting PC Promo Count");
				pcPromoCount = document.getElementById('pcPromoCount').value;
			}
						
				//alert("PC Promo Count : " + pcPromoCount);
						
						
		for(var pcPromoCntr = 1;pcPromoCntr<= pcPromoCount;pcPromoCntr++)
		{
			if(document.getElementById('subtabcontentPcPromo2' + pcPromoCntr)!=null &&
				document.getElementById('subtabTopcontentPcPromo2' + pcPromoCntr)!=null )
				{
							
				//alert("Found PC Promo Sub tab for index : " + pcPromoCntr);
				document.getElementById('subtabcontentPcPromo2' + pcPromoCntr).style.display = "block";
				document.getElementById('subtabTopcontentPcPromo2' + pcPromoCntr).className = "selected";
				break;
				}
			}	
				
		}

		
		
		if(document.getElementById('subtabTopcontent5b') !=null)
		{
			//11th dec mod start
			//document.getElementById('subtabTopcontent5b').style.className = "selected";
			//showHideSubTabs('pearsonChoices','subtabTopcontent5b','subtabcontent5b');
			//11th dec mod end
			//5074 mod start
			if(document.getElementById('subtabcontent5a')== null)
			{
				document.getElementById('subtabTopcontent5b').style.className = "selected";
        	                showHideSubTabs('pearsonChoices','subtabTopcontent5b','subtabcontent5b');
			}
			// 5074 mod end
			/* if(document.getElementById('cmaEditButtonsubtabcontentPcPromo21')!=null)
			{ */
			var promo =0;
			var promo1 = null;
				for(var x = 1; x <= pcPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentPcPromo2'+x;
							promo1 = 'PcPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentPcPromo2'+x).style.className = "none";
					}
				}
			if(document.getElementById('subtabcontent5a') == null)
			{
				if(promo!=0)
				{	
					document.getElementById(promo).style.display = "block";
					document.getElementById(promo).style.className = "selected";
					document.getElementById('subtabcontent5b').style.display = "none";
					showHideSubTabs('pearsonChoices','subtabTopcontent'+promo1,'subtabcontent'+promo1);

				}
			}
		}
		
		
		
		
		
		
		
		
		//alert("After  Tab 5");
		
		
		
		//Series Tab
		
		if(document.getElementById('tabcontent6')!=null)
			document.getElementById('tabcontent6').style.display = "none";
			
		if(document.getElementById('subTabContent6')!=null)
			document.getElementById('subTabContent6').style.display = "none";	
		
	var isSeriesPromoPresent = false;	
		
	var serPromoCount = 0;
							
		//alert(document.getElementById('serPromoCount'));
							
		if(document.getElementById('serPromoCount') != null)
		{
			//alert("Getting PC Promo Count");
		serPromoCount = document.getElementById('serPromoCount').value;
			}
							
		//alert("PC Promo Count : " + serPromoCount);
							
							
		for(var serPromoCntr = 1;serPromoCntr<= serPromoCount;serPromoCntr++)
		{
			//alert('Ser promo Cntr : ' + serPromoCntr);
		
			if(document.getElementById('subtabcontentSerPromo2' + serPromoCntr)!=null &&
			document.getElementById('subtabTopcontentSerPromo2' + serPromoCntr)!=null )
			{
								
			//alert("Found SER Promo Sub tab for index : " + serPromoCntr);
			document.getElementById('subtabcontentSerPromo2' + serPromoCntr).style.display = "block";
			document.getElementById('subtabTopcontentSerPromo2' + serPromoCntr).className = "selected";
			isSeriesPromoPresent = true;		
			break;
			}
		}
		
		
		
			
		//alert(isSeriesPromoPresent);
		
		if(!isSeriesPromoPresent)	
		{	
			//alert("Checking for Series sub Tabs");
			var count = 0 ; 
			
			if(null!=document.getElementById('seriesCount'))
			
			{
				count =	document.getElementById('seriesCount').value;
			}
			var cnt = 1;
			
			
			
			for(cnt=1;cnt<=count;cnt++)
			{
				if(document.getElementById('subtabcontent6'+cnt) != null)
				{
					
					document.getElementById('subtabcontent6'+cnt).style.display = "block";
					document.getElementById('subtabTopcontent6'+cnt).className = "selected";
					break;
				}	

			}
		}	
			
		if(document.getElementById('subtabTopcontent6b') !=null)
		{
			//11th dec mod start
			//5074 mod start
			document.getElementById('subtabTopcontent6b').style.className = "selected";
                        showHideSubTabs('series','subtabTopcontent6b','subtabcontent6b');
			//5074 mod end
			//document.getElementById('subtabTopcontent6b').style.className = "selected";
			//showHideSubTabs('series','subtabTopcontent6b','subtabcontent6b');
			//11th dec mod end
			//05th jan mod start
			/* if(document.getElementById('cmaEditButtonsubtabcontentSerPromo21')!=null)
			{*/
			var promo = 0;
			var promo1 = null;
			 if(document.getElementById('serPromoCount') != null)
	                {
        	                //alert("Getting PC Promo Count");
		                serPromoCount = document.getElementById('serPromoCount').value;
                        }

				for(var x = 1; x <= serPromoCount; x++)
				{
					if(document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x) != null)
					{
						if(promo == 0)
						{
							promo = 'cmaEditButtonsubtabcontentSerPromo2'+x;
							promo1 = 'SerPromo2'+x;
						}
				document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x).style.display = "none";
				document.getElementById('cmaEditButtonsubtabcontentSerPromo2'+x).style.className = "none";
					}
				}
			if(promo!=0)
			{
				document.getElementById(promo).style.display = "block";
				document.getElementById(promo).style.className = "selected";
				document.getElementById('subtabcontent6b').style.display = "none";
				showHideSubTabs('series','subtabTopcontent'+promo1,'subtabcontent'+promo1);

			}
		}
		
		//alert("after Tab 6");
			if(document.getElementById('tabcontent7')!=null)
			document.getElementById('tabcontent7').style.display = "none";
					
			if(document.getElementById('subTabContent7')!=null)
			document.getElementById('subTabContent7').style.display = "none";
			
			
			if(document.getElementById('subtabcontent7a') != null)
			{
							
				document.getElementById('subtabcontent7a').style.display = "block";
				document.getElementById('subtabTopcontent7a').className = "selected";
			}	
			
			
			if(document.getElementById('tabcontent9')!=null)
						document.getElementById('tabcontent9').style.display = "none";
								
						if(document.getElementById('subTabContent9')!=null)
						document.getElementById('subTabContent9').style.display = "none";
						
						
						if(document.getElementById('subtabcontent9a') != null)
						{
										
							document.getElementById('subtabcontent9a').style.display = "block";
							document.getElementById('subtabTopcontent9a').className = "selected";
						}	
			
			
			
	
		//alert("After Tab 7");
		
		
				if(document.getElementById('tabcontent9')!=null)
			document.getElementById('tabcontent9').style.display = "none";
			
			if(document.getElementById('subTabContent9')!=null)
			document.getElementById('subTabContent9').style.display = "none";
	
	
			if(document.getElementById('subtabcontent9a') != null)
			{
								
			document.getElementById('subtabcontent9a').style.display = "block";
			document.getElementById('subtabTopcontent9a').className = "selected";
			}	
		
		
		
		
		//After Tab 9
			if(document.getElementById('tabcontent8')!=null)
			document.getElementById('tabcontent8').style.display = "none";
			
			if(document.getElementById('subTabContent8')!=null)
			document.getElementById('subTabContent8').style.display = "none";
	
	
			if(document.getElementById('subtabcontent8a') != null)
			{
								
			document.getElementById('subtabcontent8a').style.display = "block";
			document.getElementById('subtabTopcontent8a').className = "selected";
			}
	
	
	
	
	setupDefaultTab();
	
	hidePromotionPipes();
	
	//alert(document.getElementById('seriesCount').value);
	
	//alert('initializeTabs : End');

}


function queryStringValue(findName){
		var name = new String();
		var value = new String();
		var querystring = document.location.href;
		
		if(querystring.indexOf("?")==-1){
			return "null";
		}
		
		querystring = querystring.split("?");
		querystring = querystring[1].split("&");

		for(q=0;q<querystring.length;q++){
		  var pair = querystring[q].split("=");
		  name = pair[0].toLowerCase();
		  value = pair[1].toLowerCase();
		if(findName.toLowerCase() == name){
			return value;
		}
	  }
}



function setupDefaultTab()
{
	var hasURLString = window.location.href.indexOf('-');
	
	if (hasURLString != -1) 
	{
		var	strURLString = window.location.href.substring(hasURLString, window.location.href.length);
		var indexOfcolon = strURLString.indexOf('-');
		var indexOfComma = strURLString.indexOf(',');
		var queryString = queryStringValue('isbn').toUpperCase();
		if(queryString!='' && (queryString.indexOf('-IS')!=-1 || queryString.indexOf('-SS')!=-1)){
			var	strURLString2 = strURLString.substring(indexOfcolon+1,strURLString.length).toUpperCase();
		}else{
			var	strURLString2 = strURLString.substring(indexOfcolon+1,indexOfComma).toUpperCase();
		}
	}
	
//	if(strURLString2=='ABI' || strURLString2=='TOC'|| strURLString2=='SS' || strURLString2=='IS'|| strURLString2=='FEA'|| strURLString2=='NTE'|| strURLString2=='TOC'){

	if(strURLString2=='SS' || strURLString2=='IS'){
		
			// ABI=about the author
			//SS = student source
			//IS = Resource
			//FEA= features
			//NTE = new to edition
			//TOC = table of content
			
		/*	if(strURLString2=='ABI'){
			
					showHideTab('aboutthebook');
					showHideSubTabs('aboutthebook','subtabTopcontent1a','subtabcontent1a');
			}
			else if(strURLString2=='TOC' )			
				{
					if(document.getElementById('subtabTopcontent1d')!=null)
					{
						showHideSubTabs('aboutthebook','subtabTopcontent1d','subtabcontent1d');
					}
					else{
						showHideTab('aboutthebook');
					}
					
				}
			else if(strURLString2=='NTE' )
				{
					showHideSubTabs('aboutthebook','subtabTopcontent1c','subtabcontent1c');
				}
			else if(strURLString2=='SS' )
				{
					showHideSubTabs('resources','subtabTopcontent4b','subtabcontent4b');
				}
			else if(strURLString2=='IS' )
				{
				showHideTab('resources');
			showHideSubTabs('resources','subtabTopcontent4a','subtabcontent4a');
				} */

			if(strURLString2=='IS'){
			
				if(document.getElementById('tabcontent4')!=null)
					{

						showHideTab('resources');
						window.location.hash="resources"
				}
					else{
						executeDefaultTab();
					}
			}
			else if(strURLString2=='SS')			
				{
					if(document.getElementById('tabcontent4')!=null)
					{

						showHideTab('resources');
						window.location.hash="resources"
					}
					else{
						executeDefaultTab();
					}
					
				}
				
	}
		else
		{
			executeDefaultTab();
		
	}
	// end of else 
}






function executeDefaultTab(){

//alert('setup Default Tab :start');
	if(document.getElementById('t1')!=null)
	{
		document.getElementById('t1').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
		if(document.getElementById('subTabContent1')!=null)
			document.getElementById('subTabContent1').style.display = "block";
			
		if(document.getElementById('tabcontent1')!=null)
		{
			document.getElementById('tabcontent1').style.display = "block";
		}	
	}
	
	
	else if(document.getElementById('t2')!=null)
	{
		document.getElementById('t2').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
		if(document.getElementById('subTabContent2')!=null)
			document.getElementById('subTabContent2').style.display = "block";
			
		if(document.getElementById('tabcontent2')!=null)
		{
			document.getElementById('tabcontent2').style.display = "block";
		}	
			
	}
	
	else if(document.getElementById('t3')!=null)
	{
		document.getElementById('t3').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
		if(document.getElementById('subTabContent3')!=null)
			document.getElementById('subTabContent3').style.display = "block";
			
		if(document.getElementById('tabcontent3')!=null)
		{
			document.getElementById('tabcontent3').style.display = "block";
		}	
	}
	
	else if(document.getElementById('t4')!=null)
	{
		document.getElementById('t4').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
		if(document.getElementById('subTabContent4')!=null)
			document.getElementById('subTabContent4').style.display = "block";
			
		if(document.getElementById('tabcontent4')!=null)
		{
			document.getElementById('tabcontent4').style.display = "block";
		}	
	}	
	
	else if(document.getElementById('t5')!=null)
	{
		document.getElementById('t5').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
		if(document.getElementById('subTabContent5')!=null)
			document.getElementById('subTabContent5').style.display = "block";
			
		if(document.getElementById('tabcontent5')!=null)
		{
			document.getElementById('tabcontent5').style.display = "block";
		}	
	}
	
	else if(document.getElementById('t6')!=null)
	{
		document.getElementById('t6').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
		if(document.getElementById('subTabContent6')!=null)
			document.getElementById('subTabContent6').style.display = "block";
			
		if(document.getElementById('tabcontent6')!=null)
		{
			document.getElementById('tabcontent6').style.display = "block";
		}	
	}	
	
	else if(document.getElementById('t7')!=null)
		{
			document.getElementById('t7').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
			if(document.getElementById('subTabContent7')!=null)
			document.getElementById('subTabContent7').style.display = "block";
			
		if(document.getElementById('tabcontent7')!=null)
		{
			document.getElementById('tabcontent7').style.display = "block";
		}	
	}
	else if(document.getElementById('t9')!=null)
			{
				document.getElementById('t9').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_first.gif)";	
				if(document.getElementById('subTabContent9')!=null)
				document.getElementById('subTabContent9').style.display = "block";
				
			if(document.getElementById('tabcontent9')!=null)
			{
				document.getElementById('tabcontent9').style.display = "block";
			}	
		}
	
	
	else if(document.getElementById('t8')!=null)
		{
			
			//alert();
			document.getElementById('t8').style.background="url(/assets/hip/us/hip_us_pearsonhighered/images/tab_active_last.gif)";	
			if(document.getElementById('subTabContent8')!=null)
			document.getElementById('subTabContent8').style.display = "block";
			
		if(document.getElementById('tabcontent8')!=null)
		{
			document.getElementById('tabcontent8').style.display = "block";
		}	
	}
//alert('setup Default Tab :end ');

}


function pop_display_download(p_isbn) {
	//alert(p_isbn);
  document.getElementById(p_isbn).style.display='block';
//[2] Mod Start
  document.getElementById(p_isbn+'_show').style.display='none';
  document.getElementById(p_isbn+'_hide').style.display='block';
//[2] Mod end
  return false;
}
function hide_display_download(p_isbn) {
  document.getElementById(p_isbn).style.display='none';
//[2] Mod Start
  document.getElementById(p_isbn+'_show').style.display='block';
  document.getElementById(p_isbn+'_hide').style.display='none';
  return false;
}

function pop_display_all() {
  document.getElementById('showAllDownlaodLinks').style.display='none';
  document.getElementById('hideAllDownlaodLinks').style.display='block';
  var dlink =document.getElementsByName('downloaddivlist');
  if(dlink.length == 'undefined'){
	document.getElementById(dlink.value).style.display='block';
	document.getElementById(dlink.value+'_show').style.display='none';
  document.getElementById(dlink.value+'_hide').style.display='block';
  }else{
  for (var i=0; i < dlink.length; i++) {
	document.getElementById(dlink[i].value+'_show').style.display='none';
	document.getElementById(dlink[i].value+'_hide').style.display='block';
     document.getElementById(dlink[i].value).style.display='block';
  }
}
//[2] Mod end  
  //return false;
}

//[2] Mod Start
function pop_display(p_isbn) {
	//alert(p_isbn);
  document.getElementById(p_isbn).style.display='block';
  //return false
}
function hide_display(p_isbn) {
  document.getElementById(p_isbn).style.display='none';
  //return false
}

function pop_hide_all() {
   document.getElementById('showAllDownlaodLinks').style.display='block';
  document.getElementById('hideAllDownlaodLinks').style.display='none';
  var dlink =document.getElementsByName('downloaddivlist');
  if(dlink.length == 'undefined'){
	document.getElementById(dlink.value+'_show').style.display='block';
	document.getElementById(dlink.value+'_hide').style.display='none';
	document.getElementById(dlink.value).style.display='none';
  }else{
  for (var i=0; i < dlink.length; i++) {
	document.getElementById(dlink[i].value+'_show').style.display='block';
	document.getElementById(dlink[i].value+'_hide').style.display='none';
     document.getElementById(dlink[i].value).style.display='none';
  }
  }
  return false;
}
//[2] Mod end

function pop_desc(p_isbn) {
  
  document.getElementById(p_isbn).style.display='block';
  return false
}

function hide_desc(p_isbn) {
  document.getElementById(p_isbn).style.display='none';
  return false
}

function pop2() {
  document.getElementById('popoverdiv2').style.display='block';
  return false
}
function hide2() {
  document.getElementById('popoverdiv2').style.display='none';
  return false
}



function showAlert()
{//alert();
}
//[2] Mod Start
function printPage()
{
var popupwindow='<div id="print-controls"><form><h1 class="headerClass">Custom Print Controls <span class="popupheaderclass" id="x" class="close">close</span></h1><div class="col group">';
 var popupwindowlower='</form><div id="button-controls"><button id="open-print">Print the page</button><button id="cancel" class="close">Cancel</button></div></div>';
 var midprintcontrol='';
 //396775
 //var windowUrl = 'PrintThisPage.html';
 var windowUrl = '/assets/hip/html/PrintThisPage.html';	
 var uniqueName = new Date();
 var windowName = 'Print' + uniqueName.getTime();
 var printWindow = window.open(windowUrl, windowName);
 var finalprintcontent="";
var printcontent="";
var startBody='<!--[if IE]><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><![endif]--><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><link rel="stylesheet" type="text/css" href="/assets/hip/us/hip_us_pearsonhighered/css/customforPrint.css" media="all" /><link rel="stylesheet" type="text/css" href="/assets/hip/us/hip_us_pearsonhighered/css/masterprint.css" media="all" /><link rel="stylesheet" type="text/css" href="/assets/hip/us/hip_us_pearsonhighered/css/print.css" media="print" /><script type="text/javascript" src="/assets/hip/us/hip_us_pearsonhighered/scripts/jqueryprint.js"></script><script type="text/javascript" src="/assets/hip/us/hip_us_pearsonhighered/scripts/mainprint.js"></script><!--[if IE 7]><link rel="stylesheet" type="text/css" href="/assets/hip/us/hip_us_pearsonhighered/css/ie7.css" media="all" /><![endif]--><link rel="stylesheet" type="text/css" href="/assets/hip/us/hip_us_pearsonhighered/css/reset.css" media="all" /><title>Pearson - '+document.getElementById("printableTitleName").innerHTML+'</title></head><body class="vanilla"><a name="top" id="top" class="anchor"></a>';
var upperBody='<div id="wrap" class="close group">'; 
var countryOfUser="";
if(document.getElementById('loggedInDiv')!=null){
	if(document.getElementById('usercountry')!=null){
	countryOfUser=document.getElementById('usercountry').value;
	}
	if(countryOfUser=='USA'){
	upperBody=upperBody+'<div id="loggedInDiv" style="display: none; "></div>';
	}
	}
upperBody=upperBody+'<div id="badge" style="display: none; "></div><div id="header"><button id="custom-print-button">Customize Print Output</button><img src="/assets/hip/us/hip_us_pearsonhighered/images/pearson_logo.gif" id="logo" alt="Pearson" /></div><dl class="tab"><dd class="paratab">';
var lowerBody='</div></div><br/><br/><div id="footer" style="text-align:center;"><p>&copy; Copyright <span class="popupheaderclass" id="current-year-footer"></span> Pearson Education. All Rights Reserved.</p></div></body></html>';
 finalprintcontent=finalprintcontent+upperBody+'<table><tr><td valign="top"><div class="cover fLeft">'+document.getElementById("printablelargebook").innerHTML+'</div></td><td><div id="largedesc">'+document.getElementById("largedesc").innerHTML+'</div></td></tr></table></dd></dl></br><br class="clear" /><div class="marketing-copy">';
// About The Book
 var aboutthebook='<dl id="about-the-book-tab" class="tab"><dt class="headingtab">ABOUT THE BOOK</dt><dd>';

 var flag=0;
 var printContentObject= document.getElementById("printablesubtabcontent1a");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="description" class="copy-type"><dt class="subheadingtype">Description</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
 midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-description" id="cb-description" value="description" class="sub" checked="checked" /><label for="cb-description">Description</label></dd>';
 }
var printContentObject = document.getElementById("printablesubtabcontent1b");
if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="features" class="copy-type"><dt class="subheadingtype">Features</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-features" id="cb-features" class="sub" value="features" checked="checked" /><label for="cb-features">Features</label></dd>';
}
 var printContentObject = document.getElementById("printablesubtabcontent1c");
if(printContentObject.innerHTML!=""){
 flag=1;
 printcontent=printcontent+'<dl id="new-to-this-edition" class="copy-type"><dt class="subheadingtype">New to This Edition</dt><dd class="paratab">'+printContentObject.innerHTML+'<ul/></dd></dl>';
 midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-new-to-this-edition" id="cb-new-to-this-edition" class="sub" checked="checked" value="new-to-this-edition" /><label for="cb-new-to-this-edition">New to This Edition</label></dd>';
 }
 var printContentObject = document.getElementById("printablesubtabcontent1d");
if(printContentObject.innerHTML!=""){
 flag=1;
 printcontent=printcontent+'<dl id="table-of-contents" class="copy-type"><dt class="subheadingtype">Table of Contents</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
 midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-table-of-contents" id="cb-table-of-contents" class="sub" checked="checked" value="table-of-contents" /><label for="cb-table-of-contents">Table of Contents</label></dd>';
 }
 var printContentObject = document.getElementById("printablesubtabcontent1e");
if(printContentObject.innerHTML!=""){
 flag=1;
 printcontent=printcontent+'<dl id="course" class="copy-type"><dt class="subheadingtype">Courses</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
 midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-course" id="cb-course" class="sub" checked="checked" value="course" /><label for="cb-course">Courses</label></dd>';
 }
/* var printContentObject = document.getElementById("printablesubtabcontent1f");
if(printContentObject.innerHTML!=""){
 flag=1;
 printcontent=printcontent+'<dl id="previous-editions" class="copy-type"><dt class="subheadingtype">Previous Edition(s)</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
 midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-previous-editions" id="cb-previous-editions" class="sub" checked="checked" value="previous-editions" /><label for="cb-previous-editions">Previous Edition(s)</label></dd>';
 }
 var printContentObject = document.getElementById("printablesubtabcontent1g");
if(printContentObject.innerHTML!=""){
 flag=1;
 printcontent=printcontent+'<dl id="next-edition" class="copy-type"><dt class="subheadingtype">Next Edition(s)</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
 midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-next-editions" id="cb-next-editions" class="sub" checked="checked" value="next-edition" /><label for="cb-next-editions">Next Edition(s)</label></dd>';
 } */
if(flag==1){
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-about-the-book" id="cb-tab-about-the-book" value="about-the-book-tab" class="master" checked="checked" /><label for="cb-tab-about-the-book">About the Book</label></dt>'+midprintcontrol+'</dl>';
finalprintcontent=finalprintcontent+aboutthebook+printcontent+'<dd></dd><br /></dd></dl>';
}

//Take a Closer Look
var takeacloserlook='<dl id="take-a-closer-look" class="tab"><dt class="headingtab">TAKE A CLOSER LOOK</dt><dd>';
printcontent="";
flag=0;
midprintcontrol='';
 var printContentObject = document.getElementById("printablesubtabcontent2a");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="producttour" class="copy-type"><dt class="subheadingtype">Product Tour</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-product-tour" id="cb-product-tour" value="producttour" class="sub" /><label for="cb-product-tour">Product Tour</label></dd>';
}


 var printContentObject = document.getElementById("printablesubtabcontent2b");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="samplechapter" class="copy-type"><dt class="subheadingtype">Sample Chapter</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-sample-chapter" id="cb-sample-chapter" value="samplechapter" class="sub"  /><label for="cb-sample-chapter">Sample Chapter</label></dd>';
}




 var printContentObject = document.getElementById("printablesubtabcontent2c");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="reviews" class="copy-type"><dt class="subheadingtype">Reviews</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-reviews" id="cb-reviews" value="reviews" class="sub" /><label for="cb-reviews">Reviews</label></dd>';
}


 var printContentObject = document.getElementById("printablesubtabcontent2d");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="about-the-authers" class="copy-type"><dt class="subheadingtype">Author Bios</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-author-bios" id="cb-author-bios" value="about-the-authers" class="sub" /><label for="cb-author-bios">Author Bios</label></dd>';
}


 var printContentObject = document.getElementById("printablesubtabcontent2e");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="back-cover-copy" class="copy-type"><dt class="subheadingtype">Back Cover Copy</dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-back-cover-copy" id="cb-back-cover-copy" value="back-cover-copy" class="sub"  /><label for="cb-back-cover-copy">Back Cover Copy</label></dd>';
}

if(flag==1){
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-take-a-closer-look" id="cb-take-a-closer-look" value="take-a-closer-look" class="master"  /><label for="cb-take-a-closer-look">Take a closer look</label></dt>'+midprintcontrol+'</dl>';
finalprintcontent=finalprintcontent+takeacloserlook+printcontent+'<dd></dd><br /></dd></dl>';

}

//Elearning
/*var elearning='<dl id="elearning-assesment" class="tab"><dt class="headingtab">eLearning & Assessment</dt><dd class="paratab">';
printcontent="";
midprintcontrol='';
flag=0;
 var printContentObject = document.getElementById("printablesubtabcontent3a");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl class="copy-type"><dt class="subheadingtype"></dt><dd ><div class="product-list">'+printContentObject.innerHTML+'</div></dd></dl>';
}
if(flag==1){
finalprintcontent=finalprintcontent+elearning+printcontent+'<dd></dd><br /></dd></dl>';
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-elearning" id="cb-tab-elearning" value="elearning-assesment" class="master"  /><label for="cb-tab-packages">eLearning & Assessments</label></dt></dl>';
} */

//Resources
var resources='<dl id="resources" class="tab"><dt class="headingtab">Resources</dt><dd>';
printcontent="";
midprintcontrol='';
flag=0;

 var printContentObject = document.getElementById("printablesubtabcontent4a");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="instructor" class="copy-type"><dt class="subheadingtype">Instructor Resources</dt><dd class="paratab"><br/>'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-resources-instructor" id="cb-resources-instructor" value="instructor" class="sub"  /><label for="cb-resources-instructor">Instructor Resources</label></dd>';
}


 var printContentObject = document.getElementById("printablesubtabcontent4b");
 if(printContentObject.innerHTML!=""){
 flag=1;
 //alert(printContentObject.innerHTML);
 //alert(document.getElementById("subtabcontent4b").innerHTML);
printcontent=printcontent+'<dl id="student" class="copy-type"><dt class="subheadingtype">Student Resources</dt><dd class="paratab">'+document.getElementById("subtabcontent4b").innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-resources-student" id="cb-resources-student" value="student" class="sub"  /><label for="cb-resources-student">Student Resources</label></dd>';
}

 var printContentObject = document.getElementById("printablesubtabcontent4c");
 if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl id="courseanddiscipline" class="copy-type"><dt class="subheadingtype">Course & Discipline Resources</dt><dd class="paratab"><br/>'+printContentObject.innerHTML+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-resources-course-and-discipline" id="cb-resources-course-and-discipline" value="courseanddiscipline" class="sub"  /><label for="cb-resources-course-and-discipline">Course &amp; Discipline Resources</label></dd>';
}
 var printContentObject = document.getElementById("printablesubtabcontent3a");
 if(printContentObject.innerHTML!=""){
 flag=1;
 
 if(document.getElementById("subtabcontent3a")!=null){
  printContentObject=document.getElementById("subtabcontent3a").innerHTML;
 }else{
	printContentObject=document.getElementById("subtabcontent4d").innerHTML;
 }
printcontent=printcontent+'<dl id="eassmnt" class="copy-type"><dt class="subheadingtype">eLearning & Assessment</dt><dd class="paratab">'+printContentObject+'</dd></dl>';
midprintcontrol=midprintcontrol+'<dd><input type="checkbox" name="cb-elearning-assessment" id="cb-elearning-assessment" value="eassmnt" class="sub"  /><label for="cb-elearning-assessment">eLearning &amp; Assessment Resources</label></dd>';
}
if(flag==1){
finalprintcontent=finalprintcontent+resources+printcontent+'<dd></dd><br /></dd></dl>';
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-resources" id="cb-tab-resources" value="resources" class="master"  /><label for="cb-tab-resources">Resources</label></dt>'+midprintcontrol+'</dl>';
} 
popupwindow=popupwindow+'</div><!-- end left column --><div class="col group">';
//Pearson Choices
var pearsonchoices='<dl id="pearson-choices" class="tab"><dt class="headingtab">PearsonChoices</dt><dd>';
printcontent="";
midprintcontrol='';
flag=0;
var printContentObject = document.getElementById("printablesubtabcontent5a");
if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl class="copy-type"><dt class="subheadingtype"></dt><dd class="paratab">'+document.getElementById("subtabcontent5a").innerHTML+'</dd></dl>';
}
if(flag==1){
finalprintcontent=finalprintcontent+pearsonchoices+printcontent+'<dd></dd><br /></dd></dl>';
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-pearson-choices" id="cb-tab-pearson-choices" value="pearson-choices" class="master"  /><label for="cb-tab-pearson-choices">PearsonChoices</label></dt><dd><p>A variety of text and media formats to best match students\' learning style and budget.</p></dd></dl>';
}

//Series
/*var series='<dl id="series" class="tab"><dt class="headingtab">Series</dt><dd>';
printcontent="";
midprintcontrol='';
flag=0;
var printContentObject = document.getElementById("printablesubtabcontent6a");
if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl class="copy-type"><dt class="subheadingtype"></dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
}
if(flag==1){
finalprintcontent=finalprintcontent+series+printcontent+'<dd></dd><br /></dd></dl>';
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-series" id="cb-tab-series" value="series" class="master"  /><label for="cb-tab-series">Series</label></dt></dl>';

} */
//Download
var download='<dl id="download" class="tab"><dt class="headingtab">Download</dt><dd>';
printcontent="";
midprintcontrol='';
flag=0;
var printContentObject = document.getElementById("printablesubtabcontent7a");
if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl class="copy-type"><dt class="subheadingtype"></dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
}
if(flag==1){
finalprintcontent=finalprintcontent+download+printcontent+'<dd></dd><br /></dd></dl>';
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-download" id="cb-tab-download" value="download" class="master"  /><label for="cb-tab-download">Download</label></dt></dl>';
}
// About the pakages
var aboutthispackage='<dl id="about-this-package" class="tab"><dt class="headingtab">About This Package</dt><dd>';
printcontent="";
midprintcontrol='';
flag=0;
var printContentObject = document.getElementById("printablesubtabcontent9a");
if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl class="copy-type"><dt class="subheadingtype"></dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
}
if(flag==1){
finalprintcontent=finalprintcontent+aboutthispackage+printcontent+'<dd></dd><br /></dd></dl>';
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-aboutthispackage" id="cb-tab-aboutthispackage" value="about-this-package" class="master"  /><label for="cb-tab-aboutthispackage">About This Package</label></dt></dl>';
}
// packages
var packages='<dl id="packages" class="tab"><dt class="headingtab">Packages</dt><dd>';
printcontent="";
midprintcontrol='';
flag=0;
var printContentObject = document.getElementById("printablesubtabcontent8a");
if(printContentObject.innerHTML!=""){
 flag=1;
printcontent=printcontent+'<dl class="copy-type"><dt class="subheadingtype"></dt><dd class="paratab">'+printContentObject.innerHTML+'</dd></dl>';
}
if(flag==1){
finalprintcontent=finalprintcontent+packages+printcontent+'<dd></dd><br /></dd></dl>';
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-packages" id="cb-tab-packages" value="packages" class="master"  /><label for="cb-tab-packages">Packages</label></dt></dl>';
}
popupwindow=popupwindow+'<dl><dt><input type="checkbox" name="cb-tab-pricing" id="cb-tab-pricing" value="pricing-information-tab" class="master"  /><label for="cb-tab-pricing">Pricing Information</label></dt><dd><p>To view net price, close this window and log in, then click the "Print this page" link again.</p></dd><dd><input type="checkbox" name="cb-price-net" id="cb-price-net" value="price-net" class="sub disabled" disabled="disabled" /><label for="cb-price-net" class="disabled" id="net-label">Net price</label></dd><dd><input type="checkbox" name="cb-price-retail" id="cb-price-retail" value="price-retail" class="sub" /><label for="cb-price-retail">Suggested retail price</label></dd></dl></div>';
popupwindow=popupwindow+popupwindowlower;
finalprintcontent=startBody+popupwindow+finalprintcontent;
finalprintcontent=finalprintcontent+lowerBody;
finalprintcontent=finalprintcontent.replace(/Back to top/g, "");
finalprintcontent=finalprintcontent.replace(/Buy from myPearsonStore/g, "");
finalprintcontent=finalprintcontent.replace(/View Downloadable Files/g, "");
finalprintcontent=finalprintcontent.replace(/Brief Description/g, "");
finalprintcontent=finalprintcontent.replace(/More Info/g, "");
printWindow.document.write(finalprintcontent);
printWindow.document.close();
 printWindow.focus();
//printWindow.print();
}
//[2] Mod end


function hidePromotionPipes()
{


//TCL
var counter = 0;
var lastPromo = 0;

var promoCount = 0;

var nonPromoContent = false;

	if(document.getElementById('tclPromoCount') != null)
	{
			//alert("Getting Tcl Promo Count");
			promoCount = document.getElementById('tclPromoCount').value;
	}

	if(document.getElementById('tclNonPromoContent')!=null)
	{
	
		nonPromoContent = true;
	}

//alert('TCL promo count : ' + promoCount + ' : tclNonPromoContent Flag : ' + nonPromoContent );

var index = 1;

	if(!nonPromoContent &&  promoCount > 0)
	{
		for(index = 1;index <= promoCount ;index++)
		{
				if(document.getElementById('takeacloserlookSeparator' + index)!=null )
			{
				lastPromo = index;
			}


		}

	}


	//alert('lastTclPromo : ' + lastPromo);

	if(lastPromo > 0)
	{
		if(		document.getElementById('takeacloserlookSeparator' + lastPromo)!=null )
				document.getElementById('takeacloserlookSeparator' + lastPromo).style.display = 'none';
	}



// RES 
lastPromo = 0;

promoCount = 0;

nonPromoContent = false;

	if(document.getElementById('resPromoCount') != null)
	{
			//alert("Getting Tcl Promo Count");
			promoCount = document.getElementById('resPromoCount').value;
	}

	if(document.getElementById('resNonPromoContent')!=null)
	{
	
		nonPromoContent = true;
	}

//alert('RES promo count : ' + promoCount + ' : resNonPromoContent Flag : ' + nonPromoContent );

index = 1;

	if(!nonPromoContent &&  promoCount > 0)
	{
		for(index = 1;index <= promoCount ;index++)
		{
				if(document.getElementById('resourcesSeparator' + index)!=null )
			{
				lastPromo = index;
			}


		}

	}


	//alert('lastResPromo : ' + lastPromo);

	if(lastPromo > 0)
	{
		if(		document.getElementById('resourcesSeparator' + lastPromo)!=null )
				document.getElementById('resourcesSeparator' + lastPromo).style.display = 'none';
	}


	//SER


	lastPromo = 0;

	promoCount = 0;

	nonPromoContent = false;

		if(document.getElementById('seriesCount') != null)
		{
				//alert("Getting Tcl Promo Count");
				promoCount = document.getElementById('seriesCount').value;
		}

		if(document.getElementById('serNonPromoContent')!=null)
		{
		
			nonPromoContent = true;
		}

	//alert('SER promo count : ' + promoCount + ' : serNonPromoContent Flag : ' + nonPromoContent );

	index = 1;

		if(!nonPromoContent &&  promoCount > 0)
		{
			for(index = 1;index <= promoCount ;index++)
			{
					if(document.getElementById('seriesSeparator' + index)!=null )
				{
					lastPromo = index;
				}


			}

		}


		//alert('lastSerPromo : ' + lastPromo);

		if(lastPromo > 0)
		{
			if(		document.getElementById('seriesSeparator' + lastPromo)!=null )
					document.getElementById('seriesSeparator' + lastPromo).style.display = 'none';
		}



}


	//[1] Add Start

	function changeLinkColor(listId){

		var courseSupplementList= document.getElementById(listId);	
		var lineItemList= courseSupplementList.getElementsByTagName("li");
			for(var i = 0; i < lineItemList.length; i++)
				{
					var anchorLink=lineItemList[i].getElementsByTagName("a");
					anchorLink[0].style.color='navy';
					anchorLink[0].style.textDecoration='underline';
				}
	}

	
		
	//[1] Add End

	//[3] Add Start
	function turnLinkGray(linkId){
			var anchorLink=document.getElementById(linkId);
			anchorLink.style.color= 'rgb(100,100,100)';
			anchorLink.style.textDecoration='none';

	}
	function resetAllLink(){
			if(document.getElementById('instructorResourcesSubListInline')) {
				changeLinkColor('instructorResourcesSubListInline');
			}
			if(document.getElementById('studentResourceListInline')) {
				changeLinkColor('studentResourceListInline');
			}
			if(document.getElementById('eleanResourceListInline')) {
				//alert(1);
				changeLinkColor('eleanResourceListInline');
			}
			if(document.getElementById('courseSupplementInline')) {
				changeLinkColor('courseSupplementInline');
			}
	}
	
	function hideAllInline(){
		if(document.getElementById('instructorResourcesSubListInline')) {
			hideLinkList('instructorResourcesSubListInline');
		}
		if(document.getElementById('studentResourceListInline')) {
			hideLinkList('studentResourceListInline');
		}
		if(document.getElementById('eleanResourceListInline')) {
			//alert(1);
			hideLinkList('eleanResourceListInline');
		}
		if(document.getElementById('courseSupplementInline')) {
			hideLinkList('courseSupplementInline');
		}
	}
	
	function hideLinkList(listId){
		var linkList= document.getElementById(listId);	
		var lineItemList= linkList.getElementsByTagName("li");
			for(var i = 0; i < lineItemList.length; i++)
				{
					lineItemList[i].style.display = 'none';
				}
	}
	
	function showLinkList(listId){
		var linkList= document.getElementById(listId);	
		var lineItemList= linkList.getElementsByTagName("li");
			for(var i = 0; i < lineItemList.length; i++)
				{
					lineItemList[i].style.display = 'list-item';
				}
	}

	function showAllInline(listId){
		hideAllInline();
		showLinkList(listId);
	}
	//[3] Add End
