var expDays = 30;var exp = new Date(); exp.setTime(exp.getTime() + (expDays*24*60*60*1000));function SetCookie (name, value) {  var argv = SetCookie.arguments;  var argc = SetCookie.arguments.length;  var expires = (argc > 2) ? argv[2] : null;  var path = (argc > 3) ? argv[3] : null;  var domain = (argc > 4) ? argv[4] : null;  var secure = (argc > 5) ? argv[5] : false;  document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) +  ((domain == null) ? "" : ("; domain=" + domain)) +    ((secure == true) ? "; secure" : "");}function switchMarkButton() {     picName = document.images.markButton.src;   if (picName.indexOf('unmark') > 0) {      fred = location.href;      alert(fred);      document.MarkForm.elements[2].value = "Mark";      document.MarkForm.submit();      location.href = fred;      location.reload();      }   else {      fred = location.href;      alert(fred);      document.MarkForm.elements[2].value = "Unmark";      document.MarkForm.submit();      location.href = fred;      location.reload();      } }function doMark(task) {        document.MarkForm.elements[0].value = location.href;      document.MarkForm.elements[1].value = task;      document.MarkForm.submit(); }function openHelp(url) {   helpwindow = window.open (url,'Help','screenX=200,screenY=200,height=350,width=350,scrollbars=yes,resizable=yes');   helpwindow.focus();   }function openFeedback() {   feedbackWindow = window.open ('http://www.ccohs.ca/ccinfoweb/feedback/','Feedback','screenX=20,screenY=20,top=20,left=20,height=400,width=700,scrollbars=yes,resizable=yes');   feedbackWindow.focus();   }function openSynonyms(url) {   feedbackWindow = window.open (url,'Synonyms','screenX=20,screenY=20,top=20,left=20,height=400,width=400,scrollbars=yes,resizable=yes');   feedbackWindow.focus();   }function doContents(thePath) {    maxTOC = document.Contents.maximum.value;    with (document.Contents) {    	var toc = new Array(maxTOC);  		for (var i=1; i <= maxTOC; i++) {     		toc[i] = 0;  		}    	  		for (var i=0; i < elements.length; i++) {       		if (elements[i].type == 'checkbox' && elements[i].name.substring(0,3) == "TOC") {           		if (elements[i].checked == true) {              		toc[elements[i].value] = 1;           		}       		}     	}	}      tocState = "";  for (var i=1; i <= maxTOC; i++) {     tocState += toc[i];  }  SetCookie('FORMAT', tocState, null, thePath, 'ccohs.ca');  location.reload();  return false;} function setContents(thePath, tocState){  if (tocState != '') {    SetCookie('FORMAT', tocState, null, thePath, 'ccohs.ca');    location.reload();  }  return false;}function setCustom(whichIndex){  document.Contents.QuickFormat.selectedIndex = whichIndex;  return false;}function changeSubsections(s, parent){   checkPtr = document.getElementsByName("TOC" + parent);   currentState = checkPtr[0].checked;   for (i=0; i<s.length; i++) {      checkPtr = document.getElementsByName("TOC" + s[i]);      if (checkPtr.length > 0) {         checkPtr[0].checked = currentState;         checkPtr[0].disabled = (currentState == false);      }   }   return false;}function openVerticallyCenteredWindow(url, height, width, name, parms) {   var left = Math.floor( (780 - width) / 2);   var top = Math.floor( (screen.height - height) / 2);   var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;   if (parms) { winParms += "," + parms; }   var win = window.open(url, name, winParms);   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }   return win;}function openDeptWindow(url, height, width, name, parms) {   var left = Math.floor( (screen.width - width) / 2);   var top = Math.floor( (screen.height - height) / 2);   var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;   if (parms) { winParms += "," + parms; }   deptwindow = window.open (url, name, winParms);   if (deptwindow != null) {      if (deptwindow.opener == null) {         deptwindow.opener = self;      }   }   deptwindow.focus();   }
