/************************************************//*	BEGIN COLLAPSE								*//************************************************/function collapseAll() {	for ( var i = 0, tag; tag = window.headers[i]; i++) {		tag.collapse();	};};function expandAll() {	for ( var i = 0, tag; tag = window.headers[i]; i++) {		tag.expand();	};};function toggleSection() {	var oContent = document.getElementById(this.sectionName +"_content");	oContent.style.display = (this.showing) ? "none" : "block";	this.showing = (this.showing) ? false : true;	this.firstChild.firstChild.nodeValue = (this.showing) ? "- " : "+ ";	this.blur();	return false;};function initCollapse() {	if (document.getElementsBySelector) {		var tags = document.getElementsBySelector(".section_header");		window.headers = new Array;				for (i=0; i<tags.length; i++) {						// Create a temporary placeholder element			var oTemp = document.createElement("div");						// Create Link Element			var oLink = document.createElement("a");			oLink.sectionName = tags[i].id;			oLink.showing = true;			oLink.setAttribute("boss", "sdf");			oLink.setAttribute("href", "#");			oLink.onclick = toggleSection;						oLink.expand = function() {				this.showing = false;				this.onclick();			};						oLink.collapse = function() {				this.showing = true;				this.onclick();			};						// Add Link Element to window.headers array			window.headers.push(oLink);						// Create a text element for the +/- symbol on the headers			var oGlyph = document.createElement("span");			oGlyph.setAttribute("id", tags[i].id +"_glyph");			//oGlyph.className = "expand-collapse-glyph";			oGlyph.appendChild(document.createTextNode("- "));						// Append the +/- element to the Link Element			oLink.appendChild(oGlyph);						for (j=0; j<tags[i].childNodes.length; j++) {			  if (tags[i].childNodes[j].tagName != 'a') {				oLink.appendChild(tags[i].childNodes[j]);                          }			}			tags[i].insertBefore(oLink,tags[i].firstChild);		}	};	setDefault();};function setDefault() {	// Collapse the searchOptions by default	var sView = readCookie("view");	if (sView) {		var arr = sView.split(",");	} else {	  var arr = ["classesTutsAppts","services","facultyServices","aboutUs","myQuickLinks","searchOptions","sourcesSubject","quickGenRef","requestMaterials","theCommons","searchSite","suggestionBox"];	}		for ( var i = 0, tag; tag = window.headers[i]; i++) {		for ( var j=0; j<arr.length; j++) {			if (tag.parentNode.id == arr[j]) {				tag.collapse();			}		}	}};function saveCollapse() {	var arr = new Array();	for ( var i = 0, tag; tag = window.headers[i]; i++) {		if (!tag.showing) {			arr.push(tag.parentNode.id);		}	}//	alert(arr.join("\n"));	createCookie("view",arr.join(","),365);};addEvent(window,"load", initCollapse, false);/************************************************//*	END COLLAPSE								*//************************************************//************************************************//*	BEGIN STYLE SWITCHER						*//************************************************/function setActiveStyleSheet(title) {	var i, a, main;	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {			a.disabled = true;			if(a.getAttribute("title") == title) a.disabled = false;		};	};};function getActiveStyleSheet() {	var i, a;	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");	};	return null;};function getPreferredStyleSheet() {	var i, a;	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {		if(a.getAttribute("rel").indexOf("style") != -1		&& a.getAttribute("rel").indexOf("alt") == -1		&& a.getAttribute("title")		) return a.getAttribute("title");	};	return null;};function createCookie(name,value,days) {	if (days) {		var date = new Date();		date.setTime(date.getTime()+(days*24*60*60*1000));		var expires = "; expires="+date.toGMTString();	} else {		expires = "";	};	document.cookie = name+"="+value+expires+"; path=/";};function readCookie(name) {	var nameEQ = name + "=";	var ca = document.cookie.split(';');	for(var i=0;i < ca.length;i++) {		var c = ca[i];		while (c.charAt(0)==' ') c = c.substring(1,c.length);		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);	};	return null;};function styleInit() {	var cookie = readCookie("style");	var title = cookie ? cookie : getPreferredStyleSheet();	setActiveStyleSheet(title);};function styleUnInit() {	var title = getActiveStyleSheet();	createCookie("style", title, 365);	saveCollapse(); // Saves the current "view" of the home page.};addEvent(window, "load", styleInit, false);addEvent(window, "unload", styleUnInit, false);var cookie = readCookie("style");var title = cookie ? cookie : getPreferredStyleSheet();setActiveStyleSheet(title); /************************************************//*	END STYLE SWITCHER							*//************************************************/