﻿var Id;
var divs = new Array();
var tabs = new Array();
var selectApp;
var selectInd;

function showDivs(Id, loopSize)
{
    if(Id != null && loopSize != null)
    {
        for(var i = 1; i <= loopSize; i++)
        {
            divs[i] = document.getElementById("Panel" + i);
            tabs[i] = document.getElementById("tabs" + i);
            
            if(divs[i] != null && tabs[i] != null)
            {
                divs[i].style.display = "none";
                tabs[i].className = "prodTabs";
                
                if(i == Id)
                {
                    divs[i].style.display = "block";
                    tabs[i].className = "active";
                }
            }
            else
            {
                break;
            }
        }
    }
    
    GetContainerHeight();
}

//Home Page Tabs
function showDivsHome(Id)
{
    if(Id != null)
    {
		divs[1] = document.getElementById("graphicsBody1");
		tabs[1] = document.getElementById("graphicsTabs1");
		divs[2] = document.getElementById("graphicsBody2");
		tabs[2] = document.getElementById("graphicsTabs2");
		selectApp = document.getElementById("ctl00_ContentPlaceHolder1_selectApp");
		selectInd = document.getElementById("ctl00_ContentPlaceHolder1_selectInd");
		
		if(divs[1] != null && tabs[1] != null && divs[2] != null && tabs[2] != null)
		{			
			if(Id == 1)
			{
				divs[1].style.display = "block";
				tabs[1].className = "graphicsAppShow";
				divs[2].style.display = "none";
				tabs[2].className = "graphicsIndHide";
				selectApp.value = "default";
			}
			else
			{
				divs[2].style.display = "block";
				tabs[2].className = "graphicsIndShow";
				divs[1].style.display = "none";
				tabs[1].className = "graphicsAppHide";
				selectInd.value = "default";
			}
		}
    }
    
    GetContainerHeight();
}

function toggleDivs(Id, loopSize)
{
    if(Id != null && loopSize != null)
    {
        for(var i = 1; i <= loopSize; i++)
        {
            divs[i] = document.getElementById("Panel" + i);
            tabs[i] = document.getElementById("tabs" + i);
            
            if(divs[i] != null && tabs[i] != null)
            {
                divs[i].className = "industryDiv";
                tabs[i].className = "prodTabs";
                
                if(i == Id)
                {
                    divs[i].className = "industryDivShow";
                    tabs[i].className = "active";
                }
            }
            else
            {
                break;
            }
        }
    }
    
    GetContainerHeight();
}