$(document).ready(function() {
  // Cury Corners object for text callouts.
  var objCorners = null;
  // Used to determine if the Curvy Corners class is present on the current page.
  var isClassPresent = false;
  // Settings for Curvy Corners.
  var settings = {
		tl: { radius: 10 },
		tr: { radius: 10 },
		bl: { radius: 10 },
		br: { radius: 10 },
		antiAlias: true,
		autoPad: true
	  }
   
  $('a.print').each(function() {
	$(this).click(function() { 
	  $('.questions li textarea, .questions li input:text').each(function() {
		$(this).replaceWith('<span class="text">' + (($(this).val() != '') ? $(this).val() : '&nbsp;') + '</span>');
	  });
	  window.print();
	});
  });
  
  $('div').each(function() {
	if($(this).hasClass('calloutbox')) {
	  isClassPresent = true;
	}
  });
  
  if(isClassPresent) {
	objCorners = new curvyCorners(settings, "calloutbox");
	objCorners.applyCornersToAll();	  
  }
	  
});

sfHover = function() {
	var sfEls = document.getElementById("lnav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);