/**COOKIES*/function setCookie(name, value, expires, path, domain, secure){document.cookie= name + "=" + escape(value) +((expires) ? "; expires=" + expires : "") +((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +((secure) ? "; secure" : "");}function getCookie(name){var dc = document.cookie;var prefix = name + "=";var begin = dc.indexOf("; " + prefix);if (begin == -1){begin = dc.indexOf(prefix);if (begin != 0) return null;}else{begin += 2;}var end = document.cookie.indexOf(";", begin);if (end == -1){end = dc.length;}return unescape(dc.substring(begin + prefix.length, end));}function deleteCookie(name, path, domain){if (getCookie(name)){document.cookie = name + "=" + ((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}/**MENUS*/	var myTimer;var delay = 300;var hovertime = 0;function delaytimer(){
		setTimeout("",delay);
		}
	function openMenu(menu) {
		closeAllMenus();
		headingmenu = 'heading' + menu.charAt(menu.length - 1);
		changeClass(document.getElementById(headingmenu),'menuheadingactive');
		if (headingmenu == 'heading1') addon = 0;
			else addon = 2;
		document.getElementById(headingmenu).style.width = parseInt(document.getElementById(headingmenu).style.width) + addon + 'px';
		if (navigator.userAgent.indexOf('Safari') == -1)
			hovertime = setTimeout("document.getElementById('"+menu+"').style.display='block'",delay);
			else document.getElementById(menu).style.display='block';
		}
	function closeMenu(menu) {
		if (hovertime)
			clearTimeout(hovertime);
		myTimer = window.setTimeout("closeAllMenus();","300");
		}
	function closeAllMenus() {
		document.getElementById("menu1").style.display="none";
		document.getElementById("heading1").className="menuheading";
		document.getElementById("heading1").style.width = '64px';
		document.getElementById("menu2").style.display="none";
		document.getElementById("heading2").className="menuheading";
		document.getElementById("heading2").style.width = '64px';
		document.getElementById("menu3").style.display="none";
		document.getElementById("heading3").className="menuheading";
		document.getElementById("heading3").style.width = '82px';
		document.getElementById("menu4").style.display="none";
		document.getElementById("heading4").className="menuheading";
		document.getElementById("heading4").style.width = '78px';
		document.getElementById("menu5").style.display="none";
		document.getElementById("heading5").className="menuheading";
		document.getElementById("heading5").style.width = '70px';
		document.getElementById("menu6").style.display="none";
		document.getElementById("heading6").className="menuheading";
		document.getElementById("heading6").style.width = '90px';
		document.getElementById("menu7").style.display="none";
		document.getElementById("heading7").className="menuheading";
		document.getElementById("heading7").style.width = '136px';
		document.getElementById("menu8").style.display="none";
		document.getElementById("heading8").className="menuheading";
		document.getElementById("heading8").style.width = '130px';
		}
	function stopTimer() {
		window.clearTimeout(myTimer);
		}
	function changeClass(divname,newClass) {
		divname.className=newClass;
		}

/**PAGE FUNCTIONS<script language=\"JavaScript\">document.getElementById(\"tools\").style.display = \"none\";document.getElementById(\"tooltrim\").style.display = \"none\";</script>*/
// opens the printable version window to grab the content of centercolumn and pass it through
function printable() {var d = new Date();var curr_year = d.getFullYear();
var nwin = window.open("", "PrintWin", "width=550,height=500,scrollbars,resizable,menubar,toolbar");
var header = "<HTML><HEAD><link rel=stylesheet type=text/css href=\"http://www.hamilton.edu/hamiltonstyle-b-w-w.css\"><style type=\"text\/css\">BODY {padding:7px;}</style></HEAD><BODY><img src=\"http://www.hamilton.edu/images/printablelogo.jpg\" align=bottom alt=\"Hamilton College\">&nbsp;&nbsp;&nbsp;[<a href=\"\" onClick=\"window.close();\">close window</a>]<hr size=1><br>&nbsp;<br><div id=\"centercontent\">";
var footer = "</div><hr size=1><CENTER>Copyright &copy;" + curr_year + " The Trustees of Hamilton College.&nbsp; All rights reserved.</CENTER><script language=\"javascript\">function getCookie(name){var dc = document.cookie;var prefix = name + \"=\";var begin = dc.indexOf(\"; \" + prefix);if (begin == -1){   begin = dc.indexOf(prefix);if (begin != 0) return null;}else{begin += 2;}var end = document.cookie.indexOf(\";\", begin);if (end == -1){end = dc.length;}return unescape(dc.substring(begin + prefix.length, end));}if (getCookie(\"fontsize\") != null){document.getElementById(\"centercontent\").className = getCookie(\"fontsize\");};</script></BODY></HTML>";var n = nwin.document;n.writeln(header);
if(document.getElementById('centercolheader'))
	{n.writeln(document.getElementById('centercolheader').innerHTML);}
n.writeln(document.getElementById('centercolumn').innerHTML);n.writeln(footer);n.close();}
function preview_draft() {if (window.opener) {var frame = window.opener.frames['contentiframe'];document.getElementById('centercolumn').innerHTML = frame.FCK.GetHTML();}}
// opens the printable version window to grab the content of centercolumn and pass it through
function printableOld() {var nwin = window.open("", "PrintWin", "width=550,height=500,scrollbars,resizable,menubar,toolbar");var header = "<HTML><HEAD><link rel=stylesheet type=text/css href=\"http://www.hamilton.edu/hamiltonstyle.css\"><style type=\"text\/css\">BODY {padding:7px;}</style></HEAD><BODY><img src=\"http://www.hamilton.edu/images/printablelogo.jpg\" align=bottom alt=\"Hamilton College\">&nbsp;&nbsp;&nbsp;[<a href=\"\" onClick=\"window.close();\">close window</a>]<hr size=1><br>&nbsp;<br><div id=\"centercontent\">";var footer = "</div><hr size=1><CENTER>Copyright &copy; 2004 The Trustees of Hamilton College.&nbsp; All rights reserved.</CENTER><script language=\"JavaScript\">document.getElementById(\"tools\").style.display = \"none\";document.getElementById(\"tooltrim\").style.display = \"none\";</script></BODY></HTML>";var n = nwin.document;n.writeln(header);n.writeln(document.getElementById("centercolumn").innerHTML);n.writeln(footer);n.close();}
// function changes font size based on the class passed in
function changefontsize(newstyle) {document.getElementById('centercolumn').className = newstyle;setCookie('fontsize',newstyle,'Wednesday, 31-Jan-29 12:09:32 GMT','/','hamilton.edu');}
// this fix makes the menus work properly in NS6 and NS7.0 (7.1 not affected)
function net67fix() {if (navigator.userAgent.indexOf('Netscape6') != -1 || navigator.userAgent.indexOf('Netscape/7.0') != -1){document.getElementById('menuframe').style.position = 'absolute';document.getElementById('menuframe').style.top = '67px';document.getElementById('menuframe').style.width = 'inherit';document.getElementById('topbanner').style.paddingBottom = '25px';}}
/** MY HAMILTON */
var chsettings = document.getElementById('chsettingsbox');var chcommands = document.getElementById('chcommandsbox');function openSettings(channelid) {document.getElementById('sitescreen').style.display = 'block';document.getElementById('sitescreen').style.visibility = 'visible';chsettings.style.display = 'block';chsettings.src = 'editChannel.cfm?mode=editform&channelid=' + channelid;}function openSettingsBox(gourl) {document.getElementById('sitescreen').style.display = 'block';document.getElementById('sitescreen').style.visibility = 'visible';chsettings.style.display = 'block';chsettings.src = gourl;}function closeChannel(column,recordcount,channelid,tabid) {var x = window.confirm('You are about to remove this channel. You can\n re-add it by clicking the "add channel" button.\n Are you sure you want to do this? ');if (x) {document.getElementById('channel_' + channelid).style.display = 'none';var params = 'channelid=' + channelid + '&tabid=' + tabid;var sendupdate = new Ajax.Updater('', 'closeChannel.cfm', {method: 'get', parameters: params, asynchronous:true}); }else return false;}function delLinkGroup(id) {var x = window.confirm('Are you sure you want to delete this heading?\nAll links under this heading will be deleted as well.');if (x) {	urlToGo = 'addlink.cfm?action=deletegroup&id=' + id;window.location.href = urlToGo;}else return false;}function reloadpage() {chcommands.src = 'placeholder.shtml';chsettings.src = 'placeholder.shtml';location.reload('/myhamilton');}function getSort() {var thisorder1 = document.getElementById("listorder1");thisorder1.value = DragDrop.serData('c1', null);submitOrder(thisorder1.value);}function submitOrder(neworder) {chcommands.src = 'reorderChannels.cfm?tabactive=' + jstabid + '&orderJS=' + neworder;}  function openrss(feedlink) { window.open('/myhamilton/rss/feedframe.cfm?feedlink=' + feedlink,'feedframe','width=760,height=500,scrollbars,resizable'); }
/* Streamfile implementation for streaming QT or flash files */

function includeJS(jsfilename,type,filename,width,height,loop,play,bgcolor,align){
  var js=document.createElement('script');
  js.setAttribute('type','text/javascript');
	js.setAttribute('language','javascript');
	js.setAttribute('src',jsfilename);
  document.getElementsByTagName('head')[0].appendChild(js);
	streamfileloaded = true;
	streamfileloading = true;
	window.setTimeout(function(){writeStreamfile(type,filename,width,height,loop,play,bgcolor,align);},500);
}
function streamfile(type,filename,width,height,loop,play,bgcolor,align){
	AC_FL_RunContent = 0;
	if (typeof streamfileloaded != 'undefined'){
		if (!streamfileloaded){
			if (typeof streamfileloading == 'undefined'){
				if (type == 'flash'){
					includeJS('/applications/streamfile/AC_RunActiveContent.js',type,filename,width,height,loop,play,bgcolor,align);
				}else if(type == 'qt'){
					includeJS('/applications/streamfile/scripts/AC_QuickTime.js',type,filename,width,height,loop,play,bgcolor,align);
				}
			}else{
				window.setTimeout(function(){writeStreamfile();},500);
			}
		}else{
			writeStreamfile(type,filename,width,height,loop,play,bgcolor,align);
		}
	}else{
		streamfileloaded = false;
		if (type == 'flash'){
			includeJS('/applications/streamfile/AC_RunActiveContent.js',type,filename,width,height,loop,play,bgcolor,align);
		}else if(type == 'qt'){
			includeJS('/applications/streamfile/scripts/AC_QuickTime.js',type,filename,width,height,loop,play,bgcolor,align);
		}
	}
}
function writeStreamfile(type,filename,width,height,loop,play,bgcolor,align){
	if (type == 'flash'){
		if (AC_FL_RunContent == 0) {
			window.alert("This page requires AC_RunActiveContent.js");
		}else{
			var html = document.createElement('div');
			//html.style.textAlign = align;
			html.id = filename.replace(/ /g, '');
			var id = 'flash'+filename.replace(/ /g, '');
			var parentNode = document.getElementById(id);
			parentNode.appendChild(html);
			html.innerHTML = AC_FL_ReturnContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
				'src', '/applications/streamfile/FLVPlayer',
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', play,
				'width',width,
				'height',height,
				'loop', loop,
				'scale', 'showall',
				'wmode', 'transparent',
				'devicefont', 'false',
				'id', 'FLVPlayer',
				'bgcolor', '#'+bgcolor,
				'name', 'FLVPlayer',
				'menu', 'true',
				'allowFullScreen', 'false',
				'allowScriptAccess','sameDomain',
				'movie', '/applications/streamfile/FLVPlayer',
				'flashvars', 'videoname='+filename
			);
		}
	}else if (type == 'qt'){
		var html = document.createElement('div');
		html.id = filename.replace(/ /g, '');
		var id = 'qt'+filename.replace(/ /g, '');
		var parentNode = document.getElementById(id);
		parentNode.appendChild(html);
		html.innerHTML = QT_GenerateOBJECTText_XHTML('http://www.hamilton.edu/applications/streamfile/dummy.mov',width,height,'',
			'controller','true',
			'autoplay',play,
			'autohref','true',
			'scale','tofit',
			'href',filename
		);
		//html.style.textAlign = align;
	}
}