loc = String(location.href); host = loc.substr("http://".length); hostDir = host.substr(host.indexOf("/")); host = host.substr(0,host.indexOf("/")); match = host.match(/\.(php|php4|php5|html|htm)\z/i); msg("match = "+match); page = host.substr(host.lastIndexOf("/")); host = host.substr(0,host.lastIndexOf("/")); msg("host = "+host); msg("hostDir = "+hostDir); msg("page = "+page);