// configuration variables// reuseable functions	function careers_flash(){		swfobject.embedSWF("/www/website.nsf/widget.swf", "careers-flash", "704", "390", "9.0.0", "/www/website.nsf/expressInstall.swf");	}// jQuery application$(document).ready(function(){	$('body').addClass('with-javascript');	// fix heights on split column nested rounded corner units	$('div.cols2,div.cols2-1,div.cols1-2').each(function(){		if($('div.col1 div.rounded',this).height() > $('div.col2 div.rounded',this).height()){			$('div.col2 div.rounded',this).css('height',$('div.col1 div.rounded',this).height()+'px');		}else if($('div.col2 div.rounded',this).height() > $('div.col1 div.rounded',this).height()){			$('div.col1 div.rounded',this).css('height',$('div.col2 div.rounded',this).height()+'px');		}else if($('div.col2',this).height() > $('div.col1',this).height()){			$('div.col1 div.rounded',this).css('height',$('div.col2 div.rounded',this).height()+'px');		}	});	// adjust column heights if necessary 	if(($('#left-rail').height() || $('#right-rail').height()) > $('#contentmain').height()){		var mod_height = 0;		if($('#left-rail').height()>$('#right-rail').height()){			mod_height = $('#left-rail').height();		}else{			mod_height = $('#right-rail').height();		}		mod_height += 50;		$('#contentmain').css('height',mod_height+'px');	}	// add a class to the first and last LI in any OL or UL	$('ul,ol').each(function(){		$('li:last',this).addClass('last');		$('li:first',this).addClass('first');	});	// self-submitting form pieces.	$('form .self-submit').change(function(){		$(this).parents('form')[0].submit();	});	// rounded corners	var is_oldIE = false;	if($.browser.msie){		if($.browser.version < 7){			is_oldIE = true;		}	}	if(!is_oldIE){		$('div.rounded').corner('5px');		$('div.group').corner('5px');		}	// zebra lists	$('ul.zebra').each(function(){		$('li:nth-child(odd)',this).addClass('odd');	});	// pretty dividers	$('hr').wrap('<div class="hr"></div>');	// form field highlighting	$('.field-text').focus(function(){		$(this).removeClass('field-text').addClass('field-text-active');	});	$('.field-text').blur(function(){		$(this).removeClass('field-text-active').addClass('field-text')	});	// "auto empty and fill" login fields.	$('div.formfield label').click(function(){		$(this).hide();		$(this).parents('div.formfield').find('input')[0].focus();	});	$('div.formfield input').focus(function(){		$(this).parents('div.formfield').find('label').hide();	});	$('div.formfield input').blur(function(){		if($(this).val()==''){			$(this).parents('div.formfield').find('label').show();		}	});	$('div.formfield input').each(function(i){		if($(this).val() != ''){			$(this).parents('div.formfield').find('label').hide();		}	});	// apply styles to login form	$('div.formfield input').niceforms();	// add flash 	if($('#careers-flash')[0]){		careers_flash();	}		// search form focus/blur	$('#search-form2 input').focus(function(){		if ($(this).val() == "Search") {			$(this).val("");		}	});	$('#search-form2 input').blur(function(){		if ($(this).val() == "") {			$(this).val("Search");		}	});});// Cookie-handling routines.function SetCookie(NameOfCookie, value, expiredays) {	var ExpireDate = new Date ();	if (value != '') {		value = value.replace (/\s\s+/g, ' ');		if (value.length > 32) {			var dispname = NameOfCookie;			if (dispname.substr(0,2).toLowerCase() == "ta")				dispname = dispname.substr(2, dispname.length - 2);			alert("Your " + dispname + " must be no more than 32 characters. Please select all characters in your " + dispname + " and retype it; you may have extra characters that aren't visible.");			return false;		} else {			ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));			document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString())+ "; path=/";			return true;		}	} else {		return false;	}}// Copied from private.js.// Added to simplify cleaning up title AND alt. 11-21-2011.function cleanCapHTML(cap) {	var findre = new RegExp ("&lt;br&gt;", "gi");	cap = cap.replace (findre, '<br>');	findre = new RegExp ("&lt;i&gt;", "gi");	cap = cap.replace (findre, '<i>');	findre = new RegExp ("&lt;/i&gt;", "gi");	cap = cap.replace (findre, '</i>');	return cap;}// Added to simplify cleaning up title AND alt. 11-21-2011.function removeCapHTML(cap) {	var findre = new RegExp ("<br>", "gi");	cap = cap.replace (findre, ', ');	findre = new RegExp ("</?i>", "gi");	cap = cap.replace (findre, '');	return cap;}// FROM ORIGINAL TAWS: ADDED TO REDESIGN 07-09-2009function captionizeImages() {	if (!document.getElementsByTagName) return false;	if (!document.createElement) return false;	var images = document.getElementsByTagName('img');	if (images.length < 1) return false; 	for (var i=0; i<images.length; i++) {		if (images[i].className == 'tacappic') {			var title = images[i].getAttribute('title');			// Added alt below 11-21-2011.			var alt = images[i].getAttribute('alt');			var divCaption = document.createElement('div');			divCaption.className = 'tapiccaption';			// Changed 08-13-2009 to allow for Tax Dir br elements. Added ital 11-21-2011.			//var divCaption_text = document.createTextNode(title);			//divCaption.appendChild(divCaption_text);			var divCaption_text = document.createTextNode("");			divCaption.appendChild(divCaption_text);/* Functionized 11-21-2011.			// Clean up title for Tax Directory.			var findre = new RegExp ("&lt;br&gt;", "gi");			title = title.replace (findre, '<br>');			// Clean up title for italics.			findre = new RegExp ("&lt;i&gt;", "gi");			title = title.replace (findre, '<i>');			findre = new RegExp ("&lt;/i&gt;", "gi");			title = title.replace (findre, '</i>');*/			title = cleanCapHTML(title);			alt = cleanCapHTML(alt);			// Replace title.			divCaption.innerHTML = title;			// Now fix title & alt./*			findre = new RegExp ("<br>", "gi");			title = title.replace (findre, ', ');			findre = new RegExp ("</?i>", "gi");			title = title.replace (findre, '');*/			title = removeCapHTML(title);			alt = removeCapHTML(alt);			images[i].title = title;			images[i].alt = alt;			// End of new 08-13-2009 code.			var divContainer = document.createElement('div');			divContainer.className='tapiccontainer';			divContainer.style.cssFloat = images[i].align;			divContainer.style.styleFloat = images[i].align;			// Add 4 to include 2-pixel border; can't rely on width attribute.			var width = parseInt (images[i].getAttribute ('width')) + 4;			if (! width)				width = parseInt (images[i].width) + 4;			divContainer.style.width = width + 'px';			images[i].parentNode.insertBefore(divContainer,images[i]);			divContainer.appendChild(images[i]);			divContainer.appendChild (divCaption);			images[i].align = '';		} else if (images[i].className == 'tapic') {			images[i].style.cssFloat = images[i].align;			images[i].style.styleFloat = images[i].align;		}	}}
