var protocol = window.location.protocol.toLowerCase();
var domain = window.location.host.toLowerCase();
//For page name
var path = window.location.pathname.toLowerCase();
//For Querystring params
var search = window.location.search;
var redirecturl;

//List of all pages that need to be secure
var pages = new Array("/about-orencia.aspx", "/promiseregister.aspx", "/hcp/register.aspx", "/unsubscribe.aspx", "/hcp/unsubscribe.aspx", "/rheumatoid-arthritis-support/unsubscribe.aspx", "/rheumatoid-arthritis-support/abatacept/rheumatoid-arthritis-patient.aspx", "/hcp/orencia-purchase-program.aspx");
//Required to have this functionality work in UAT and PROD
var validdomains = new Array("orencia2.com", "orencia.com", "orencia-tst.bms.com", "marketingtst-vir.net.bms.com");
if (protocol == "http:")
{
    for(i=0; i<validdomains.length; i++)
    {
      if (domain.indexOf(validdomains[i]) != -1)
      {
        for(j=0; j<pages.length; j++)
        {
          if (path == pages[j])
          {
            redirecturl = "https://" + domain + path + search;
            window.location = redirecturl;
            break;
          }
        }
        break;
      }
    }
}