/* JAVASCRIPT PARA NIELSEN 
 *
 *    All non-changing parameters (for tagging) are hard coded as shown below
 *                   
 *    Other parameters such as streamname, frequency and url are dynamically assigned using JS
 **/
                    
var scCI = "es-antena3tv";
var scCG = "0";
//var scTL = "";
var scSI = "";

var scCustom = new Array(); 
scCustom[0] = "";
scCustom[1] = "";
scCustom[2] = "";
scCustom[3] = "";

var scFreq = "";
var scUrl = "";

//Appropriate media file loaded in this function
function loadFrom() {
	var url = $('#videoFrame').attr('name');

	if ($('#videoFrame').size() == 1){
	    scUrl = url;	// ruta completa del video
	    scSI = "http://www.ondacero.com";		// contenedor del video
	    
	    nomFichero = url.substr(url.lastIndexOf('/')+1); //quitamos ruta
	    nomFichero = nomFichero.substr(0, nomFichero.indexOf('.')); // quitamos extension
	    
	    scTL = nomFichero; // nombre del video
	
	    scFreq = 7200; // frecuencia de los ping en segs. (llamadas dav1-...)
		//$('#videoFrame').css({'border':'1px solid red'})
		$('#videoFrame').attr('src','commonPages/components/visor/iframe-nielsen.jsp')
//		frames['videoFrame'].location.href='';
	  }
} 
 
function _nnEventTrack(_nnClickURL) {	
	var _nnCI = "es-antena3tv";
	var _nnCG = "0";
	var _nnCC = "uk"; /* country code */
	var _nnLP = location.protocol.indexOf('https')>-1?'https:':'http:';
	var _nnRP = escape(window.location);
	var _nnND = _nnLP + '//secure-' + _nnCC + '.imrworldwide.com/';
	var _nnPixel = new Image(1,1);
	var _nnParams = "rnd=" + (new Date()).getTime() + "&ci=" + _nnCI + "&cg=" + _nnCG;
	_nnParams += "&si=" + escape(_nnClickURL) + "&rp=" + _nnRP;	
	//alert(_nnParams);
	_nnPixel.src = _nnND + "cgi-bin/m?" + _nnParams;
}              