function loadMoreLink(parent, splitStr, lastIndex) {
var ellipsestext = "";
var moretext = "+ View all";
var lesstext = "+ View less";
var element = $(parent);
var content = $(element).html();
var c, h = '';
h = '';
c = '';
$(content.split(splitStr)).each(function (index, value) {
if (index <= lastIndex) {
c += value + splitStr;
}
else {
h += value + splitStr;
}
});
var html = "" + c + "" + h + "" + moretext + "";
$(element).html('');
$(element).append(html);
$('#morelink').click(function () {
if ($('#expanded').css('display') == 'none') {
$('#expanded').css('display', '');
$(this).html(lesstext);
}
else {
$('#expanded').css('display', 'none');
$(this).html(moretext);
}
return false;
});
}