    var lastDiv=0;
    var lastExtension="";

    function writeSWF() {
      document.write("<object id='zoomSWF' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' height='393' width='520'>");
      document.write("<param name='src' value='/gallery.swf'/>");
      document.write("<param name='wmode' value='transparent'/>");
      document.write("<embed name='zoomSWF' wmode='transparent' src='/gallery.swf' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' height='393' width='520'/>");
      document.write("</object>");
    }

    function getSWF() {
      if (navigator.appName.indexOf("Microsoft") != -1) {
        return document.getElementById("zoomSWF");
      } else {
        return document["zoomSWF"];
      }
    }

    function show(id,extension,filename) {
      if (lastDiv!=0) {
        if (lastExtension=="flv") {
			loadMovie("");
			document.getElementById("divSWF").style.visibility="hidden";
			document.getElementById("divSWF").style.height="0px";
        } else {
          document.getElementById("div" + lastDiv).style.display="none";
          document.getElementById("thumbnail" + lastDiv).className="";
        }
      }

      lastDiv=id;
      lastExtension=extension;

      if (extension=="flv") {
		document.getElementById("divSWF").style.visibility="visible";
		document.getElementById("divSWF").style.height="";
		loadMovie(unescape(filename));	
      } else {
        document.getElementById("div" + lastDiv).style.display="block";
        document.getElementById("thumbnail" + lastDiv).className="current";
      }

      return false;
    }

	function loadMovie(filename) {
		if (getSWF() && getSWF().sendToActionScript) {
			getSWF().sendToActionScript(filename);
		} else {
			setTimeout("loadMovie('"+filename+"')",100);
		}
	}