﻿//首页大广告
var gg960ShowTime = 25000; //播放时间
var gg960Time = null;

function open_gg960(showBtn) {
    $('.gg_full .gg_fcon').html(gg960Con).slideDown(300, function () {
        //加载FLASH
        var cacheBuster = "?t=" + Date.parse(new Date());
        var stageW = 950; //"100%";
        var stageH = 390; //"100%";
        var attributes = {};
        attributes.id = 'show_pro_img';
        attributes.name = attributes.id;
        var params = {};
        params.bgcolor = "#ffffff";
        var flashvars = {};
        flashvars.componentWidth = stageW;
        flashvars.componentHeight = stageH;
        flashvars.pathToFiles = "/xf_skin_111219/";
        flashvars.xmlPath = "lrtk.xml";
        swfobject.embedSWF("/xf_skin_111219/preview.swf" + cacheBuster, attributes.id, stageW, stageH, "9.0.124", "/xf_skin_111219/expressInstall.swf", flashvars, params);

        if (showBtn !== false) {
            $('.gg_full .gg_fbtn').fadeIn();
        }
        if (gg960Time) { clearTimeout(gg960Time); }
        gg960Time = setTimeout(close_gg960, gg960ShowTime);
    });
}
function close_gg960() {
    $('.gg_full .gg_fcon').slideUp(500, function () {
        $(this).html('');
        $('.gg_fclose').hide();
        $('.gg_freplay').show();
    });
}
$('.gg_fclose').click(function () {
    if (gg960Time) { clearTimeout(gg960Time); }
    close_gg960();
    return false;
});
$('.gg_freplay').click(function () {
    if (gg960Time) { clearTimeout(gg960Time); }
    open_gg960(false);
    $('.gg_freplay').hide();
    $('.gg_fclose').show();
    return false;
});

var gg960Con;
var fullAdType = 'swf';
var fullAdUrl = 'http://www.hbcct.com/NewWebSite/special/newyear2012';
var fullAdName = 'images/head.png';


if (fullAdName) {
    if (fullAdType == 'swf') {
        gg960Con = '<DIV id=show_pro_img></DIV>';
        /*gg960Con = '<embed wmode="transparent" height="400" width="980" flashvars="alink1='+fullAdUrl+'" allowscriptaccess="always" quality="high" name="Advertisement" id="Advertisement" style="" src="'+fullAdName+'" type="application/x-shockwave-flash"></embed>';*/
    }
    else {
        gg960Con = '<a href="' + fullAdUrl + '" target="_blank"><img width="950" height="392" src="' + fullAdName + '"/></a>'; //flash无法显示时，显示JPG广告
    }

    setTimeout(open_gg960, 1500); //延迟显示
}
