/* DataStax version dropdown module */

var data = {
    "dse-admin" : {
        "label01" : ["DataStax Administrator"],
        "dseadmin68" : ["DSE Admin 6.8", "/en/dse/6.8/dse-admin/"],
        "dseadmin67" : ["DSE Admin 6.7", "/en/dse/6.7/dse-admin/"],
        "dseadmin60" : ["DSE Admin 6.0", "/en/dse/6.0/dse-admin/"],
        "dseadmin51" : ["DSE Admin 5.1", "/en/dse/5.1/dse-admin/"],
        "label02" : ["DataStax Developer"],
        "dsedev68" : ["DSE Dev 6.8", "/en/dse/6.8/dse-dev/"],
        "dsedev67" : ["DSE Dev 6.7", "/en/dse/6.7/dse-dev/"],
        "dsedev60" : ["DSE Dev 6.0", "/en/dse/6.0/dse-dev/"],
        "dsedev51" : ["DSE Dev 5.1", "/en/dse/5.1/dse-dev/"],
        "label03" : ["DataStax Architecture"],
        "dsearch68" : ["DSE Arch 6.8", "/en/dse/6.8/dse-arch/"],
        "dsearch67" : ["DSE Arch 6.7", "/en/dse/6.7/dse-arch/"],
        "dsearch60" : ["DSE Arch 6.0", "/en/dse/6.0/dse-arch/"],
        "dsearch51" : ["DSE Arch 5.1", "/en/dse/5.1/dse-arch/"],
        "label04" : ["DataStax Security"],
        "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
        "security67" : ["DataStax Security 6.7", "/en/security/6.7/"],
        "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
        "security51" : ["DataStax Security 5.1", "/en/security/5.1/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "dse-arch" : {
        "label01" : ["DataStax Architecture"],
        "dsearch68" : ["DSE Arch 6.8", "/en/dse/6.8/dse-arch/"],
        "dsearch67" : ["DSE Arch 6.7", "/en/dse/6.7/dse-arch/"],
        "dsearch60" : ["DSE Arch 6.0", "/en/dse/6.0/dse-arch/"],
        "dsearch51" : ["DSE Arch 5.1", "/en/dse/5.1/dse-arch/"],
        "label02" : ["DataStax Administrator"],
        "dseadmin68" : ["DSE Admin 6.8", "/en/dse/6.8/dse-admin/"],
        "dseadmin67" : ["DSE Admin 6.7", "/en/dse/6.7/dse-admin/"],
        "dseadmin60" : ["DSE Admin 6.0", "/en/dse/6.0/dse-admin/"],
        "dseadmin51" : ["DSE Admin 5.1", "/en/dse/5.1/dse-admin/"],
        "label03" : ["DataStax Developer"],
        "dsedev68" : ["DSE Dev 6.8", "/en/dse/6.8/dse-dev/"],
        "dsedev67" : ["DSE Dev 6.7", "/en/dse/6.7/dse-dev/"],
        "dsedev60" : ["DSE Dev 6.0", "/en/dse/6.0/dse-dev/"],
        "dsedev51" : ["DSE Dev 5.1", "/en/dse/5.1/dse-dev/"],
        "label04" : ["DataStax Security"],
        "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
        "security67" : ["DataStax Security 6.7", "/en/security/6.7/"],
        "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
        "security51" : ["DataStax Security 5.1", "/en/security/5.1/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "dse-dev" : {
        "label01" : ["DataStax Developer"],
        "dsedev68" : ["DSE Dev 6.8", "/en/dse/6.8/dse-dev/"],
        "dsedev67" : ["DSE Dev 6.7", "/en/dse/6.7/dse-dev/"],
        "dsedev60" : ["DSE Dev 6.0", "/en/dse/6.0/dse-dev/"],
        "dsedev51" : ["DSE Dev 5.1", "/en/dse/5.1/dse-dev/"],
        "label02" : ["DataStax Administrator"],
        "dseadmin68" : ["DSE Admin 6.8", "/en/dse/6.8/dse-admin/"],
        "dseadmin67" : ["DSE Admin 6.7", "/en/dse/6.7/dse-admin/"],
        "dseadmin60" : ["DSE Admin 6.0", "/en/dse/6.0/dse-admin/"],
        "dseadmin51" : ["DSE Admin 5.1", "/en/dse/5.1/dse-admin/"],
        "label03" : ["DataStax Architecture"],
        "dsearch68" : ["DSE Arch 6.8", "/en/dse/6.8/dse-arch/"],
        "dsearch67" : ["DSE Arch 6.7", "/en/dse/6.7/dse-arch/"],
        "dsearch60" : ["DSE Arch 6.0", "/en/dse/6.0/dse-arch/"],
        "dsearch51" : ["DSE Arch 5.1", "/en/dse/5.1/dse-arch/"],
        "label04" : ["DataStax Security"],
        "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
        "security67" : ["DataStax Security 6.7", "/en/security/6.7/"],
        "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
        "security51" : ["DataStax Security 5.1", "/en/security/5.1/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "security" : {
        "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
        "security67" : ["DataStax Security 6.7", "/en/security/6.7/"],
        "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
        "security51" : ["DataStax Security 5.1", "/en/security/5.1/"],
        "ddacsecurity51" : ["DDAC Security", "/en/ddacsecurity/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "dse-planning" : {
        "planning" : ["DSE Planning", "/en/dse-planning/doc/"],
        "ossplanning" : ["Cassandra Planning", "/en/oss-planning/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "oss-planning" : {
        "ossplanning" : ["Cassandra Planning", "/en/oss-planning/doc/"],
        "planning" : ["DSE Planning", "/en/dse-planning/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "dse-trblshoot" : {
        "troubleshooting" : ["DSE Troubleshooting", "/en/dse-trblshoot/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "opscenter" : {
        "opsc68" : ["OpsCenter 6.8", "/en/opscenter/6.8/"],
        "opsc67" : ["OpsCenter 6.7", "/en/opscenter/6.7/"],
        "opsc65" : ["OpsCenter 6.5", "/en/opscenter/6.5/"],
        "opsc61" : ["OpsCenter 6.1", "/en/opscenter/6.1/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "cassandra-oss" : {
        "osscassandra30" : ["Apache Cassandra 3.0", "/en/cassandra-oss/3.0/"],
        "osscassandra3x" : ["Apache Cassandra 3.x", "/en/cassandra-oss/3.x/"],
        "osscassandra22" : ["Apache Cassandra 2.2", "/en/cassandra-oss/2.2/"],
        "osscassandra21" : ["Apache Cassandra 2.1", "/en/cassandra-oss/2.1/"],
        "osscassandralp" : ["Apache Cassandra landing page", "/en/cassandra-oss/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "cql" : {
        "cql68" : ["CQL for DSE 6.8", "/en/dse/6.8/cql/"],
        "cql67" : ["CQL for DSE 6.7", "/en/dse/6.7/cql/"],
        "cql60" : ["CQL for DSE 6.0", "/en/dse/6.0/cql/"],
        "cql51" : ["CQL for DSE 5.1", "/en/dse/5.1/cql/"],
        "ddaccql51" : ["CQL for DDAC", "/en/ddaccql/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "cql-oss" : {
        "osscql33" : ["CQL 3.3", "/en/cql-oss/3.3/"],
        "osscql3x" : ["CQL 3.x", "/en/cql-oss/3.x/"],
        "osscql31" : ["CQL 3.1", "/en/cql-oss/3.1/"],
        "osscassandralp" : ["Apache Cassandra landing page", "/en/cassandra-oss/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "install" : {
        "label01" : ["DataStax DSE, OpsCenter, & tools"],
        "install68" : ["DataStax install docs 6.8", "/en/install/6.8/"],
        "install67" : ["DataStax install docs 6.7", "/en/install/6.7/"],
        "install60" : ["DataStax install docs 6.0", "/en/install/6.0/"],
        "dseadmin51" : ["DataStax install docs 5.1", "/en/dse/5.1/dse-admin/datastax_enterprise/install/installTOC.html"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "datastax_enterprise-archived" : {
        "cassandra30" : ["Cassandra 3.0 unsupported", "/en/cassandra/3.0/"],
        "cql33" : ["CQL 3.3 unsupported", "/en/cql/3.3"],
        "dse50" : ["DSE 5.0 EOSL", "/en/datastax_enterprise/5.0/"],
        "allesol" : ["All EOSL/Unsupported", "/en/landing_page/doc/landing_page/docList.html#docList__dseEOSL"]
    },
    "cassandra-archived" : {
        "cassandra30" : ["Cassandra 3.0 unsupported", "/en/cassandra/3.0/"],
        "cql33" : ["CQL 3.3 unsupported", "/en/archived/cql/3.3"],
        "dse50" : ["DSE 5.0 EOSL", "/en/archived/datastax_enterprise/5.0/"],
        "allesol" : ["All EOSL/Unsupported", "/en/landing_page/doc/landing_page/docList.html#docList__dseEOSL"]
    },
    "cql-archived" : {
        "cassandra30" : ["Cassandra 3.0 unsupported", "/en/cassandra/3.0/"],
        "cql33" : ["CQL 3.3 unsupported", "/en/cql/3.3"],
        "dse50" : ["DSE 5.0 EOSL", "/en/datastax_enterprise/5.0/"],
        "allesol" : ["All EOSL/Unsupported", "/en/landing_page/doc/landing_page/docList.html#docList__dseEOSL"]
    },
    "monitoring" : {
        "monitoring" : ["Monitoring DataStax Enterprise", "/en/monitoring/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "devapp" : {
        "devapp" : ["Developing driver applications", "/en/devapp/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "jdk-install" : {
        "jdkinstall" : ["Installing the JDK", "/en/jdk-install/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "dsbulk" : {
        "dsbulk" : ["DataStax Bulk Loader", "/en/dsbulk/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "studio" : {
        "studio68" : ["DataStax Studio 6.8", "/en/studio/6.8/"],
        "studio67" : ["DataStax Studio 6.7", "/en/studio/6.7/"],
        "studio60" : ["DataStax Studio 6.0", "/en/studio/6.0/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "devcenter" : {
        "devcenter" : ["DevCenter", "datastax_enterprise/devcenter/dcToc.html"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "upgrade" : {
        "upgrade" : ["Upgrade", "/en/upgrade/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "storage-attached-index" : {
        "sai68" : ["DataStax Storage Attached Index", "/en/storage-attached-index/6.8/sai/saiTOC.html"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "cass-operator" : {
        "cassoperator" : ["DataStax Kubernetes Operator", "/en/cass-operator/6.8/cass-operator/cassOperatorTOC.html"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "ddac" : {
        "ddac51" : ["DDAC Guide", "/en/ddac/doc/"],
        "ddaccql51" : ["CQL for DDAC", "/en/ddaccql/doc/"],
        "devapp" : ["Developing driver applications", "/en/devapp/doc/"],
        "ddacsecurity51" : ["DDAC Security", "/en/ddacsecurity/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "ddaccql" : {
        "ddaccql51" : ["CQL for DDAC", "/en/ddaccql/doc/"],
        "ddac51" : ["DDAC Guide", "/en/ddac/doc/"],
        "ddacsecurity51" : ["DDAC Security", "/en/ddacsecurity/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "ddacsecurity" : {
        "ddacsecurity51" : ["DDAC Security", "/en/ddacsecurity/doc/"],
        "ddac51" : ["DDAC Guide", "/en/ddac/doc/"],
        "ddaccql51" : ["CQL for DDAC", "/en/ddaccql/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "driver-matrix" : {
        "drivermatrix" : ["Driver compatability", "/en/developer/driver-matrix/doc/"],
        "devapp" : ["Developing driver applications", "/en/devapp/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "glossary" : {
        "glossary" : ["Glossary", "/en/glossary/doc/glossary/glossaryTOC.html"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "kafka" : {
        "kafka" : ["DataStax Kafka Connector", "/en/kafka/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "docker" : {
        "docker" : ["Docker", "/en/docker/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "aws" : {
        "astraaws" : ["Astra AWS", "/en/astra/aws/doc/"],
        "astragcp" : ["Astra GCP", "/en/astra/gcp/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "gcp" : {
        "astragcp" : ["Astra GCP", "/en/astra/gcp/doc/"],
        "astraaws" : ["Astra AWS", "/en/astra/aws/doc/"],
        "all" : ["All docs", "/en/landing_page/doc/landing_page/docList.html"]
    },
    "dse-admin-jajp" : {
        "label01" : ["DSE管理者ガイド"],
        "dseadmin68" : ["DSE Admin 6.8", "/en/dse/6.8/dse-admin/"],
        "jajpdseadmin67" : ["DSE管理者ガイド6.7", "/ja/dse/6.7/dse-admin/"],
        "dseadmin60" : ["DSE Admin 6.0", "/en/dse/6.0/dse-admin/"],
        "jajpdseadmin51" : ["DSE管理者ガイド5.1", "/ja/dse/5.1/dse-admin/"],
        "label02" : ["DSE開発者ガイド"],
        "dsedev68" : ["DSE Dev 6.8", "/en/dse/6.8/dse-dev/"],
        "jajpdsedev67" : ["DSE開発者ガイド6.7", "/ja/dse/6.7/dse-dev/"],
        "dsedev60" : ["DSE Dev 6.0", "/en/dse/6.0/dse-dev/"],
        "jajpdsedev51" : ["DSE開発者ガイド5.1", "/ja/dse/5.1/dse-dev/"],
        "label03" : ["DSEアーキテクチャー・ガイド"],
        "dsearch68" : ["DSE Architecture 6.8", "/en/dse/6.8/dse-arch/"],
        "jajpdsearch67" : ["DSEアーキテクチャ・ガイド6.7", "/ja/dse/6.7/dse-arch/"],
        "dsearch60" : ["DSE Architecture 6.0", "/en/dse/6.0/dse-arch/"],
        "jajpdsearch51" : ["DSEアーキテクチャ・ガイド5.1", "/ja/dse/5.1/dse-arch/"],
        "label04" : ["DSEセキュリテド"],
        "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
        "jajpsecurity67" : ["DataStax 6.7セキュリティ・ガイド", "/ja/security/6.7/index.html"],
        "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
        "jajpdseadmin51" : ["DataStax 5.1セキュリティ・ガイド", "/ja/dse/5.1/dse-admin/datastax_enterprise/security/securityTOC.html"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "dse-arch-jajp" : {
        "label01" : ["DSEアーキテクチャー・ガイド"],
        "dsearch68" : ["DSE Architecture 6.8", "/en/dse/6.8/dse-arch/"],
        "jajpdsearch67" : ["DSEアーキテクチャ・ガイド6.7", "/ja/dse/6.7/dse-arch/"],
        "dsearch60" : ["DSE Architecture 6.0", "/en/dse/6.0/dse-arch/"],
        "jajpdsearch51" : ["DSEアーキテクチャ・ガイド5.1", "/ja/dse/5.1/dse-arch/"],
        "label02" : ["DSE管理者ガイド"],
        "dseadmin68" : ["DSE Admin 6.8", "/en/dse/6.8/dse-admin/"],
        "jajpdseadmin67" : ["DSE管理者ガイド6.7", "/ja/dse/6.7/dse-admin/"],
        "dseadmin60" : ["DSE Admin 6.0", "/en/dse/6.0/dse-admin/"],
        "jajpdseadmin51" : ["DSE管理者ガイド5.1", "/ja/dse/5.1/dse-admin/"],
        "label03" : ["DSE開発者ガイド"],
        "dsedev68" : ["DSE Dev 6.8", "/en/dse/6.8/dse-dev/"],
        "jajpdsedev67" : ["DSE開発者ガイド6.7", "/ja/dse/6.7/dse-dev/"],
        "dsedev60" : ["DSE Dev 6.0", "/en/dse/6.0/dse-dev/"],
        "jajpdsedev51" : ["DSE開発者ガイド5.1", "/ja/dse/5.1/dse-dev/"],
        "label04" : ["DSEセキュリテド"],
        "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
        "jajpsecurity67" : ["DataStax 6.7セキュリティ・ガイド", "/ja/security/6.7/index.html"],
        "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
        "jajpdseadmin51" : ["DataStax 5.1セキュリティ・ガイド", "/ja/dse/5.1/dse-admin/datastax_enterprise/security/securityTOC.html"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "dse-dev-jajp" : {
        "label01" : ["DSE開発者ガイド"],
        "dsedev68" : ["DSE Dev 6.8", "/en/dse/6.8/dse-dev/"],
        "jajpdsedev67" : ["DSE開発者ガイド6.7", "/ja/dse/6.7/dse-dev/"],
        "dsedev60" : ["DSE Dev 6.0", "/en/dse/6.0/dse-dev/"],
        "jajpdsedev51" : ["DSE開発者ガイド5.1", "/ja/dse/5.1/dse-dev/"],
        "label02" : ["DSE管理者ガイド"],
        "dseadmin68" : ["DSE Admin 6.8", "/en/dse/6.8/dse-admin/"],
        "jajpdseadmin67" : ["DSE管理者ガイド6.7", "/ja/dse/6.7/dse-admin/"],
        "dseadmin60" : ["DSE Admin 6.0", "/en/dse/6.0/dse-admin/"],
        "jajpdseadmin51" : ["DSE管理者ガイド5.1", "/ja/dse/5.1/dse-admin/"],
        "label03" : ["DSEアーキテクチャー・ガイド"],
        "dsearch68" : ["DSE Architecture 6.8", "/en/dse/6.8/dse-arch/"],
        "jajpdsearch67" : ["DSEアーキテクチャ・ガイド6.7", "/ja/dse/6.7/dse-arch/"],
        "dsearch60" : ["DSE Architecture 6.0", "/en/dse/6.0/dse-arch/"],
        "jajpdsearch51" : ["DSEアーキテクチャ・ガイド5.1", "/ja/dse/5.1/dse-arch/"],
        "label04" : ["DSEセキュリテド"],
        "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
        "jajpsecurity67" : ["DataStax 6.7セキュリティ・ガイド", "/ja/security/6.7/index.html"],
        "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
        "jajpdseadmin51" : ["DataStax 5.1セキュリティ・ガイド", "/ja/dse/5.1/dse-admin/datastax_enterprise/security/securityTOC.html"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
   "security-jajp" : {
       "security68" : ["DataStax Security 6.8", "/en/security/6.8/"],
       "jajpsecurity67" : ["DataStax 6.7セキュリティ・ガイド", "/ja/security/6.7/index.html"],
       "security60" : ["DataStax Security 6.0", "/en/security/6.0/"],
       "jajpdseadmin51" : ["DataStax 5.1セキュリティ・ガイド", "/ja/dse/5.1/dse-admin/datastax_enterprise/security/securityTOC.html"],
       "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "cql-jajp" : {
        "cql68" : ["CQL 6.8 (DSE 6.8で使用)", "/en/dse/6.8/cql/"],
        "jajpcql67" : ["CQL 6.7 (DSE 6.7で使用)", "/ja/dse/6.7/cql/"],
        "cql60" : ["CQL 6.0 (DSE 6.0で使用)", "/en/dse/6.0/cql/"],
        "jajpcql51" : ["CQL 5.1 (DSE 5.1で使用)", "/ja/cql/5.1/"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "opscenter-jajp" : {
        "opsc68" : ["OpsCenter 6.8", "/en/opscenter/6.8/"],
        "jajpopsc67" : ["OpsCenter 6.7ユーザー・ガイド", "/ja/opscenter/6.7/"],
        "opsc65" : ["OpsCenter 6.5", "/en/opscenter/6.5/"],
        "jajpopsc61" : ["OpsCenter 6.1ユーザー・ガイド", "/ja/opscenter/6.1/"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "dsbulk-jajp" : {
        "jajpdsbulk" : ["DataStaxバルク・ローダ", "/ja/dsbulk/doc/"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "install-jajp" : {
        "install68" : ["DataStaxインストール文書6.8", "/en/install/6.8/"],
        "jajpinstall67" : ["DataStaxインストール文書6.7", "/ja/install/6.7/"],
        "jajpinstall60" : ["DataStaxインストール文書6.0", "/ja/install/6.0/"],
        "jajpinstallindex" : ["DataStax Enterpriseツールのインストール", "/ja/install/doc/"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "upgrade-jajp" : {
        "jajpupgrade" : ["DataStax Enterpriseのアップグレード", "/ja/upgrade/doc/"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    },
    "glossary-jajp" : {
        "jajpglossary" : ["用語集", "/ja/glossary/doc/glossary/glossaryTOC.html"],
        "all" : ["ドキュメント一覧", "/ja/landing_page/doc/landing_page/docList.html"]
    }
}

function getVersionDropdown(productName, docName) {
    var spanElement = document.getElementById('version-dropdown');
    if ( docName == "landingpage" || docName == "jajplandingpage") {
        spanElement.style.display = "none";
        return;
    }
    var specialProducts = ["dse50"];
    var ossProducts = ["cql31", "cql3x", "cql33", "cassandra21", "cassandra22", "cassandra3x", "cassandra30", "cassandralp"];
    var archivedProducts = [ "dse32", "dse40", "dse45", "dse46", "dse47", "dse48", "cassandra12",
                             "cassandra20", "cassandrawin22", "cassandrawin30", "cassandrawin3x", "cql30",
                             "opsc60", "opsc52", "opsc51", "opsc50", "opsc40", "opsc41" ];
    if ( archivedProducts.includes(docName) ) {
        var formElement = document.getElementById('version-dropdown');
        formElement.style.display = "none";
        return;
    }
    if ( specialProducts.includes(docName) ) {
        productName = productName + "-archived";
    }
    var selectElement = document.createElement("select");
    selectElement.setAttribute("onchange", "contextAwareVersionSwitcher(this.options[this.selectedIndex].value);");
    var itemElement = null;
    var ogFlag = false;
    var optgroupElement = null;
    /* TBD productName + '-jajp' if locale is jajp */
    if (docName.substring(0, 4) === 'jajp') {
        productName = productName + '-jajp';
    }
    try {
        if ( data[productName][docName] ) {
            for ( option in data[productName] ) {
                if ( option.substring(0, 5) === 'label' ) {
                    optgroupElement = document.createElement("optgroup");
                    optgroupElement.setAttribute("label", data[productName][option]);
                    optgroupElement.setAttribute("style", "color:#58595b; background-color:white; padding-left:3px");
                    selectElement.appendChild(optgroupElement);
                    ogFlag = true;
                }
                var optionElement = document.createElement("option");
                if ( option == docName ) {
                    optionElement.setAttribute("selected", "true");
                    optionElement.setAttribute("class", "color:white");
                }
                var contentNode = document.createTextNode(data[productName][option][0]);
                optionElement.appendChild(contentNode);
                optionElement.setAttribute("value", data[productName][option][1]);
                if ( option.substring(0, 5) === 'label' ) {
                    // do nothing
                } else if ( ogFlag ) {
                    optgroupElement.appendChild(optionElement);
                } else {
                    selectElement.appendChild(optionElement);
                }
            }
        } else {
            var emptyOptionElement = document.createElement("option");
            var emptyContentNode = document.createTextNode("TBD");
            emptyOptionElement.appendChild(emptyContentNode);
            emptyOptionElement.setAttribute("value", "/en/landing_page/doc/landing_page/docList.html");
            selectElement.appendChild(emptyOptionElement);
        }
    } catch (error) {
        console.log(productName + " does not exist.");
    }
    var formElement = document.getElementById('version-dropdown-form');
    if (! formElement) {
        return;
    }
    var oldSelectElement = formElement.firstElementChild;
    formElement.replaceChild(selectElement, oldSelectElement);
};

function contextAwareVersionSwitcher(selectedUrl) {
    // selecting a link to the landing page should immediately redirect
    if (selectedUrl.indexOf("landing_page") > -1) {
        window.location = selectedUrl;
    }
    // otherwise, do some URL parsing magic to figure out if the same topic exists in the target doc
    var pathArray = window.location.pathname.split( '/' );
    var currentUrl;
    // handle latest-* urls in dropdown
    if (pathArray[2].indexOf("latest") > -1) {
        currentUrl = "/" + pathArray[1] + "/" + pathArray[2] + "/";
    } else if (pathArray[4].indexOf("dse-") > -1 || pathArray[4] == "cql") {
        currentUrl = "/" + pathArray[1] + "/" + pathArray[2] + "/" + pathArray[3] + "/" + pathArray[4] + "/";
    } else {
        currentUrl =  "/" + pathArray[1] + "/" + pathArray[2] + "/" + pathArray[3] + "/";
    }
    // get the pathname of the current page to compare to the selected URL
    rawUrl = window.location.pathname;
    // now strip the currently selected doc base url
    parsedUrl = rawUrl.replace(currentUrl, selectedUrl);
    // See if the topic exists in the selected doc; if so, go to topic, if not go to base url
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function() {
        // if the topic exists, we'll get a 200 response
        if (this.readyState == 4) {
            if (this.status == 200) {
                window.location = parsedUrl;
            } else {
                window.location = selectedUrl;
            }
        }
    }
    xhr.onerror = function() {
        console.log("Current topic not in selected doc, redirect to doc home " + selectedUrl);
        window.location = selectedUrl;
    }
    xhr.open('GET', parsedUrl, true);
    xhr.send();
}
