//*------------------------------------------------------*
//* urlredirect                                          *
//*------------------------------------------------------*

   var redirect      = false ;
   var port          = '';
   var newLocation   = '';
   var newPage       = '';
   var inputLocation = window.location.host.toUpperCase();

   var nodes         = new Array();
   var nodes         = inputLocation.substring(0, inputLocation.length).split('.');

   var domain        = nodes[nodes.length-2] + "." + nodes[nodes.length-1];
   for (var i=0; i<nodes.length; i++)
   {

      switch (nodes[i])
      {

         case "WWW"             :
            break;

         case "DEV"             :
            break;

         case "MAIL"            :
            newLocation         = "http://mail" + domain;
            port                = ":8080";
            redirect            = true;
            break;

         case "RBANKRACING"     :
            newPage             = "/home.htm";
            redirect            = true;
            break;

         default                :
            break;
      }

   }

   if (nodes[0] == 'MAIL')
   {
      newPage = '';
   }

   if (redirect)
   {
      window.location.replace(newLocation + port + newPage);
   }
