var $jq = jQuery.noConflict();

function getServerPath() {
  var pathname = window.location.toString();
  var iPos = pathname.toLowerCase().lastIndexOf('/web/');
  if(iPos>0) return pathname.substring(0, iPos+5);
  if(iPos==-1) {
    iPos = pathname.toLowerCase().lastIndexOf('wedbg.php');
    if(iPos==-1) iPos = pathname.toLowerCase().lastIndexOf('index.php');
    if(iPos==-1) return '/';
    return pathname.substring(0, iPos);
  }
  return pathname;
}

$jq.path = getServerPath();
