if(typeof(nmcphc) == 'undefined')    var nmcphc = {};/* Historic function: many nmcphc pages use this to register an onload * action. Now we can defer to jQuery's "on ready", which can start getting * things done when the DOM is fully loaded, but related resources such as * images may still be loading up */nmcphc.registerLoader = function(func) {    jQuery(document).ready(func);};jQuery(document).ready(function() {    jQuery('a.targeted').each(nmcphc.attach_targeted_behavior);});nmcphc.resizer = (function($) {    var default_config = {        resize_container: '#text-resizer',        button_selector: 'a.resize-link',        button_highlight_class: 'btn-selected',        button_ids: {            small: 'resize-small',            medium: 'resize-medium',            large: 'resize-large'        },        font_sizes: {            small: '14px',            medium: '14.9px',            large: '15.5px'        },        smalltype_sizes: {            small: '10px',            medium: '11.5px',            large: '13px'        },        resizable_container: 'body',        resizable_selectors: [],        smalltype_selectors: []    };        var config = {};        var configure = function(options) {        jQuery.extend(config, default_config, options);        $('#'+config.button_ids.small).click(function() {            set_active_style('small', {reset: true, animate: true});            return false;        });        $('#'+config.button_ids.medium).click(function() {            set_active_style('medium', {reset: true, animate: true});            return false;        });        $('#'+config.button_ids.large).click(function() {            set_active_style('large', {reset: true, animate: true});            return false;        });                load_default_style();    };        var highlight_resize_button = function(style_type) {        var highlightable_id = config.button_ids[style_type];        $(config.button_selector).each(function() {            var button = $(this);            button.removeClass(config.button_highlight_class);            if(this.id == highlightable_id)                button.addClass(config.button_highlight_class);        });    };        var set_active_style = function(style_type, options) {        options = jQuery.extend({reset: false, animate: true}, options || {});        var font_size = config.font_sizes[style_type],            small_font_size = config.smalltype_sizes[style_type],            selectors = config.resizable_selectors.join(', '),            small_selectors = config.smalltype_selectors.join(', ');                if(!options.animate || jQuery.browser.msie) {            $(config.resizable_container)                .find(selectors)                    .css({'font-size': font_size})                    .end()                .find(small_selectors)                    .css({'font-size': small_font_size})                    .end();        } else {            $(config.resizable_container)                .find(selectors)                    .animate({fontSize: font_size}, 500)                    .end()                .find(small_selectors)                    .animate({fontSize: small_font_size}, 500)                    .end();        }                if(options.reset)            jQuery.cookie('psize', style_type, {expires: 365, path: '/'});                highlight_resize_button(style_type);    };        var load_default_style = function() {        var style_type = jQuery.cookie('psize');        if((style_type == null) || (style_type == 'medium'))            highlight_resize_button('medium');        else            set_active_style(style_type, {reset: false, animate: false});    };    /* Exported Names */    return {        'configure': configure,        'configuration': config,        'set_active_style': set_active_style    };})(jQuery);/* jQuery.cookie */if(typeof jQuery.cookie == 'undefined') {  /*   * @name $.cookie   * @cat Plugins/Cookie   * @author Klaus Hartl/klaus.hartl@stilbuero.de   */  jQuery.cookie = function(name, value, options) {      if (typeof value != 'undefined') { // name and value given, set cookie          options = options || {};          if (value === null) {              value = '';              options.expires = -1;          }          var expires = '';          if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {              var date;              if (typeof options.expires == 'number') {                  date = new Date();                  date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));              } else {                  date = options.expires;              }              expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE          }          var path = options.path ? '; path=' + options.path : '';          var domain = options.domain ? '; domain=' + options.domain : '';          var secure = options.secure ? '; secure' : '';          document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');      } else { // only name given, get cookie          var cookieValue = null;          if (document.cookie && document.cookie != '') {              var cookies = document.cookie.split(';');              for (var i = 0; i < cookies.length; i++) {                  var cookie = jQuery.trim(cookies[i]);                  // Does this cookie string begin with the name we want?                  if (cookie.substring(0, name.length + 1) == (name + '=')) {                      cookieValue = decodeURIComponent(cookie.substring(name.length + 1));                      break;                  }              }          }          return cookieValue;      }  };  }function getLinkImage(tp){	var classType = "";	switch (tp)	{		case "pdf":			classType = "pdf";			break;		case "doc":			classType = "word";			break;		case "pps":			classType = "powerpoint";			break;		case "ppt":			classType = "powerpoint";			break;		case "xls":			classType = "spreadsheet";			break;		case "docx":			classType = "word";			break;		case "pptx":			classType = "powerpoint";			break;		case "xlsx":			classType = "spreadsheet";			break;		case "txt":			classType = "text";			break;		case "rtf":			classType = "text";			break;		case "mpg":			classType = "video";			break;		case "wmv":			classType = "video";			break;		case "mpeg":			classType = "video";			break;		case "jpg":			classType = "image";			break;		case "jpeg":			classType = "image";			break;		case "gif":			classType = "image";			break;		case "png":			classType = "image";			break;		case "zip":			classType = "zip";			break;		case "exe":			classType = "text";			break;		case "pub":			classType = "text";			break;	}	return classType;}function hdrDetails(i, elm, cl, tp) {        cl = cl/1024;  //divide content-length by 1024 (KB)    var sz = cl>1024?"MB":"KB";  //if cl is still big, set to MB        cl = cl>1024?cl/1024:cl;  //if cl is still big, divide again    var len = $(elm).eq(i).text().length;  //check the link's text length	var typeClass = "filetype_" + getLinkImage(tp);    if(len > 0) {        //add a file size        $(elm).eq(i).after("<span class='" + typeClass + "'> ("+cl.toFixed(2)+" "+sz+")</span>");    }}/* open/close menus */$(document).ready(function(){  //hide the all of the element with class msg_body  $(".msg_body").hide();  //toggle the componenet with class msg_body  $(".msg_head").click(function()  {    $(this).next(".msg_body").removeClass("togglebutton_open").slideToggle(200);	//$(this).next(".togglebutton span").toggleClass('togglebutton_closed').toggleClass('togglebutton_open');	$(this).children(".togglebutton").children("span").toggleClass('togglebutton_closed').toggleClass('togglebutton_open');	var tmpTxt = $(this).children(".togglebutton").children("span").text();	if (tmpTxt.search(/Open:/ig) >= 0)	{		$(this).children(".togglebutton").children("span").text("Close:");		//$(".msg_body").addClass("toggle			}	else	{		$(this).children(".togglebutton").children("span").text("Open:");	}	  });      //////////////////////////////////////////////////////////////////////////////START: SHOW ALL HIDE ALL CODE//////////////////////////////////////////////////////////////////////////////////////////////////Jason Gay, NMCPHC - 02APR10///////////////////////////////////////////////////////////////////////////////////	$(".show_all").click(function(){	$(".msg_body").not(".togglebutton_open").slideDown(200).addClass("toggle_all_open");	$(".msg_head").children(".togglebutton").children("span").text("Close:").removeClass("togglebutton_closed").addClass("togglebutton_open");	});		$(".hide_all").click(function(){	$(".msg_body").removeClass("toggle_all_open").slideUp(200);	$(".msg_head").children(".togglebutton").children("span").text("Open:").removeClass("togglebutton_open").addClass("togglebutton_closed");	});////////////////////////////////////////////////////////////////////////////////////END: SHOW ALL HIDE ALL/////////////////////////////////////////////////////////////////////////////      $(function() {	  var elm="a[href$='.pdf'],"+ //only the file types we want			  "a[href$='.doc'],"+			  "a[href$='.ppt'],"+			  "a[href$='.xls'],"+			  "a[href$='.txt'],"+			  "a[href$='.rtf'],"+			  "a[href$='.mpg'],"+			  "a[href$='.mpeg'],"+			  "a[href$='.jpg'],"+			  "a[href$='.jpeg'],"+			  "a[href$='.gif'],"+			  "a[href$='.png'],"+			  "a[href$='.zip'],"+			  "a[href$='.pub'],"+			  "a[href$='.pps'],"+			  "a[href$='.exe'],"+			  "a[href$='.wmv'],"+			  "a[href$='.docx'],"+ //don't forget 2007 versions			  "a[href$='.pptx'],"+			  "a[href$='.xlsx']";	  $(elm).each(function(i, e) {		  if (e.hostname && e.hostname == location.hostname) {			  $.ajax({				  type: "HEAD",				  url: $(this).attr("href"),				  complete: function(xhr, textStatus) {					  var cl=xhr.getResponseHeader("content-length");					  //var tp=xhr.getResponseHeader("content-type");					  var tp;					  tp = e.toString();					  tp = tp.substring(tp.lastIndexOf('.')+1,tp.length);					  if(textStatus=="success") {						  var cl=xhr.getResponseHeader("content-length");						  hdrDetails(i, elm, cl, tp); //call the calculation fn					  }else{						  $(elm).eq(i).after("<span> (file not found)</span>");					  }				  }			  });		  }	  });	  // Add email icons to email links	  $("a[href^='mailto:']").addClass("linktype_email");  	  //Add external link icon to external links - 	  $('a').filter(function() {		  //Compare the anchor tag's host name with location's host name		  return this.hostname && this.hostname !== location.hostname;		}).addClass("linktype_external");    });});/* Breadcrumbs via javascript */function breadcrumbs(){  sURL = new String;  bits = new Object;  var x = 0;  var stop = 0;  var output = "<a href=\"/\">Home</a>  &#187;  ";  sURL = location.href;  sURL = sURL.slice(8,sURL.length);  chunkStart = sURL.indexOf("/");  sURL = sURL.slice(chunkStart+1,sURL.length)  while(!stop){    chunkStart = sURL.indexOf("/");    if (chunkStart != -1){      bits[x] = sURL.slice(0,chunkStart)      sURL = sURL.slice(chunkStart+1,sURL.length);    }else{      stop = 1;    }    x++;  }  for(var i in bits){    output += "<a href=\"";    for(y=1;y<x-i;y++){      output += "../";    }    output += bits[i] + "/\">" + bits[i] + "</a>  &#187;  ";  }  document.write(output + document.title);}
