$(document).ready(function() {
		$("#blog-tabs").tabs();
		$("#pop-tabs").tabs();
		$("#other-tabs").tabs();

      $("#pageid-help .index-page-list li").each(function (index) {
          $(this).html($(this).html().replace('Health Affairs','<span class="health-affairs">Health Affairs</span>'));
      });

	
/*.proxy-archive-by-year .archive-issue-title: script to display longer title having more than 25 characters in alt/textpopup and added ellipses after 25th character .*/ 

/*.proxy-archive-range .archive-issue-title: script to add line break after three words per line and if 2nd line exceed more than 3words added ellipses .*/ 

$(".proxy-archive-by-year .archive-issue-title").each (function () {
var str=$(this).attr('title');
var myhtml = $(this).text();
var length = 25;
if (myhtml.length > length) { 
//var newhtml =myhtml.substr(0,length);	
$(this).html((myhtml.substr(0,length))  + "... ");
}
});

$(".proxy-archive-range .archive-issue-title").each (function () {
var t = $(this).attr("title");
var w = t.split (" ");
if (w.length) {
 var l1 = "";
 var l2 = "";
 l1 = (w[0])?w[0]:"";
 l1 += (w[1])?" " + w[1]:"" 
 l1 += (w[2])?" " + w[2]:"";
if(w.length > 3) {
 l2 = (w[3])?w[3]:"";
 l2 += (w[4])?" " + w[4]:"" 
 l2 += (w[5])?" " + w[5]:"";
 l2 += (w[6])?" ... " : "";
}
var    l  = l1 + "<br/>" + l2;
}
$(this).html (l);

});
});
