function findFile(url) {
  var i,j;
  for (i=0; i<url.length; ++i)
    if (url.charAt(i)=='#' || url.charAt(i)=='?')
      break;
  for (j=i; j>=0; --j)
    if (url.charAt(j)=='/' || url.charAt(j)=='\\')
      break;
  return url.substring(j+1,i);
}

function stripExt(file) {
  return file.indexOf('.') == -1 ? file : file.substring(0,file.indexOf('.'));
}

artistname = stripExt(findFile(document.URL));
artistname = artistname.substring(0,artistname.length-2);

function artistTitle() {
  document.write('<img  src="' + artistname + '_t.gif" width=435 height=62 border=0>');
}

function setImg(imgname,filename) {
  if (document.images)
    eval('document.'+imgname).src=filename;
}

function landscape(filename) {
  if (window.screen) {
      xpos=(screen.width>500)?(screen.width-500)/2:0;
      ypos=(screen.height>375)?(screen.width-375)/2:0;
      window.open(filename,'Artwork','status=true,width=500,height=375,screenX=xpos,screenY=ypos');
  }
  else {
      window.open(filename,'Artwork','status=true,width=500,height=375');
  }
}

function portrait(filename) {
  if (window.screen) {
      xpos=(screen.width>375)?(screen.width-375)/2:0;
      ypos=(screen.height>500)?(screen.width-500)/2:0;
      window.open(filename,'Artwork','status=true,width=375,height=500,screenX=xpos,screenY=ypos');
  }
  else {
      window.open(filename,'Artwork','status=true,width=375,height=500');
  }
}

function gotopage(ext) {
  window.location=artistname+ext+'.htm';
}



