/**
 * annabest.js
 * JavaScript for annabest.info
 * @author Peter Edwards <tech@e-2.org>
 * @uses Google Javascript API
 */

/* load jQuery */
google.load("jquery", "1.3.2");
/* load swfObject */
google.load("swfobject", "2.1");
/* when it's all here */
google.setOnLoadCallback(function() {
  /* initialise images */
  $(".images a").slimbox({'overlayOpacity':0.3});
  /* initialise swfs */
  $(".music li").each(function(){
	 var musicUrl = $("a", this).attr("href");
	 var targetId = $("span", this).attr("id");
	 var title = $.trim($(this).text().replace(/\[download mp3 file\]/, ''));
	 swfobject.embedSWF(musicPlayer_url+'?song_url='+musicUrl, targetId, "17", "17", "6");
  });
  $(".video li").each(function(){
	var videoUrl = $("a", this).attr("href");
	var targetId = $("span", this).attr("id");
	var params = {
	  menu: "false",
	  allowscriptaccess: "always",
	  flashvars: "&file="+videoUrl
	};
	swfobject.embedSWF(videoPlayer_url, targetId, "320", "300", "6", false, params);
  });
});
