var scholwindow='';
var posx=0; // x position of browser window
var posy=0; // y position of browser window

function scholwin(scholnum)
{
// open a 400x300 window with information for a single scholarship
 var url= '';
 var loc = new String (self.location);
 var winwid='';
 
 
if (!scholwindow.closed && scholwindow.location)
	{
		scholwindow.close();
	}

    posx=(screen.width*0.5)-250;
    posy=(screen.height*0.5)-100;
    if (self.screenleft) //ie
      {
        winwid=415;
      }
     else //firefox
      {
        winwid=400;
      }

// Figure out what level of directory we're at on the webserver
loc_array=loc.split("/");
// [0]=http:
// [1]= <blank>
// [2]= servername
// [3-last-1]= directory name
// [last] = pagename.aspx

if (loc.indexOf('/src/') != -1)
  {
    // we're already in the src directory
    url='singleschol.aspx?&schol=' + scholnum + '&';
         
  }
   
  else
    {
      //loc_array.length-4 is number of subdirectory levels deep,
      url='src/singleschol.aspx?&schol=' + scholnum + '&';
      for (x=0;x<loc_array.length-5;x++)
        {
          url="../"+url;
        }
    }
    
      for (x=5;x<loc_array.length-5;x--)
        {
          url='sfs/src/singleschol.aspx?&schol=' + scholnum + '&';
        }

scholwindow=window.open(url,
   'scholwindow','height=300,width='+ winwid +',, toolbar=0, menubar=0, location=0,'
   + 'status=0,scrollbars=1,resizable=0,top='+ posy + ',left='+ posx +',false');


if (!scholwindow.opener) scholwindow.opener = self;

if (window.focus) {scholwindow.focus()}
//return false;
}



