// Redirect to the catalog.  This way we don't have to have all the virtual hosts.
// We can just have www.promodist.com, and if anyone uses xyz.promodist.com, they
// will be redirected.

function subdomain_compat() {
    var current_href = location.href;
    var catalog_regexp = new RegExp( "http\:\/\/(.+)\.promodist\.com", "i" );
    var ar = catalog_regexp.exec( current_href );

    if (!ar) {
        return;
    }

    var catalog = ar[1];
    
    if (catalog == "www") {
        return;
    }
    
    location.href=("http://www.promodist.com/cgi-bin/" + catalog + "/index.html");
}

subdomain_compat();

