

function titleAndStar(totalPosts, score, isMod, isAdmin, customTitle, customPic, imgID, titleID, imgID2, titleID2) {

    var title;
    var star;
    var separator = String.fromCharCode(1);
	
    if (score==null||score=="") score=0;
	
    if (isMod){
	    title = userLevelNameMod;
	    star = modStar;
    }
    if(isAdmin){
	    title = userLevelNameAdmin;
	    star = adminStar;
    }
    if (typeof title == 'undefined' && strTitle.length > 0) {
	    for (var i=1; i<strTitle.length ; i++){
		    var userL = strTitle[i].split(separator);
		    var evaluation = eval(totalPosts+"<="+userL[0]+userL[1]+score+"<="+userL[2]);
		    if (evaluation){
			    title = userL[3];
			    star = userL[4]+starPicSuffix;
			    break;
		    }
	    }
	    if (title==null){
		    title = strTitle[strTitle.length-1].split(separator)[3];
		    star =  strTitle[strTitle.length-1].split(separator)[4]+starPicSuffix;
	    }

    }
    if (customTitle!="") (title = customTitle);
    //if (customPic!="") (star = customPic);

    var $theImage = $('#' + imgID);
    var $theTitle = $('#' + titleID);

    var $theImage2 = $('#' + imgID2);
    var $theTitle2 = $('#' + titleID2);

    $theTitle.html((title) ? title : '');
    $theTitle2.html((title) ? title : '');

    if (customPic != "") {
        $theTitle.html(function (i, html) { return html += "<br /><img src=\"" + clientScriptPathInfo.ApplicationPath + "/image/" + customPic + "\" />" });
        $theTitle2.html(function (i, html) { return html += "<br /><img src=\"" + clientScriptPathInfo.ApplicationPath + "/image/" + customPic + "\" />" });
    }

    if (typeof star != 'undefined') {
        $theImage.attr('src', clientScriptPathInfo.ApplicationPath + "/image/" + star);
        $theImage2.attr('src', clientScriptPathInfo.ApplicationPath + "/image/" + star);
    }
    else {
        $theImage.hide();
        $theImage2.hide();
    }

}


