$(document).ready(function() {
	 
    $('#3d_close').click(function() {
        $('#div3D').hide();
        $('#divwrap1').hide();
    });
	
    $('#divwrap1').click(function() {
        $('#div3D').hide();
        $('#divwrap1').hide();
    });	
})


 function Show3D(flashPath) {
	var body_3d = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='640' height='480'>" +
		  "<param name='movie' value='" + flashPath + "' /> " +
		  "<param name='quality' value='high' />" +
		  "<embed src='" + flashPath + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='640' height='480'></embed>" +
		  "</object>	";
	$('#body_3d').html(body_3d);
	
	var swidth = screen.availWidth;
    var sHeight;
    if (screen.availHeight > document.body.scrollHeight) {
        sHeight = screen.availHeight; //少于一屏
    } else {
        sHeight = document.body.scrollHeight; //多于一屏 
    }
    $('#divwrap1').css({ width: swidth, height: sHeight }).show();
    loginwidth = $('#div3D').width();
    loginheight = $('#div3D').height();

    loginleft = ($(window).width() - loginwidth) / 2;
    logintop = document.documentElement.scrollTop + ($(window).height() - loginheight) / 2;
    $('#div3D').css({ top: logintop, left: loginleft }).show();
    window.onscroll = function() {
        var scrollleft = ($(window).width() - loginwidth) / 2;
        var scrolltop = document.documentElement.scrollTop + ($(window).height() - loginheight) / 2;
        $('#div3D').css({ top: scrolltop, left: scrollleft });
    }
    window.onresize = function() {
        var left = ($(window).width() - loginwidth) / 2;
        var top = document.documentElement.scrollTop + ($(window).height() - loginheight) / 2;
        $('#div3D').css({ top: top, left: left });
    }     
}