
function servicecompany()
{
    var company = document.CompanyNames.OldNames.selectedIndex;
    if (company == '0')
    {
        MMDiv1.style.visibility='hidden';
        MMDiv2.style.visibility='hidden';
        MMDiv3.style.visibility='hidden';
    }
    else
    {
        var contactText="";
        if (document.CompanyNames.OldNames.options[company].text == document.CompanyNames.CurrentNames.options[company].text)
        {
            contactText="The contact details are...";
        }
        else
        {
            contactText="Your policy is now with " + document.CompanyNames.CurrentNames.options[company].text;
        }
        document.getElementById('contact').innerHTML=contactText;


        var strCont = document.CompanyNames.ContactPages.options[company].text;

        if(strCont.length == 0)
        {
            var strTelNo = document.CompanyNames.TelNos.options[company].text;
            while (strTelNo.indexOf("$") != -1)
            {
                strTelNo = strTelNo.replace("$","<br/>");
            }
            document.getElementById('telno').innerHTML=strTelNo;


            var strAdd = document.CompanyNames.Addresses.options[company].text;
            while (strAdd.indexOf("$") != -1)
            {
                strAdd = strAdd.replace("$","<br/>");
            }
            document.getElementById('address').innerHTML=strAdd;

            MMDiv1.style.visibility='visible';
            MMDiv2.style.visibility='visible';
            MMDiv3.style.visibility='hidden';
        }
        else
        {

            var subSection = strCont.substring(4,0);

            if(subSection == "http")
            {
                strCont = "<a href=\""+strCont+"\" alt=\"link to contact page\" onclick=\"leavingSiteAlert()\" target=\"_blank\" >To be able to provide you with the correct contact information please follow this link.</a>";
            }
            else
            {
                strCont = "<a href=\"/phoenixlife/Contact%20us/"+strCont+"\" alt=\"link to contact page\">To be able to provide you with the correct contact information please follow this link.</a>";
            }

            document.getElementById('redirectpage').innerHTML=strCont;
            MMDiv1.style.visibility='visible';
            MMDiv2.style.visibility='hidden';
            MMDiv3.style.visibility='visible';
        }
    }
}



