// JavaScript Document

document.write(unescape("%3Cscript src='" + (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js' %3E%3C/script%3E"));

var comscoreBeaconCount = false;

function playerTracker(url) {

	var serverName = document.domain;
	
	/* Blue Metrix */
	if (typeof getBMqs != "undefined") {
		getBMqs(serverName + url, '', '', 'rte_ie', 'ie', 'UTF-8','');

	}

	/* comScore */
	if (typeof COMSCORE != "undefined") {
		COMSCORE.beacon({c1:2, c2:"642257", c3:"RTE", c4:serverName + url, c5:"player", c6:"", c15:""});
		comscoreBeaconCount = false;
	}

}



function onPlayerStateChanged(state){
	var comScoreUrl = document.location.host + document.location.pathname;
	/* if starts playing && hasn't counted hit yet */
	if (state == 16 && comscoreBeaconCount == false) {
		comscoreBeaconCount = true;
		COMSCORE.beacon({
			c1:1,
			c2:"642257",
			c3:"RTE",
			c4:comScoreUrl,
			c5:"playerPlay",
			c6:"",
			c15:""
		});	
	} /* resets after clip finishes so will count another hit if you start playing again */
	else if (state == 4 && comscoreBeaconCount == true) {
		comscoreBeaconCount = false;
	}
}

