

$(document).ready(function(){
  $('a[@href^="http://www.vimeo.com"]').flash(
  { width: 400, height: 302 },
  { version: 8 },
  function(htmlOptions){
    $this = $(this);
    var parent = $this.parent();
    var url_arr = $this.attr('href').split("/");
    var url_arr_size = url_arr.length;
    htmlOptions.allowfullscreen = "true";
    htmlOptions.allowscriptaccess = "always";    
    htmlOptions.src = "http://vimeo.com/moogaloop.swf";
    htmlOptions.src += "?clip_id="+url_arr[url_arr_size - 1]+"&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=&amp;fullscreen=1";
    parent.empty();
    parent.append($.fn.flash.transform(htmlOptions));
  });

  $('a[@href^="http://www.youtube.com"]').flash(
  { width: 400, height: 302 },
  { version: 8 },
  function(htmlOptions) {
      $this = $(this);
      var parent = $this.parent();
      htmlOptions.src = $this.attr('href');
      parent.empty();
      parent.append($.fn.flash.transform(htmlOptions));
  });

  $('a[@href$="mp3"]').flash(
			     { src: 'http://'+WEB_ROOT+PUBLIC_DIR+'/singlemp3player.swf', height: 20, width: 100 },
			     { version: 7 },
			     function(htmlOptions) {
				 $this = $(this);
				 var parent = $this.parent();
				 htmlOptions.flashvars.file = $this.attr('href');
				 parent.empty();
				 parent.append($.fn.flash.transform(htmlOptions));
			     
			     });


});