<!--

// Author information for style.js
//---------------------------------------------
// Script file assembled by Keith W Bell
// Tuesday, July 06, 2004
// www.december14.net
//---------------------------------------------


function bookmark() {
   if (window.external) {
      window.external.AddFavorite(location.href, document.title);
      return false;
   }
}


function printPage() {
   if(window.print) {
      window.print();
      return false;
   }
}


isIE = (document.all) ? true:false;


function abbrIE() {
	var oldTag, newTag, regX;
	if (isIE) {
		oldTag = document.body.innerHTML;
		regX = /<ABBR([^>]*)>([^<]*)<\/ABBR>/g;
		newTag = oldTag.replace(regX, '<abbr $1><span class=\"abbr\" $1>$2</span></abbr>');
		document.body.innerHTML = newTag;
	}
}


function blurLinks() {
   if(document.getElementsByTagName) {
      var a = document.getElementsByTagName('a');
      for(var i=0; i<a.length; i++) {
         a[i].onfocus = function() {
            this.blur();
         }
      }
   }
}

function setActiveSS(title) {
	var i, a, main;
	for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if (a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1
			&& a.getAttribute("title")) {
				a.disabled = true;
				if(a.getAttribute("title") == title) a.disabled = false;
		}
	}
}


function getActiveSS() {
	var i, a;
	for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if (a.getAttribute("rel")
			&& a.getAttribute("rel").indexOf("style") != -1
			&& a.getAttribute("title")
			&& !a.disabled
		)
		return a.getAttribute("title");
	}
	return null;
}


function getPreferredSS() {
	var i, a;
	for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if (a.getAttribute("rel")
			&& 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;
}


window.onload = function(e) {
	var cookie = readCookie("npantext");
	var title = cookie ? cookie : getPreferredSS();
	setActiveSS(title);
	abbrIE();
   blurLinks();
}


window.onunload = function(e) {
	var title = getActiveSS();
	createCookie("npantext", title, 365);
}

var cookie = readCookie("npantext");
var title = cookie ? cookie : getPreferredSS();
setActiveSS(title);


function popUp(strURL,strType,strHeight,strWidth) {
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,scrollbars,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
window.open(strURL, 'newWin', strOptions);
}
//-->
