rem: var tailindex = image.lastIndexOf("."); 
add: var tailindex = image.lastIndexOf("."); 
context: function IsValidImage(imageName){  var image = imageName.trimString();  if ( !image )    return false;    /* look for an extension */  var tailindex = image.lastIndexOf(".");   if ( tailindex == 0 || tailindex == -1 ) /* -1 is not found */    return false;     /* move past period, get the substring from the first character after the '.' to the last character (length) */  tailindex = tailindex + 1;  var type = image.substring(tailindex,image.length);    /* convert extension to lower case */  if (type)    type = type.toLowerCase();    // TODO: Will we convert .BMPs to a web format?  switch( type )  {    case "gif":    case "jpg":    case "jpeg":    case "png":      return true;      break;  }  return false;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0b2dd2b2d2fd037df917e07645fa019a963332a5/EdDialogCommon.js/buggy/editor/ui/dialogs/content/EdDialogCommon.js