function loadVideo(vsp,vid,title,date,summary,eid) {
  if (window.console) {console.debug(eid);}
  eid = typeof(eid) != 'undefined' ? eid : "player";
  if (window.console) {console.debug(eid);}

  var htmlFrag = '<iframe width="440" height="280" ';
  switch (vsp) {
    case "Vimeo":
      htmlFrag=htmlFrag+' src="http://player.vimeo.com/video/'+vid+'" ';
      break;
    case "YouTube":
      htmlFrag=htmlFrag+' src="http://www.youtube.com/embed/'+vid+'?wmode=transparent&fs=1" ';
      break;
    default:
      alert("Unknown video type.  Please contact Union Sportsmen.");
      return false;
  }
//  htmlFrag=htmlFrag+'frameborder="0"></iframe><div id="vidzInfo"><h1>'+title+'</h1><div class="caption"><p class="notes"><span class="date-display-single">'+date+'</span></p><p>'+summary+'</p></div><!--/.caption--></div> <!--/#vidzInfo -->';
  htmlFrag=htmlFrag+'frameborder="0"></iframe>';

  document.getElementById(eid).innerHTML = htmlFrag;
  return false;
}

$(document).ready(function() {
 // alert("WARNING:  This page is NOT production!");

  $("#vidzSearchForm").submit(function(event) {
        event.preventDefault();
        $.post($(this).attr("action"),$(this).serialize(),function(html) { $("#vidzBrowzList ul").replaceWith(html); },"html");
        $("#vidzBrowzPager").css("display","none");
         return false;
    });

   $(".vbox").delegate(".moreVidz","click",(function() {
      $(this).empty();
      $(this).prev().hasClass("open") ? $(this).append("Watch More Tecomate Videos") : $(this).append("Close videos");
      $(this).append("<span></span>");
      if (!$(this).prev().hasClass("open")) {$(this).children("span").addClass("open");}
      $(this).prev().toggleClass("open"); 

   }));
/*      //http://www.unionsportsmen.org/index.php/vidz/sections/brotherhood_outdoors/
*/
   $("#vidzShowAll").click(function() {
     $.post("http://www.unionsportsmen.org/index.php/videos/all","",function(html) { while(html.indexOf("/all/","/") != -1) {html=html.replace("/all/","/");} $("#vidzBrowzList").replaceWith(html); },"html");
   });

  $("#faqs dl").css("display","none");
  $("#faqs").click(function(){ (window.console ? console.log : alert)("Test"); $("#faqs dl").css("display","block"); });

});
