// Used for pages with strict doctypes (i.e. no target="_blank")
// Automagically adds them back in to links with rel="external"

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") { anchor.target = "_blank";  }
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup") {
      var subscribeURL = anchor.getAttribute('href');
      anchor.onkeypress = function(){window.open(this.href, 'DisclaimerWindow', 'toolbar=no,menubar=no,width=630,height=500,location=no,scrollbars=yes,resizable=no,status=no,left=30,top=30'); return false; }
      anchor.onclick = function(){window.open(this.href, 'DisclaimerWindow', 'toolbar=no,menubar=no,width=630,height=500,location=no,scrollbars=yes,resizable=no,status=no,left=30,top=30'); return false; }
      }
  }
}
window.onload = externalLinks;

var ie = document.all; // IE Test
// Gets around the problem of having multiple onload handlers ----------------------------------
// http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html
// http://www.quirksmode.org/js/events_advanced.html

function addEvent(obj, evType, fn) {

    // W3C type of event registration model
    if (obj.addEventListener) {
        obj.addEventListener(evType, fn, false);
        return true;
    // MS event registration model
    } else if (obj.attachEvent) {
        var r = obj.attachEvent("on"+evType, fn);
        return r;
    // Bad browsers that cant do either
    } else {
        return false;
    }
}
// Makes the print button visible on puts in the functionality
function makePrintButton() {

    // Fail safe for bad browsers
    if(!document.getElementById) return false;

    // Checks if object exists
    if(!document.getElementById('printCntrl')) return false;

    // Assigns a var and turns on visibility
    var pnt = document.getElementById('printCntrl');
    pnt.style.visibility = "visible"

    // Makes the print function for onclick, onkeypress and href.
    pnt.onclick = Function("window.print()");
    pnt.onkeypress = Function("window.print()");
    pnt.href = "javascript:window.print()";

}
addEvent(window, 'load', makePrintButton);


  function clearDefaultTextField(thisField,defaultText){
    if(thisField.value==defaultText){
      thisField.value='';
    }
  }