// $Id: imodules-common.js,v 1.3 2006/02/08 21:10:34 smoitozo Exp $ 
// 
// (c) 2006 Bates College 
// Author: Steve Moitozo <first initial, plus last name @bates.edu> 
// Modified: 20060208 
// Description: The JavaScript file for the Bates iMODULES-powered community system 
// 
// this function handles the popup window
// @param string url     -- the URL to open
// @param integer width  -- the width of the new window // @param integer height -- the height of the new window // @return void // // usage example:
//
// <a href="javascript:bateswin("http://www.bates.edu",700,500)">Bates College</a>
//
function bateswin(url,width,height){

   var left=75;
   var top=25;
   var windowParams =
"directories,location,menubar,scrollbars,resizable,status,toolbar"+",width="+width+",height="+height+",left="+left+",top="+top;

   self.name = "mother_window";
   window.open(url,"child_window",windowParams);

}

//justin kramp, imodules software
//july 2006
//this function is used to show/hide the legend on directory search results page

function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}

//justin kramp, imodules software
//dec 2006
// to  close edu wizard form popups and reload profile page
function saveclose ()
{
       opener.location.reload(true);
       opener.focus();
       self.close();
}