function hideDiv() {
	var el = document.getElementById('hideshowNO');
  	if ( el ) {
		el.style.display = 'none';
	}
}

function showDiv() {
	var el = document.getElementById('hideshowNO');
  	if ( el ) {
		el.style.display = '';
	}
}

addLoadListener(hideDiv);

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;
    }
  }
  if (document.getElementById("sm_font"))	document.getElementById("sm_font").className="";
	if (document.getElementById("medium_font")) document.getElementById("medium_font").className="";
	if (document.getElementById("large_font")) document.getElementById("large_font").className="";
	if (document.getElementById(title)) document.getElementById(title).className="active";
}

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 initGetStyle() {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

function setStyleCookie() {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

addLoadListener(initGetStyle);
addUnloadListener(setStyleCookie);

function mailPage()
{
  mail_str = "mailto:?subject=BARACLUDE.com Information: " + document.title;
  mail_str += "&body=Please see this important information about " + document.title;
  mail_str += " " + location.href + " from BARACLUDE.com.";
  mail_str += "%0a%0dPersonal message:"; 
  location.href = mail_str;
}

function addLoadListener(fn) {
	if (typeof window.addEventListener != 'undefined') {
		window.addEventListener('load', fn, false);
	} else if (typeof document.addEventListener != 'undefined') {
		document.addEventListener('load', fn, false);
	} else if (typeof window.attachEvent != 'undefined') {
		window.attachEvent('onload', fn);
	} else {
		var oldfn = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = fn;
		} else {
			window.onload = function() {
				oldfn();
				fn();
			};
		}
	}
}

function addUnloadListener(fn) {
	if (typeof window.addEventListener != 'undefined') {
		window.addEventListener('unload', fn, false);
	} else if (typeof document.addEventListener != 'undefined') {
		document.addEventListener('unload', fn, false);
	} else if (typeof window.attachEvent != 'undefined') {
		window.attachEvent('onunload', fn);
	} else {
		var oldfn = window.onunload;
		if (typeof window.onunload != 'function') {
			window.onunload = fn;
		} else {
			window.onunload = function() {
				oldfn();
				fn();
			};
		}
	}
}

/*
 * object used to add onload functions for the body onload event
 * this way we can keep JS that needs to run onload unobtrusive
 *
 * usage: windowObject.addLoadFunction([pass function], [pass function]);
 * you can pass 1 or more functions, the number does not matter
 */

/*
 * This function is NOT compatible with <body onload="pageInit()">
 * DO NOT USE / DELETE
 */
/*
WindowObject = function(win) {
	this._win = win;
	this.stack = [];
	this.unstack = [];
};

WindowObject.prototype = {
	"runFuncs": function() {
		for(var index = 0; index < this.stack.length; index++) {
			this.stack[index]();
		}
	},
	"addLoadFunction": function() {
		for(var index = 0; index < arguments.length; index++) {
			this.stack.push(arguments[index]);
		}
	}
};

var windowObject = new WindowObject(this);

function runOnLoad() {
	windowObject.runFuncs();
}
window.onload = runOnLoad;
*/
