﻿// JScript File
function swapTabs(args)
{		
	alert('swapTabs');

			if(args != 'lawfirms')
			{
			    var lawFirms = document.getElementById('firms_tabs');
			    lawFirms.className = 'solution_hidden';
			    var lawHeader = document.getElementById('ctl01_ctl00_firms_header');
			    var lawDescription = document.getElementById('ctl01_ctl00_firms_text');
			    lawHeader.className = 'solutions_header';
			    lawDescription.className = 'solutions_text_hidden';
			}
			
			if(args != 'corporate')
			{
			    var corporate = document.getElementById('corporate_tabs');
			    corporate.className = 'solution_hidden';
			    var corpHeader = document.getElementById('ctl01_ctl00_corporate_header');
			    var corpDescription = document.getElementById('ctl01_ctl00_corporate_text');
			    corpHeader.className = 'solutions_header';
			    corpDescription.className = 'solutions_text_hidden';
			}
			
			if(args != 'government')
			{
			    var government = document.getElementById('government_tabs');
			    government.className = 'solution_hidden';
			    var govHeader = document.getElementById('ctl01_ctl00_government_header');
			    var govDescription = document.getElementById('ctl01_ctl00_government_text');
			    govHeader.className = 'solutions_header';
			    govDescription.className = 'solutions_text_hidden';
			}
			
			if(args != 'legal')
			{
			    var legal = document.getElementById('legal_tabs');
			    legal.className = 'solution_hidden';
			    var legHeader = document.getElementById('ctl01_ctl00_legal_header');
			    var legDescription = document.getElementById('ctl01_ctl00_legal_text');
			    legHeader.className = 'solutions_header';
			    legDescription.className = 'solutions_text_hidden';
			}
			
			if(args != 'education')
			{
			    var education = document.getElementById('education_tabs');
			    education.className = 'solution_hidden';
			    var eduHeader = document.getElementById('ctl01_ctl00_education_header');			   
			    var eduDescription = document.getElementById('ctl01_ctl00_education_text');
			    eduHeader.className = 'solutions_header';
			    eduDescription.className = 'solutions_text_hidden';
			    
			}
			
			 var active = document.getElementById(args + '_tabs');
			    active.className = 'content_tabs';
			    			    
			 var activeHeader = document.getElementById('ctl01_ctl00_' + args + '_header');
			    activeHeader.className = 'solutions_header';
			 var activeDescription = document.getElementById('ctl01_ctl00_' + args + '_text');
			    activeDescription.className = 'solutions_text';
		}

function swapTabsGeneric(tab, position, navItems)
{
	alert('swapTabsGeneric');
     var count = 0;
     
	$$("div#solution_tab_container div").each(function (obj)
	{  
		if (obj.id == (tab + '_tab'))
		{
			obj.addClassName('selected');
			if (($('content_header') != null) && ($(tab + '_header') != null))
			{
				$('content_header').innerHTML = $(tab + '_header').innerHTML;			
			}

			if (($('content_text') != null) && ($(tab + '_text') != null))
			{
				$('content_text').innerHTML = $(tab + '_text').innerHTML;
			}
					
			if (($('tab_read_more') != null) && ($(tab + '_more') != null))
			{
				$('tab_read_more').innerHTML = $(tab + '_more').innerHTML;
			}

			if (($('solutionsBG') != null) && ($(tab + '_image') != null))
			{
				$('solutionsBG').style.backgroundImage = $(tab + '_image').innerHTML;
			}

			$(tab + '_tabL').className = "tab_onL" + position;
			$(tab + '_tabm').className = "tab_onm";
			
			 
			 if(position == "_last")
			 {
			     $(tab + '_tabR').className = "tab_onR_last";
			 }
			 else
			 {
			     $(tab + '_tabR').className = "tab_onR";
			     
			 }
            
				count++;
		}
		else
		{
			obj.removeClassName('selected');			
            
            $$("div#" + obj.id  + " div").each(function (obj)
			{     	
			        if(obj.id.indexOf("_tabL") != -1 )
			        {
			            if(count == "0")
			            {
    			            $(obj.id).className = "tab_offL_first";    			        
			            }	
			            else
			            {
			                 $(obj.id).className = "tab_offL";  
			            }	
			        }
			        
			        if(obj.id.indexOf("_tabm") != -1 )
			        {
			              $(obj.id).className = "tab_offM";  
			              	count++;
			        }
			            
			        if(obj.id.indexOf("_tabR") != -1 )
			        {
			            if(count == navItems)
			            {
			                $(obj.id).className = "tab_offR_last";
			            }
			            else
			            {
			                $(obj.id).className = "tab_offR";
			            }
			        }
			});	
		}
	});
}

function swapTabsSolution(tab, position, navItems)
{
	alert('swapTabsSolution');
    var count = 0;
     
    $$("div#tab_description_product_section div").each(function (obj)
	{  
	    if (obj.id == (tab + '_container'))
		{
		     $(tab + '_container').className = "solutions_product_container";
		}
		else
		{
		     if(obj.id.indexOf("_container") != -1)
			 {			        
			    $(obj.id).className = "solutions_product_container_hidden";
			 }
		}
	});
     
	$$("div#solution_tab_container div").each(function (obj)
	{  
		if (obj.id == (tab + '_tab'))
		{
             $(tab + '_tabL').className = "tab_onL" + position;
			 $(tab + '_tabm').className = "tab_onm";
			 
			$('content_header').innerHTML = $(tab + '_header').innerHTML;			
			$('content_text').innerHTML = $(tab + '_text').innerHTML;
			 
			 if(position == "_last")
			 {
			     $(tab + '_tabR').className = "tab_onR_last";
			 }
			 else
			 {
			     $(tab + '_tabR').className = "tab_onR";
			 }
            
			count++;
		}
		else
		{
			obj.removeClassName('selected');
             	
            $$("div#" + obj.id  + " div").each(function (obj)
			{     	
			        if(obj.id.indexOf("_tabL") != -1 )
			        {
			            if(count == "0")
			            {
    			            $(obj.id).className = "tab_offL_first";    			        
			            }	
			            else
			            {
			                 $(obj.id).className = "tab_offL";  
			            }	
			        }
			        
			        if(obj.id.indexOf("_tabm") != -1 )
			        {
			              $(obj.id).className = "tab_offM";  
			              	count++;
			        }
			            
			        if(obj.id.indexOf("_tabR") != -1 )
			        {
			            if(count == navItems)
			            {
			                $(obj.id).className = "tab_offR_last";
			            }
			            else
			            {
			                $(obj.id).className = "tab_offR";
			            }
			        }
			});	
		}
	});
}
