var n=String(window.document.location);
var webpath=n.substring(0,n.lastIndexOf("/"));
alert(webpath) ;