var url = document.URL; 
var DocName =(url.substring(url.lastIndexOf("\/")+1,url.lastIndexOf("\."))); // for *nix 
