﻿$(function() {
    SWF.$offoron();
    $("#a1").html(SWF.$swf());
    $("#c1").click(function() {
        $("#a1").toggle(500, function() { SWF.$offoron() });


    });
});
var SWF = {
    $swf: function() {

        $h = "";
        $h += ("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"100%\" height=\"100%\">");
        $h += ("  <param name=\"movie\" value=\"/flash/800_600.swf\" />");
        $h += ("  <param name=\"quality\" value=\"high\" />");
        $h += ("  <embed src=\"/flash/800_600.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"100%\" height=\"100%\" ></embed>");
        $h += ("</object>");
        return $h;
    },
    $offoron: function() {
        var h = $("#c1 b").html();

        if (h == "播放") {

            $("#c1").queue(function() {
                $(this).fadeOut("slow");
                $("#c1 b").remove();
                $(this).fadeIn("slow");
                $(this).append("<a class='adcp' href='#'><b>关闭</b></a>");
                $(this).dequeue();
            });
            $("#a1").html(SWF.$swf());
            SWF.$Time(150000);
        }
        else {
            SWF.$Time(0);
        }
    },
    $Time: function() {
        var gt = SWF.$Time.arguments;
        
        setTimeout(function() {
            $("#c1").queue(function() {
                $(this).fadeOut("slow");
                $("#c1 b").remove();
                $(this).append("<a class='adcp' href='#'><b>播放</b></a>");
                $(this).fadeIn("slow");
                $(this).dequeue();
            });
            $("#a1").hide(500);
            $("#a1").html("");
        }, gt[0]);
    }
}
