//
// Evaluate the state configuration for the given agent and show/hide state variations
//
stateAZ = document.aspnetForm.ctl00$ctl00$cphContent$stateAZ.value;
stateFL = document.aspnetForm.ctl00$ctl00$cphContent$stateFL.value;
stateCA = document.aspnetForm.ctl00$ctl00$cphContent$stateCA.value;
stateHI = document.aspnetForm.ctl00$ctl00$cphContent$stateHI.value;
stateNV = document.aspnetForm.ctl00$ctl00$cphContent$stateNV.value;
stateSC = document.aspnetForm.ctl00$ctl00$cphContent$stateSC.value;
stateTX = document.aspnetForm.ctl00$ctl00$cphContent$stateTX.value;
Ivantage = document.aspnetForm.ctl00$ctl00$cphContent$Ivantage.value;
ICAT = document.aspnetForm.ctl00$ctl00$cphContent$ICAT.value;
IsoHomeValue = document.aspnetForm.ctl00$ctl00$cphContent$IsoHomeValue.value;

stateGA = document.aspnetForm.ctl00$ctl00$cphContent$stateGA.value;

nonComUW = document.aspnetForm.ctl00$ctl00$cphContent$nonComUW.value; 
comUW = document.aspnetForm.ctl00$ctl00$cphContent$comUW.value; 
comReview = document.aspnetForm.ctl00$ctl00$cphContent$comReview.value; 

stonington = document.aspnetForm.ctl00$ctl00$cphContent$stonington.value;
CommercialBOP = document.aspnetForm.ctl00$ctl00$cphContent$CommercialBOP.value;
CommercialCRP = document.aspnetForm.ctl00$ctl00$cphContent$CommercialCRP.value;

if (stateAZ == "Y")
{
    showLayer('ArizonaBulletins');
    getElementByClass('UWManuals-Arizona');
    getElementByClass('UWForms-Arizona');
    getElementByClass('QuickRef-Arizona');
    showLayer('agent_Home_AZ_NV_SC');
    showLayer('varAZ');  //AgencyPrograms page
}

if (stateFL == "Y")
{
    showLayer('FloridaBulletins');
    getElementByClass('UWManuals-Florida');    
    getElementByClass('UWForms-Florida');
    getElementByClass('QuickRef-Florida');
    showLayer('varFL');
    showLayer('varFL2'); //AgentHome
}

if (stateGA == "Y")
{
    showLayer('GeorgiaBulletins');
    getElementByClass('UWManuals-GA');    
    getElementByClass('UWForms-GA');
    getElementByClass('QuickRef-GA');
    //showLayer('varGA');
}


if (stateCA == "Y" && Ivantage != "Y")
{
    showLayer('CaliforniaBulletins');
    getElementByClass('UWManuals-California');
    getElementByClass('UWForms-California');
    getElementByClass('QuickRef-California');
    showLayer('varCA');
    showLayer('varCA2'); //AgentHome
}

if (Ivantage == "Y" && stateCA == "Y")
{
    hideLayer('Cabo');
    showLayer('CaliforniaBulletins');
    getElementByClass('UWManuals-Ivantage');    
    getElementByClass('UWForms-Ivantage');
    getElementByClass('QuickRef-Ivantage');
    //showLayer('varCA_Ivantage');
}


if (stateHI == "Y" && ICAT != "Y")
{
    showLayer('HawaiiBulletins');
    getElementByClass('UWManuals-Hawaii');
    getElementByClass('UWForms-Hawaii');
    getElementByClass('QuickRef-Hawaii');
    showLayer('varHI');
    showLayer('varHI2'); //AgentHome
}

if (ICAT == "Y" && stateHI == "Y")
{
    showLayer('HawaiiBulletins');
    getElementByClass('UWManuals-ICAT');    
    getElementByClass('UWForms-ICAT');
    getElementByClass('QuickRef-ICAT');
    showLayer('varHI_ICAT');
}

if (stateNV == "Y")
{
    showLayer('NevadaBulletins');
    getElementByClass('UWManuals-Nevada');
    getElementByClass('UWForms-Nevada');
    getElementByClass('QuickRef-Nevada');
    showLayer('agent_Home_AZ_NV_SC');
    showLayer('varNV');
}

if (stateSC == "Y")
{
    showLayer('SouthCarolinaBulletins');
    getElementByClass('UWManuals-SouthCarolina');
    showLayer('SouthCarolinaHomeownersForms');
    showLayer('SouthCarolinaAutoForms');
    getElementByClass('QuickRef-SouthCarolina');
    showLayer('BeaufortCountyWindMap');
    showLayer('CharlestonCountyWindMap');
    showLayer('GeorgetownCountyWindMap');
    showLayer('HorryCountyWindMap');
    showLayer('ONDEMANDAutoTrainingforSouthCarolinaAgents');
    showLayer('agent_Home_AZ_NV_SC');
    showLayer('varSC');
}

if (stonington == "Y")
{
    showLayer('StoningtonBulletins');
    getElementByClass('UWManuals-Stonington'); 
    getElementByClass('UWForms-Stonington'); 
    getElementByClass('QuickRef-Stonington'); 
}

if (stateTX == "Y")
{
    showLayer('TexasBulletins');
    getElementByClass('UWManuals-Texas');
    getElementByClass('UWForms-Texas');    
    getElementByClass('QuickRef-Texas');   
    showLayer('varTX');
    showLayer('varTX2'); //AgentHome
    showLayer('varMSB');
}

if (IsoHomeValue == "Y")
{
    showLayer('varIsoHomeValue');
}

if(CommercialBOP == "Y")
{
    //showLayer('FloridaCommercialBusinessownersProgramManual');    
    //showLayer('FloridaCommercialBusinessownersProgramForms');    
    //showLayer('FloridaCommercialBusinessownersProgramQuickReferenceGuide');
    
    getElementByClass('UWManuals-BOP');
    getElementByClass('UWForms-BOP');
    getElementByClass('QuickRef-BOP');    
    
    showLayer('QuickStartGuideWritingCommercialBusinessWithUniversalNorthAmerica');
}

if(CommercialCRP == "Y")
{
    //showLayer('FloridaCommercialResidentialPackageProgramManual');
    //showLayer('FloridaCommercialResidentialPackageProgramManual_20100101');
    //showLayer('FloridaCommercialResidentialPackageProgramForms');
    //showLayer('FloridaCommercialResidentialPackageProgramQuickReferenceGuide');
    
    getElementByClass('UWManuals-CRP');
    getElementByClass('UWForms-CRP');
    getElementByClass('QuickRef-CRP');    
       
    showLayer('QuickStartGuideWritingCommercialBusinessWithUniversalNorthAmerica');
}



if (comReview == "Y" || comUW == "Y")
{
    showLayer('FloridaCommercialResidentialPackageProgramManual');
    showLayer('FloridaCommercialResidentialPackageProgramManual_20100101'); 
    showLayer('FloridaCommercialResidentialPackageProgramForms');
    showLayer('FloridaCommercialResidentialPackageProgramQuickReferenceGuide');    
    showLayer('FloridaCommercialBusinessownersProgramManual');    
    showLayer('FloridaCommercialBusinessownersProgramForms');    
    showLayer('FloridaCommercialBusinessownersProgramQuickReferenceGuide');
}

if (nonComUW == "Y" || comReview == "Y" || comUW == "Y")
{
    showLayer('TexasBulletins');
    showLayer('ArizonaBulletins');
    showLayer('BeaufortCountyWindMap');
    showLayer('CaliforniaBulletins');
    showLayer('CharlestonCountyWindMap');
    showLayer('FloridaBulletins');
    showLayer('GeorgetownCountyWindMap');
    showLayer('HawaiiBulletins');
    showLayer('HorryCountyWindMap');
    showLayer('ONDEMANDAutoTrainingforSouthCarolinaAgents');
    showLayer('SouthCarolinaAutoForms');
    showLayer('SouthCarolinaBulletins');
    showLayer('SouthCarolinaHomeownersForms');
    showLayer('StoningtonBulletins');
    
    getElementByClass('QuickRef-Nevada');
    getElementByClass('UWForms-Nevada');    
    getElementByClass('UWForms-Arizona');
    getElementByClass('UWManuals-Arizona');    
    getElementByClass('QuickRef-Arizona');    
    getElementByClass('UWForms-California');
    getElementByClass('UWManuals-California');
    getElementByClass('QuickRef-California');    
    getElementByClass('QuickRef-Florida');
    getElementByClass('UWForms-Florida');
    getElementByClass('UWManuals-Florida');
    getElementByClass('UWForms-Hawaii');
    getElementByClass('UWManuals-Hawaii');
    getElementByClass('QuickRef-Hawaii');    
    getElementByClass('UWManuals-Nevada');
    getElementByClass('UWManuals-SouthCarolina');
    getElementByClass('QuickRef-SouthCarolina');    
    getElementByClass('UWForms-Stonington'); 
    getElementByClass('UWManuals-SouthCarolina');
    getElementByClass('UWManuals-Stonington');
    getElementByClass('QuickRef-Stonington');
    getElementByClass('UWForms-Texas');      
    getElementByClass('UWManuals-Texas');
}

function showLayer(Layer) {
	if (document.getElementById(Layer) != null)
		document.getElementById(Layer).style.display = "block";
}

function hideLayer(Layer) {	
	if (document.getElementById(Layer) != null)
		document.getElementById(Layer).style.display = "none";
}


function getElementByClass(theClass) {
    var allHTMLTags=document.getElementsByTagName("*");

    for (i=0; i < allHTMLTags.length; i++) {
        if (allHTMLTags[i].className == theClass) {
            allHTMLTags[i].style.display = "block";
        }
    }
}




