/*-------------------------------------------------*/
/* Code on this site Copyright (c) 2001            */
/* Centre for IBM e-business Innovation :: Toronto */
/* www.ibm.ca/newblue/                             */
/* Andy Kale - akale@ca.ibm.com                    */
/*-------------------------------------------------*/

var ns4=(document.layers)? true:false;
var ie4=(document.all)? true:false;
var ns6=(document.getElementById && !document.all)? true:false;
var hide=true;
var prevMenu='';
var currentMenu='';

//used for rollover effect on home page drop down menu
function changeBg(layerName,swapColor) {
 if (ns4) { document.layers[layerName].bgColor = swapColor; }
 if (ie4) { document.all[layerName].style.backgroundColor = swapColor; }
 if (ns6) { document.getElementById(layerName).style.backgroundColor = swapColor; }
}

//delay for users to move from one menu item to another
function timeOut(menuName,delay) {
	hideLayer=menuName;
	setTimeout ("delayHide()",delay);
}

//used to hide all menus, except current one
function showAll() {
 hide=false;
 var allMenus = new Array ("M1","M2","M3","M4","M5","M6");
   for (loop=0; loop <allMenus.length; loop++) {
	if (ns4) { document.layers[allMenus[loop]].visibility = "visible";	}
	else if (ie4) {	 document.all[allMenus[loop]].style.visibility = "visible";	}
	else if (ns6) {	 document.getElementById(allMenus[loop]).style.visibility = "visible";	}
   }
 }

//used to hide all menus, except current one
function hideAll() {
 var allMenus = new Array ("M1","M2","M3","M4","M5","M6");
   for (loop=0; loop <allMenus.length; loop++) {
	if (ns4) { document.layers[allMenus[loop]].visibility = "hide";	}
	else if (ie4) {	 document.all[allMenus[loop]].style.visibility = "hidden";	}
	else if (ns6) {	 document.getElementById(allMenus[loop]).style.visibility = "hidden";	}
   }
 }

//delay for users to move from one menu item to another
function timeOut(menuName,delay) {
	hideLayer=menuName;
	setTimeout ("delayHide()",delay);
}

//called by timeOut function...if user has not moused over a selection (hide=false) within
//the delay period by now, sub-menu layer will be hidden
function delayHide() {
	if (hide==true) {
		if (ns4) {
		 document.layers[hideLayer].visibility = "hide";
	    }
		else if (ie4) {
		 document.all[hideLayer].style.visibility = "hidden";
		}
		else if (document.getElementById) {
	     document.getElementById(hideLayer).style.visibility = "hidden";		 
		}
	}
}



// clears the menu when user clicks their mouse anywhere else on screen
function checkClick() {
if (ns4) document.captureEvents(Event.CLICK);
document.onclick = clearOnClick;
}

// clears the menu when user clicks their mouse anywhere else on screen
function clearOnClick(evt)
{
 if (ns4) document.routeEvent(evt);
 hideAll();
}

// resize fix courtesy of WebMonkey
if (document.layers) { window.onResize = reloadIt; }

function reloadIt() { document.location = document.location; }

//These 2 function for writing the Last Updated Date of the Page
//In the Day of the Week, Month, dd, yyyy format.
function initArray() {  // Thanks JavaScript Mailing List for this function
      this.length = initArray.arguments.length
      for (var i = 0; i < this.length; i++)
      this[i+1] = initArray.arguments[i]
   }
   
//Short version of the Date displayed

function displayMonth_short() {

/*declare arrays */
daysInMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
monthName = new Array ("January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December ");

/* declare variables */
var today = new Date();
var day = today.getDay();
var month = today.getMonth();
var date = today.getDate();
var year = today.getFullYear();
var showMonthName = monthName[today.getMonth()];

/* check for leap year */
if ( ((year % 4 == 0) && !(year % 100 == 0)) || (year % 400 == 0)) {
 daysInMonth[1]++;
}

/* display current day and month headings */
document.write("<span class='text9pt-bold-blk'>" + showMonthName + date + ", " + year + "</span>");

}


//to code the email from robots
function email_action(user_name){
	document.write("<a href=\"mailto: " + user_name + "@georgebrown.ca\">" + user_name + "@georgebrown.ca</a>");}


function new_window  (url,w_width,w_height){
params="width="+w_width+", height="+w_height+", status=yes, toolbar=no, menubar=no, scrollbars=yes, resizable=yes";
open(url, "new_small_window", params);
return false;
}

function advising() {
	var today = new Date();
	var day = today.getDay();
	if ((day == 1) || (day == 3) || (day == 5) || (day == 7))
		{document.write("<img src='images_new/images/girl_in_orange_advising.jpg' alt='Student of George Brown College' width='110' height='125' border='0' />");}
	else// if ((day == 2) || (day == 4) || (day == 6))
		{document.write("<img src='images_new/images/guy_advising.jpg' alt='Student of George Brown College' width='110' height='125' border='0' />");}
}

function advising_grad() {
	var today = new Date();
	var day = today.getDay();
	//if ((day == 1) || (day == 3) || (day == 5) || (day == 7))
		{document.write("<a href='/deafstudies/alumni_Patricia_Grant.aspx' class='link'><img src='/images_new/news/Patricia_grant_sm.jpg' alt='Graduate from George Brown' width='110' height='125' border='0' align='centre' /><br />Patricia Grant, Grad. June " + "'" + "03</a>");}
	//else// if ((day == 2) || (day == 4) || (day == 6))
		//{document.write("<img src='images_new/images/guy_advising.jpg' alt='Student of George Brown College' width='110' height='125' border='0' />");}
}

//second function for the right side of the page
function show_pict_right_grad() {
	var today = new Date();
	var day = today.getDay();
	{document.write("<a href='/deafstudies/alumni_Patricia_Grant.aspx'><img src='/images_new/news/right_patricia_grant.jpg' width='176' height='176' border='0' alt='Patricia Grant. Graduated: 2003.' /></a><br /><img src='/images_new/images/white_spacer.gif' alt='' width='176' height='2' border='0' /><br /><a class='linkwhite' href='/deafstudies/alumni_Patricia_Grant.aspx' style='line-height: 19px;'><div align='center'>Read our Graduate<br />Success Story</div></a>");}
	}
//end of the function


