function MM_findObj(n, d) { //v3.0
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){
      document.MM_sr[j++]=x;
      if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document;
  if(d.images){
    if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
    for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function mouseOverMenu(val) {
//alert(val);
//alert(window.document.all[val.id].className);
    window.document.all[val.id].className = 'mainMenuItemsHover';
    //alert(window.document.all[val.id].className);
}
function mouseOutMenu(val) {
    window.document.all[val.id].className = 'mainMenuItems';
}

function fwLoadMenus() {
	var temp = window.location.href.split("/");
	var dm = temp[0]+"//"+temp[1]+temp[2];       
  if (window.fw_menu_0) return;
  window.fw_menu_0 = new Menu("root",150,20,"Arial, Helvetica, sans-serif",11,"#3b7d74","#006363","#ffffff","#ffffcc");
	fw_menu_0.addMenuItem("About Us","location='http://www.mghihp.edu/aboutus.html'");
    fw_menu_0.addMenuItem("Mission and History","location='http://www.mghihp.edu/aboutus/history.html'");
	fw_menu_0.addMenuItem("Leadership and Diversity","location='http://www.mghihp.edu/aboutus/leadership.html'");
    fw_menu_0.addMenuItem("Academics and Research","location='http://www.mghihp.edu/aboutus/academics.html'");
	fw_menu_0.addMenuItem("Hours of Operation","location='http://www.mghihp.edu/aboutus/hours.html'");
	fw_menu_0.addMenuItem("Emergency Preparedness","location='http://www.mghihp.edu/aboutus/icare.html'");
    fw_menu_0.addMenuItem("Career Opportunities","location='http://www.mghihp.edu/aboutus/jobs.html'");
    fw_menu_0.addMenuItem("Press Room","location='http://www.mghihp.edu/aboutus/news.html'");
    fw_menu_0.addMenuItem("Faculty Directory","location='http://www.mghihp.edu/aboutus/directory.html'");
    fw_menu_0.addMenuItem("Contact Us","location='http://www.mghihp.edu/aboutus/contactus.html'");	
    fw_menu_0.fontWeight="plain";
    fw_menu_0.hideOnMouseOut="false";
  window.fw_menu_1 = new Menu("root",170,20,"Arial, Helvetica, sans-serif",11,"#3b7d74","#006363","#ffffff","#ffffcc");
    fw_menu_1.addMenuItem("Office of Admissions","location='http://www.mghihp.edu/admissions.html'");
	fw_menu_1.addMenuItem("Information Sessions","location='http://www.mghihp.edu/admissions/infosessions.html'");
    fw_menu_1.addMenuItem("Deadlines","location='http://www.mghihp.edu/admissions/deadlines.html'");
	fw_menu_1.addMenuItem("Admissions Requirements","location='http://www.mghihp.edu/admissions/requirements.html'");
    fw_menu_1.addMenuItem("Apply Now","location='http://www.mghihp.edu/admissions/applynow.html'");	
    fw_menu_1.addMenuItem("Tuition and Fees","location='http://www.mghihp.edu/admissions/tuition.html'");
    fw_menu_1.addMenuItem("Financing Your Education","location='http://www.mghihp.edu/admissions/financialaid.html'");
    fw_menu_1.addMenuItem("Non-Degree Course Offerings","location='http://www.mghihp.edu/admissions/nondegree.html'");
	fw_menu_1.addMenuItem("Meet Career Changers","location='http://www.mghihp.edu/admissions/newcareer.html'");
    fw_menu_1.fontWeight="plain";
    fw_menu_1.hideOnMouseOut="false";
  window.fw_menu_2 = new Menu("root",160,20,"Arial, Helvetica, sans-serif",11,"#3b7d74","#006363","#ffffff","#ffffcc");
    fw_menu_2.addMenuItem("Office of Student Affairs","location='http://www.mghihp.edu/students.html'");
	fw_menu_2.addMenuItem("Registrar","location='http://www.mghihp.edu/students/registrar.html'");
    fw_menu_2.addMenuItem("Academic Calendars","location='http://www.mghihp.edu/students/calendars.html'");
    fw_menu_2.addMenuItem("Online Catalog","location='http://www.mghihp.edu/students/catalog.html'");
    fw_menu_2.addMenuItem("Financial Aid","location='http://www.mghihp.edu/students/financialaid.html'");
    fw_menu_2.addMenuItem("Tuition and Fees","location='http://www.mghihp.edu/students/tuition.html'");
    fw_menu_2.addMenuItem("Learning Resources","location='http://www.mghihp.edu/students/resources.html'");
    fw_menu_2.addMenuItem("Student Services","location='http://www.mghihp.edu/students/services.html'");
    fw_menu_2.addMenuItem("School Store","location='http://www.mghihp.edu/students/store.html'");
    fw_menu_2.fontWeight="plain";
    fw_menu_2.hideOnMouseOut="false";
  window.fw_menu_3 = new Menu("root",190,20,"Arial, Helvetica, sans-serif",11,"#3b7d74","#006363","#ffffff","#ffffcc");
    fw_menu_3.addMenuItem("Alumni & Friends Home","location='http://www.mghihp.edu/alumni.html'");
	fw_menu_3.addMenuItem("Alumni Association","location='http://www.mghihp.edu/alumni/association.html'");
    fw_menu_3.addMenuItem("Meet Alumni","location='http://www.mghihp.edu/alumni/meet.html'");
    fw_menu_3.addMenuItem("Staying Connected","location='http://www.mghihp.edu/alumni/stayintouch.html'");
    fw_menu_3.addMenuItem("Awards and Honors","location='http://www.mghihp.edu/alumni/awards.html'");
    fw_menu_3.addMenuItem("MGH Nurses' Alumnae Association","location='http://www.mghihp.edu/alumni/mghnaa.html'");
    fw_menu_3.addMenuItem("Make a Gift","location='http://www.mghihp.edu/alumni/donate.html'");
    //fw_menu_3.addMenuItem("Alumni Job Resource Center","location='http://www.mghihp.edu/alumni/careers.html'");
    fw_menu_3.addMenuItem("Reunion","location='http://www.mghihp.edu/alumni/reunion.html'");
	fw_menu_3.addMenuItem("Scholarship Gala","location='http://www.mghihp.edu/gala.html'");
    fw_menu_3.fontWeight="plain";
    fw_menu_3.hideOnMouseOut="false";
  window.fw_menu_4 = new Menu("root",190,20,"Arial, Helvetica, sans-serif",11,"#3b7d74","#006363","#ffffff","#ffffcc");
    fw_menu_4.addMenuItem("Iware Distance Learning","location='http://www.mghihp.edu/v3'");
    fw_menu_4.addMenuItem("Ionline Information System","location='https://ionline.mghihp.edu/'");
	fw_menu_4.addMenuItem("Web Mail","location='http://www.partners.org/email/'");	
    fw_menu_4.addMenuItem("Intranet (faculty & staff)","location='http://www.mghihp.edu/intranet.html'");
    fw_menu_4.fontWeight="plain";
    fw_menu_4.hideOnMouseOut="false";
    fw_menu_4.writeMenus();
}
processWTCookie();
 
function processWTCookie(){
//alert("in processWTCookie");
        if (getWTCookie() == null){
           //alert("SETTING COOKIE");
	   var ran = Math.floor(Math.random()*1000000000);
           setWTCookie(ran);
           var url = unescape(window.location.pathname);
           var qs = unescape(window.location.search);
	   //alert(qs);
           if (qs.indexOf("cw=1") >=0){
		return;
           }
           var len = url.length;
           if(qs.length == 0) qs+="?"
	   else qs+="&";
           window.location.href=url+qs+"cw=1";
/*	   
           removed by Jorge 9/18/06
           if (url.indexOf('.html') == -1 && url.indexOf('.jsp') == -1) {          
             if (url.charAt(len-1)=='/')
                window.location.href = url+'index.html'+qs;
             else
                window.location.href = url+'/index.html'+qs;
           }
*/
        }
}
 
function getWTCookie() {
        var name = 'WT_SESSION';
        var start = document.cookie.indexOf( name + "=" );
        var len = start + name.length + 1;
        if ( ( !start ) &&
        (
          name != document.cookie.substring( 0, name.length ) ) )
        {
        return null;
        }
        if ( start == -1 ) return null;
        return "foo";
}
 
function setWTCookie(value)
{
        var days = 14;
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
        document.cookie = "WT_SESSION="+value+expires+"; path=/";
}


