platform = navigator.platform; platform = platform.toLowerCase();
var MAC = platform.indexOf('mac')
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
function print_page() {  
	if (navigator.appVersion.indexOf("Win")!=-1) {
		window.print();  
	} 
	else if (MAC) {
		alert("You will have to use the print command from the file menu\n"); 
	} 
	else if (NS) {
		window.print(); 
	} 
	else if ((VERSION > 3) && (MAC < 0) ) {
   	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 1); //Use a 1 vs. a 2 for a prompting dialog box
		//WebBrowser1.outerHTML = "";  
	}
	else {
		alert("You will have to use the print command from the file menu\n");
	}
}


if(browsertype != "archaic"){

function setActiveStyleSheet(title) {
  var i, a, main,obj;
  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+"; 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;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
  this.focus();
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

}