var tp_scripts = document.getElementsByTagName("script");
var tp_data_config = "";
for (var i = 0; i < tp_scripts.length; i++) {
var src = tp_scripts[i].src.split("/").pop();
match = src.match(/player_v_2\.js\?id\=([0-9]+)/);
if (match) {
tp_data_config = tp_scripts[i].getAttribute("data-config");
if (tp_data_config.length > 0) {
var placement = "bottom";
if (tp_data_config.indexOf(",'placement':'") != -1) {
placement = tp_data_config.substring(tp_data_config.indexOf(",'placement':'")+strlen(",'placement':'"));
placement = placement.substring(0, placement.indexOf("'"));
};
tp_init_str = "{'volume':"+tp_data_config.substring(tp_data_config.indexOf("'volume':'")+strlen("'volume':'"), tp_data_config.indexOf("'},"))+",'autoplay':"+tp_data_config.substring(tp_data_config.indexOf("'autostart':'")+strlen("'autostart':'"), tp_data_config.indexOf("','shuffle'"))+",'shuffle':"+tp_data_config.substring(tp_data_config.indexOf("'shuffle':'")+strlen("'shuffle':'"), tp_data_config.indexOf("','volume'"))+",'repeat':1,'placement':'"+placement+"','showplaylist':false,'playlist':["+tp_data_config.substring(tp_data_config.indexOf("'playlist':[")+strlen("'playlist':["), tp_data_config.indexOf("]"))+"]}";
var newPlayer = '';
document.write(newPlayer);
} else {
var newPlayer = '';
document.write(newPlayer);
}
}
};
function strlen(string) {
// example 1: strlen('Kevin van Zonneveld');
// returns 1: 19
// example 2: ini_set('unicode.semantics', 'on');
// example 2: strlen('A\ud87e\udc04Z');
// returns 2: 3
var str = string + '';
var i = 0,
chr = '',
lgth = 0;
if (!this.php_js || !this.php_js.ini || !this.php_js.ini['unicode.semantics'] || this.php_js.ini[
'unicode.semantics'].local_value.toLowerCase() !== 'on') {
return string.length;
}
var getWholeChar = function(str, i) {
var code = str.charCodeAt(i);
var next = '',
prev = '';
if (0xD800 <= code && code <= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters)
if (str.length <= (i + 1)) {
throw 'High surrogate without following low surrogate';
}
next = str.charCodeAt(i + 1);
if (0xDC00 > next || next > 0xDFFF) {
throw 'High surrogate without following low surrogate';
}
return str.charAt(i) + str.charAt(i + 1);
} else if (0xDC00 <= code && code <= 0xDFFF) { // Low surrogate
if (i === 0) {
throw 'Low surrogate without preceding high surrogate';
}
prev = str.charCodeAt(i - 1);
if (0xD800 > prev || prev > 0xDBFF) { //(could change last hex to 0xDB7F to treat high private surrogates as single characters)
throw 'Low surrogate without preceding high surrogate';
}
return false; // We can pass over low surrogates now as the second component in a pair which we have already processed
}
return str.charAt(i);
};
for (i = 0, lgth = 0; i < str.length; i++) {
if ((chr = getWholeChar(str, i)) === false) {
continue;
} // Adapt this line at the top of any loop, passing in the whole string and the current iteration and returning a variable to represent the individual character; purpose is to treat the first part of a surrogate pair as the whole character and then ignore the second part
lgth++;
}
return lgth;
}
document.write("");