    function onYouTubePlayerReady(playerId) {
      ytplayer = document.getElementById("myytplayer");
    }


function WgNews(hs, ref) {
    WgEvents("009", ref); /* Articoli - Preview */
    $.get("__inc/NewsRead.php", {
        hash: hs,
		plusMin: 1,
		plusMax: 3
    }, function(data){
    });
}
function WgVideo(id, EventString, ref) {
    WgEvents(EventString, ref); /* PlayBackVideo 005 sintesi 004 Amarcord*/
    $.get("__inc/VideoPlay.php", {
        id: id,
		plusMin: 3,
		plusMax: 6
    }, function(data){
    });
}
function WgBNews(hs, ref){
    WgEvents("002", ref); /* Articoli - Lettura */
    $.get("__inc/NewsRead.php", {
        hash: hs,
		plusMin: 2,
		plusMax: 5
    }, function(data){
    });
}
function WgMiniNews(hs, ref){
    WgEvents("003", ref);  /* Articoli - Ultimissime */
    $.get("__inc/NewsRead.php", {
        hash: hs,
		plusMin: 1,
		plusMax: 4
    }, function(data){
    });
}
function WgEvents(Cat, Act){
    switch (Cat) {
        case "002":
            catString = "Articoli - Lettura";
            break;
        case "003":
            catString = "Articoli - Lettura (ultimissime)";
            break;
        case "004":
            catString = "Video - Amarcord Playback";
            break;
        case "005":
            catString = "Video - Sintesi Playback";
            break;
        case "006":
            catString = "Social - Facebook Share";
            break;
		case "009":
            catString = "Articoli - Preview";
            break;		
    }
    pageTracker._trackEvent(catString, Act);
}
function swap(url, dt, au, tit, rat) {
    $('img#Ythumb').attr("src", url);
    $("div#YthumbDt").html(dt + '<br/><br/>');
    $("div#YthumbTit").html(tit + '<br/>');
	$("div#YthumbAu").html(au);
		ratCode = "";
		for(c=1;c<=5;c++) {
			if(c<=rat) {
				ratCode += "<img src='__img/star.png'/>";
			} else {
				ratCode += "<img src='__img/starO.png'/>";
			}
		}
	$("div#YthumbRat").html(ratCode);
}
function WgFav(hash, mode){
    return false;
}
function WgFavOff(hash, mode){
    return false;
}

$(document).ready(function(){
    $('a.newslink').cluetip ({
        showTitle: true,
        titleAttribute: 'tip',
        width: 332,
        height: 300,
        positionBy: 'fixed',
        activation: 'click',
	    topOffset:  83,
	    leftOffset: -332,
    ajaxProcess: function(data) {
        data = $(data).not('style, meta, link, title');
        return data;
    }

    });
});
