function openWin(a)
                        {
                         alert("A new browser window is about to open.");
                         window.open(a, 'smallWin1', 'location=0,toolbar=0,scrollbars=0,resizable=0,menubar=0');
                        }
                        
function openSWin(b)
                        {
                         window.open(b, 'smallWin2', 'width=500,height=200,location=0,toolbar=0,scrollbars=0,resizable=0,menubar=0');
                        }
                        
function openMWin(c)
                        {
                         window.open(c, 'smallWin3', 'width=700,height=500,location=0,toolbar=0,scrollbars=1,resizable=1,menubar=0');
                        }
function openLWin(d)
                        {
                         window.open(d, 'smallWin4', 'width=700,height=500,l ocation=1,toolbar=1,scrollbars=1,resizable=1,menubar=1');
                        }

var n4, ie, n6;
var doc,doc2,doc3,sty;

if(document.layers){
  doc = "document.";
  doc2 = ".document.";
  doc3 = "";
  sty = "";
  n4 = true;
  }else if(document.all){
  doc="document.all.";
  doc2="";
  doc3="";
  sty=".style";
  ie="true";
  }else if(document.getElementById){
  doc="document.getElementById('";
  doc2="')";
  doc3="')";
  sty="').style";
  n6="true";
  }

var win_width, win_height;
var centerhor, centerver;

function dimensions(){

if(n4 || n6){
  getX=document.getElementById("thePillar");
  //alert(getX.x);
  win_width=window.innerWidth;
  win_height==window.innerHeight;
  start=getX.x+12;
}else if(ie){
  document.all["home"].style.left=0;
  win_width=document.body.clientWidth;
  win_height=document.body.clientHeight;
  start=document.all["home"].style.pixelLeft+120;
}else{
  start=document.getElementById("home").style.left+130;
}
  centerhor=win_width/2;
  centerver=win_height/2;
}
function placeIt(elem,leftPos,topPos){

  docObj=eval(doc+elem+sty);
  if(n4||n6){
    docObj.left=leftPos;
    docObj.top=topPos;
  }else if(ie){
    docObj.pixelLeft=leftPos;
    docObj.pixelTop=topPos;
  }
}

function initialize(){

  dimensions();

  //var getX = document.getElementById("home");
  placeIt('home',start,144);
  placeIt('announce',start+64,144);
  placeIt('academics',start+212,144);
  placeIt('help',start+316,144);
  placeIt('logout',start+370,144);
  placeIt('admin',start+440,144);
  }

function showhide(elem,state){
  docObj=eval(doc+elem+sty);
  docObj.visibility=state;
}

var active_submenu1=null;
var active_submenu2=null;

function closeallmenus(){
if(active_submenu1 !=null){
  showhide(active_submenu1, 'hidden');
  }
if(active_submenu2 !=null){
  showhide(active_submenu2, 'hidden');
  }
}

var menu_close_timeout=0;
var delay=2000;

function closeall(){
  menu_close_timeout=setTimeout('closeallmenus()', delay);
  }
  
function stopall(){
  clearTimeout(menu_close_timeout);
  }

function controlsubmenu(submenu1,submenu2){
stopall();
closeallmenus();
initialize();
if(submenu1 !=null){
  showhide(submenu1,'visible');
  active_submenu1=submenu1;
  }
if(submenu2 !=null){
  showhide(submenu2,'visible');
  active_submenu2=submenu2;
  }
}
