$j(document).ready(function() {
    var floatSwf = 'cypher_wetsuits.swf';
    var swfWidth = 640;
    var swfHeight = 395;
    var swfLeft = Math.floor(($j(window).width() - swfWidth) / 2);
    var swfTop = Math.floor(($j(window).height() - swfHeight) / 2);

    var sHtml = "";
    sHtml += '<div>'
    sHtml += '<div id="swfClose" style="text-align:right;height:27px;"><img src="images/skip_movie.gif" alt="SKIP MOVIE" height="27" width="122" style="cursor:pointer;" /></div>'
    sHtml += '<table id="swfTable" style="background-color:transparent; border:none; padding:0; margin:0; text-align:center; vertical-align:middle"  border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">';
    sHtml += '<tr><td align="center" valign="middle" style="padding:0; margin:0; border:none; background-color:transparent; text-align:center; vertical-align:middle">';
    sHtml += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + swfWidth + '" height="' + swfHeight + '" align="middle">';
    sHtml += '<param name="bgcolor" value="#333333" />';
    sHtml += '<param name="allowScriptAccess" value="always" />';
    sHtml += '<param name="movie" value="' + floatSwf + '" />';
    sHtml += '<param name="quality" value="high" />';
//			sHtml += '<param name="wmode" value="transparent" />';
    sHtml += '<param name="salign" value="lt" />';
    sHtml += '<param name="SWLIVECONNECT" value="TRUE" />';
    sHtml += '<embed bgcolor="#333333" SWLIVECONNECT="TRUE" salign="lt" align="middle" src="' + floatSwf + '" quality="high" width="' + swfWidth + '" height="' + swfHeight + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
//			sHtml += '<embed SWLIVECONNECT="TRUE" salign="lt" align="middle" src="' + gsFloatSwf_AN + '" quality="high" wmode="transparent" width="630" height="460" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
    sHtml += '</object></td></tr></table>';
    sHtml += '</div>';
    
    $j.blockUI({
        message: sHtml,
        css: {
            'top': swfTop + 'px',
            'left': swfLeft + 'px',
            'backgroundColor': 'transparent',
            'border': 'none'
//            'opacity': 0.5
        }
    });

    $j(window).bind('resize', resizeBlock);

    $j('.blockMsg').width(swfWidth);
    $j('#swfClose img').click(function() {
        closeSwfVideo();
    });

    function resizeBlock(e)
    {
        var rLeft = Math.floor(($j(window).width() - swfWidth) / 2);
        var rTop = Math.floor(($j(window).height() - swfHeight) / 2);

        $j('.blockMsg').css({
            'top': rTop + 'px',
            'left': rLeft + 'px'
        });
    }
});

function closeSwfVideo()
{
    $j.unblockUI();
}
