Behaviour.register(
{
    '#rating-form' : function(element) {
        new RatingHandler(element, Elements.getElementById("rating-content"));
    },
	/*
    'div.numberOfViews' : function(element) {
        new NumberOfViews(Meta.getContent("videoClipId"));
    },*/

    'div#videoClipPlayer' : function(element) {
        var flashVars = { };
        var params = {quality  :"best",
            bgcolor:"#000000",
            allowFullScreen:"true",
            allowScriptAccess:"always",
            wmode:"transparent"};
        swfobject2.embedSWF("/bigbrother/static/swf/video_page_player.swf",
                element.id, "412", "254", "9.0.115",
                "/bigbrother/static/swf/expressInstall.swf", flashVars, params);
    },
    'div#testvideoClipPlayer' : function(element) {
        var flashVars = { };
        var params = {quality  :"best",
            bgcolor:"#000000",
            allowFullScreen:"true",
            allowScriptAccess:"always",
            wmode:"transparent"};
        swfobject2.embedSWF("/bigbrother/static/swf/videotest/video_page_player.swf",
                element.id, "412", "254", "9.0.115",
                "/bigbrother/static/swf/expressInstall.swf", flashVars, params);
    },    
     'div#homeVideoPlayer' : function(element) {
        var flashVars = { };
        var params = {quality  :"best",
            bgcolor:"#000000",
            allowFullScreen:"true",
            allowScriptAccess:"always",
            wmode:"opaque"};
        swfobject2.embedSWF("/bigbrother/static/swf/home_page_player.swf",
                element.id, "412", "254", "9.0.115",
                "/bigbrother/static/swf/expressInstall.swf", flashVars, params);
    },
    'span#viewCount' : function(element){
		var callback=function(data){
			if(data.playsTotal=="null" || data.playsTotal == null){
				element.style.display="none";
				return;
			}
			element.innerHTML+=data.playsTotal;
		};
		var totalPlays = new C4BrightcoveAPI();
		totalPlays.ref_id=element.className;
		totalPlays.callback = callback;
		totalPlays.call();
    } 
    
});