
var float_imgStr = 1;

var float_width = 220;

var float_height = 238;

var float_type = 2;



function setImg(img, width, height) {

    float_imgStr = img;

    float_width = width;

    float_height = height;

    showCode();

}



function setType(param) {

    float_type = param;

    showCode();

}

function showCode() {

    var adjspath = "/float/";

    code = "<scri" + "pt type=\"text/javascript\">";

    code += "\n\tvar zz_float_imgstr = " + float_imgStr + ";";

    code += "\n\tvar zz_float_type = " + float_type + ";";

    code += "\n\tvar zz_float_width = " + float_width + ";";

    code += "\n\tvar zz_float_height = " + float_height + ";";

    code += "\n\tvar zz_float_param 	= '" + float_param + "';";

    code += "\n</scri" + "pt>";

    code += "\n<scri" + "pt type=\"text/javascript\" src=\"" + adjspath + "float.js\"></scri" + "pt>";

    document.getElementById('showCodeText').value = code;

}

function copyCode() {

    document.getElementById("showCodeText").select();

    document.execCommand("copy", null);

}

function preview() {

    var code = document.getElementById("showCodeText").value;

    var s = "<html><head><title>广告代码预览</title>";

    s += "<meta http-equiv=\"Content-Language\" content=\"zh-cn\" />";

    s += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />";

    s += "</head><body><div align=\"center\"><div style=\"height:1024px;width:768px;text-align:left;background-color:#F1F1F1;border:1px solid #999999\">";

    s += code;



    s += "</div></div></body></html>";

    var NWin = window.open("about:blank");

    NWin.document.open();

    NWin.document.write(s);

    //Nwin.document.location;

    //NWin.document.close();

}



function showFloatPage(pix) {

    for (var i = 0; i <= 2; i++) {

        if (pix == i) {

            document.getElementById('floatlist' + i).style.display = '';

        }

        else {

            document.getElementById('floatlist' + i).style.display = 'none';

        }

    }

    var str = '';

    if (pix != 0) {

        str += '<a href="javascript:showFloatPage(' + (pix - 1) + ');">上一页</a>&nbsp;';

    }



    if (pix != 4) {

        str += '<a href="javascript:showFloatPage(' + (pix + 1) + ');">下一页</a>';

    }

    document.getElementById('showFloatPage').innerHTML = str;

}