    $.tablesorter.addParser({
//         set a unique id
        id: 'html',
        is: function(s) {
        	//return false so this parser is not auto detected
        	return false;
        },
        format: function(s) {
        	//format your data for normalization
         	return strip_tags(s); //round(parseFloat($s)*100)/100;
         },
//        set type, either numeric or text
        type: 'numeric'
//        type: 'text'
    });
    $.tablesorter.addParser({
//         set a unique id
        id: 'score',
        is: function(s) {
        	//return false so this parser is not auto detected
        	return false;
        },
        format: function(s) {
        	//format your data for normalization
        	if ( s.length == 0) return 0;
        	if ( s.indexOf('*') != -1 ) {
        		return get_stars_value(s);
			}
        	if ( (s.indexOf('R') != -1) || (s.indexOf('C') != -1) ) {
        		return get_rvf_value(s);
			}
        	s = s.replace(/,/g,".");
//        	s = s.replace(/[+\?\(\)]+|-$/g,"");
//			var c = s.charAt(s.length-1);
			var d = delta(s);
        	s = s.replace(/[*+?()]+|-+$/g,"");
			var r = avg(s);
//			if (c == '+') {
//				r += 0.01;
//			}
//			else if (c == '-') {
//				r -= 0.01;
//			}
			return r + d;
         },
//        set type, either numeric or text
        type: 'numeric'
//        type: 'text'
    });
    $.tablesorter.addParser({
//         set a unique id
        id: 'year',
        is: function(s) {
        	//return false so this parser is not auto detected
        	return false;
        },
        format: function(s) {
        	//format your data for normalization
        	if ( (s.length == 0) || (s === "NV")) return 0;
			return s;
         },
//        set type, either numeric or text
        type: 'numeric'
//        type: 'text'
    });
    $.tablesorter.addParser({
//         set a unique id
        id: 'numX',
        is: function(s) {
        	//return false so this parser is not auto detected
        	return false;
        },
        format: function(s) {
        	//format your data for normalization
         	if ( s.length == 0) return 0;
			return parseFloat(s.replace(/^\(|\)$/g,""));  //round(parseFloat($s)*100)/100;
         },
//        set type, either numeric or text
        type: 'numeric'
//        type: 'text'
    });
    $.tablesorter.addParser({
//         set a unique id
        id: 'textX',
        is: function(s) {
        	//return false so this parser is not auto detected
        	return false;
        },
        format: function(s) {
        	//format your data for normalization
        	if ( (s==null) || (s.length == 0)) return "";//"~";
        	s = s.toUpper();
        	s = s.replace('"','');
        	s = s.replace(/^[LD][EAU]S*[\s_]+|^[LD]'/g, "");
            return s;
         },
//        set type, either numeric or text
//        type: 'numeric'
       type: 'text'
    });

    function avg(s) {
        var a = s.split( "|" );
        var s = n = 0;
		for (var key in a) {
    		var t = _avg(a[key]);
    		if ( t ) {
     			s += t;
    			n++;
			}
	    }
		return (n) ? (s / n) : s;
    }

    function _avg(s) {
        var a = s.split( /[\/\-]/ );
       	var t = (a.length == 2) ? (parseFloat(a[0])+parseFloat(a[1]))/2 : parseFloat(a[0]);
        return t;
    }

    function get_stars_value(s) {
        var a = s.split( "|" );
        var s = n = 0;
		for (var key in a) {
    		var t = _get_stars_value(a[key]);
    		if ( t ) {
     			s += t;
    			n++;
			}
	    }
		return (n) ? (s / n) : s;
    }

    function _get_stars_value(s) {
    	return  ( s.indexOf('(') == -1) ? s.length : s.length - 2.5;
    }

	function get_rvf_value(s) {
	    if ( (s == 'ER') || (s == 'RE') )
	    	return 17;
	    if ( s == 'GR' )
	    	return 16;
        if ( s == 'CC' )
        	return 17.5;
	    return 15;
	}

	function delta(s) {
		var c;
		var d = 0.0;
		for( var i=s.length-1; i>=0; i--){
			c = s.charAt(i);
		    if ( c == '+' ) {
		    	d += 0.01;
			}
			else if (c == '-') {
				d -= 0.01;
			} else {
				break;
			}
		}

	    return d;
	}

function strip_tags (str, allowed_tags) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Luke Godfrey
    // +      input by: Pul
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Onno Marsman
    // +      input by: Alex
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: Marc Palau
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Eric Nagel
    // +      input by: Bobby Drake
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Tomasz Wesolowski
    // *     example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i><b>');
    // *     returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'
    // *     example 2: strip_tags('<p>Kevin <img src="someimage.png" onmouseover="someFunction()">van <i>Zonneveld</i></p>', '<p>');
    // *     returns 2: '<p>Kevin van Zonneveld</p>'
    // *     example 3: strip_tags("<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>", "<a>");
    // *     returns 3: '<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>'
    // *     example 4: strip_tags('1 < 5 5 > 1');
    // *     returns 4: '1 < 5 5 > 1'

    var key = '', allowed = false;
    var matches = [];
    var allowed_array = [];
    var allowed_tag = '';
    var i = 0;
    var k = '';
    var html = '';

    var replacer = function (search, replace, str) {
        return str.split(search).join(replace);
    };

    // Build allowes tags associative array
    if (allowed_tags) {
        allowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);
    }

    str += '';

    // Match tags
    matches = str.match(/(<\/?[\S][^>]*>)/gi);

    // Go through all HTML tags
    for (key in matches) {
        if (isNaN(key)) {
            // IE7 Hack
            continue;
        }

        // Save HTML tag
        html = matches[key].toString();

        // Is tag not in allowed list? Remove from str!
        allowed = false;

        // Go through all allowed tags
        for (k in allowed_array) {
            // Init
            allowed_tag = allowed_array[k];
            i = -1;

            if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}
            if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}
            if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag)   ;}

            // Determine
            if (i == 0) {
                allowed = true;
                break;
            }
        }

        if (!allowed) {
            str = replacer(html, "", str); // Custom replace. No regexing
        }
    }

    return str;
}

