//+ Jonas Raoni Soares Silva//@ http://jsfromhell.com/geral/utf-8 [v1.0]UTF8 = {    encode: function(s){        for(var c, i = -1, l = (s = s.split("")).length, o = String.fromCharCode; ++i < l;            s[i] = (c = s[i].charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) + o(0x80 | (c & 0x3f)) : s[i]        );        return s.join("");    },    decode: function(s){        for(var a, b, i = -1, l = (s = s.split("")).length, o = String.fromCharCode, c = "charCodeAt"; ++i < l;            ((a = s[i][c](0)) & 0x80) &&            (s[i] = (a & 0xfc) == 0xc0 && ((b = s[i + 1][c](0)) & 0xc0) == 0x80 ?            o(((a & 0x03) << 6) + (b & 0x3f)) : o(128), s[++i] = "")        );        return s.join("");    }}function maxArray( arr ) {	// this function calculates the maximum value in the associative array	var max = 0;	for(var i in arr){  	    if (arr[i] > max)  	    		max = arr[i];  	}  	return max;}function minArray( arr ) {	// this function calculates the minimum value in the associative array	var min;	var count = 0;	for(var i in arr){		// initialize minimum value with first value of associative array		if (count==0)			min = arr[i];		if (arr[i] < min)  	    		min = arr[i];  	    	count++;  	}  	return min;}function drawTagCloud(map, maxStyle) {	// this function draws the tag cloud using the associative javascript array generated by the Notes view	// calculate the maximum entries in the cloud. if not found, no tags are found	var maxEntries = maxArray(map);	if (maxEntries==0) {		document.write('No tags found');	}		//	calculate the minimum entries in the cloud	var minEntries = minArray(map);		// calculate the range	var range = maxEntries - minEntries;	if (range <= 0)		range = 1; 		// loop through the tag map to draw each tag.	for(var tag in map){  		drawTag(tag, map[tag], minEntries, maxEntries, maxStyle);  	}}function drawTag(tag, count, min, max, maxStyle) {  // this function renders a tag line. first determine  // the size tag to use for this tag count  sizeTag = Math.round((((maxStyle-1)/(max-min))*count) +(1*max-maxStyle*min)/(max-min));  tagOrig = unescape( tag.replace(/\ /g, " AND "));  // now write the link to the page  document.write('<a href=# onClick="mainNav.loadajaxpage(\'yaSrchNews?SearchView&Searchorder=3&Page=Srch&Start=1&Count=10&Query=(Field Title=(' + tagOrig +'))\');" class="tag' + sizeTag + '">' + tag + '</a> ');}function setCookie(name, value, expires, path, domain, secure) {  var curCookie = name + "=" + escape(value) +      ((expires) ? "; expires=" + expires.toGMTString() : "") +      ((path) ? "; path=" + path : "") +      ((domain) ? "; domain=" + domain : "") +      ((secure) ? "; secure" : "");  document.cookie = curCookie;}function getCookie(name) {  var dc = document.cookie;  var prefix = name + "=";  var begin = dc.indexOf("; " + prefix);  if (begin == -1) {    begin = dc.indexOf(prefix);    if (begin != 0) return null;  } else    begin += 2;  var end = document.cookie.indexOf(";", begin);  if (end == -1)    end = dc.length;  return unescape(dc.substring(begin + prefix.length, end));}function deleteCookie(name, path, domain) {  if (getCookie(name)) {    document.cookie = name + "=" +    ((path) ? "; path=" + path : "") +    ((domain) ? "; domain=" + domain : "") +    "; expires=Thu, 01-Jan-70 00:00:01 GMT";  }}function fixDate(date) {  var base = new Date(0);  var skew = base.getTime();  if (skew > 0)    date.setTime(date.getTime() - skew);}function trim(a) {	var tmp=new Array();	for( j=0; j<a.length; j++)		if( a[j] != '') tmp[tmp.length]=a[j];	a.length=tmp.length;	for( j=0; j<tmp.length; j++)		a[j] = validCharsOnly( tmp[j] );	return a;}function validCharsOnly( tmpString ) {	for (var i=0, output='', inValid=",.()[]{}/&#!\`^':;<>"; i < tmpString.length; i++)		if ( inValid.indexOf( tmpString.charAt(i)) == -1)			output += tmpString.charAt(i);	return output;}//Highlight scripts Modified by MI to only process newsContainer div - not whole Bodyfunction doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) {	// the highlightStartTag and highlightEndTag parameters are optional	if ((!highlightStartTag) || (!highlightEndTag)) {		highlightStartTag = "<font style='color:black; background-color:#FEFF90;'>";		highlightEndTag = "</font>";	}	var newText = "";	var i = -1;	regExp = /[\".*',:\(\);?]/g;	var srchStr = searchTerm.replace( regExp, '');	srchStr = srchStr.replace(/^\s*/, "").replace(/\s*$/, "");	var lcSearchTerm = srchStr.toLowerCase();	var lcBodyText = bodyText.toLowerCase();    	while (bodyText.length > 0) { 		i = lcBodyText.indexOf(lcSearchTerm, i+1);		if (i < 0) {			newText += bodyText;			bodyText = "";		} else {			// skip anything inside an HTML tag			if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {				// skip anything inside a <script> block				if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {					newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, srchStr.length) + highlightEndTag;					bodyText = bodyText.substr(i + srchStr.length);					lcBodyText = bodyText.toLowerCase();					i = -1;				}			}		}	}  	return newText;}function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag) {	if (treatAsPhrase) {		searchArray = [searchText];	} else {		searchArray = searchText.split(" ");	}	if (!document.getElementById("newsContainer") || typeof(document.getElementById("newsContainer").innerHTML) == "undefined") {		if (warnOnFailure) {			alert("Sorry, for some reason the text of this page is unavailable. Highlight will not work.");		}		return false;	}  	var bodyText = document.getElementById("newsContainer").innerHTML;	for (var i = 0; i < searchArray.length; i++) {		bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);	}  	document.getElementById("newsContainer").innerHTML = bodyText;	return true;}function showMsg(textString) {	overlib("<table style='width:1005px; height:100px; background-color:#E9E0D1; border-top:2px solid #bea376; border-bottom:2px solid #bea376;'><tr><td align=center><h2>" + textString + "</h2></td></tr></table>", FULLHTML, WIDTH, 1005, CENTERPOPUP, STICKY, TIMEOUT, 3000);}