var nodeIsPlaying = false;
var songinfos = {};

function showFacebookDialog(voteInfo){
	if(songinfos == undefined) {
		conf = songinfos['s' + voteInfo.id];
		conf["user_message"] = "Alles wird richtigü& gut";
		conf["user_message_prompt"] = 'Berichte über deine Bewertung!';
	//	console.log(conf);
	
		//FB.Connect.streamPublish(conf["user_message"], conf["attachment"], [conf["action_links"]], null, conf["user_message_prompt"], null, null, null);

	
		// 
		 FB.ui(conf, function(response) {
		      if (response && response.post_id) {
		       // alert('Post was published.');
		      } else {
		        //alert('Post was not published.');
		      }
		    });
	}	
}

function playSong(obj) {

//	console.log($(obj).attr('rel'));
//	if (nowPlaying) {
//		nowPlaying.click();
//	};
//				nowPlaying = $(obj);
	
		me = $(obj);
	
		if (nodeIsPlaying) {
			nodeIsPlaying = false;
			$("#node-song-player").jPlayer("stop");
			me.removeClass('stop');
			me.blur();
		}
		else {
			 nodeIsPlaying = true;
			$("#node-song-player").jPlayer({
					ready: function () {
						$('#node-song-player').jPlayer("setFile", me.attr('rel')).jPlayer("play");
						me.addClass('stop');
					},
					customCssIds: true,
					errorAlerts : true,
				 	random: false,
					swfPath: "http://sommerhit.fleurop.de/sites/all/res"
				})

		}
	
	
	


//		nowPlaying.blur();
//		nowPlaying.addClass('stop');

	return false;
}
