// Videos

$(document).ready(function(){
$("#downscreencast").hide();
$("#media_end").append('<div id="watch" class="ws"><a class="press" href="javascript:;"><img src="http://kadampafestivals.org/images/diaries/fall-2009/play_small.gif" /> Watch Today\'s Review</a></div>');
$("#media_end").append('<div id="close" class="ws"><a class="close" href="javascript:;">Close</a></div>');
$("#close").hide();

$("a.press").click(function(){
   $("#feature_images").fadeOut("slow", function(){
   $("#close").show().fadeIn("slow", function(){$("#watch").hide();});
   $("#masthead")
   .addClass("mhbg");
   $("#mastheadext")
   .removeClass("mhhide")
   .addClass("mhshow")
   .slideDown("slow", function(){
                  var scast = new SWFObject("http://kadampafestivals.org/embed/monoslideshow.swf", "scHtmlTags", "640px", "480px", "8", "#000000");
                  scast.addParam("quality", "high");
                  scast.addParam("loop", "false");
                  scast.addParam("allowScriptAccess", "sameDomain");
                  scast.addParam("menu", "false");
                  scast.addParam('flashvars','&dataFile=http://kadampafestivals.org/2009/fall-gallery/10145677_gXk2L/&showRegistration=false&showLogo=false');
                  $("#content").append('<div id="feature_video"></div>');
                  scast.write("feature_video");
                  });
   });
               });
$("a.close").click(function(){
      $("#watch").fadeIn("slow", function(){$("#close").hide();});
      var emptymovie = new SWFObject("http://kadampafestivals.org/embed/monoslideshow.swf", "scHtmlTags", "760px", "475px", "8", "#000000");
      emptymovie.write("feature_video");
      $("#feature_video").remove();

     $("#mastheadext")
     .removeClass("mhshow")
     .addClass("mhhide")
     .slideUp("slow", function(){$("#feature_images").fadeIn("slow");});
            });
});