﻿var imgWidth = 436 //宽度
var imgHeight = 226 //高度
var textHeight = 24 //文字高度
var swfHeight = imgHeight + textHeight
var imgUrl = new Array();
var imgLink = new Array();
var imgText = new Array();
var news_ds = CTSS.ajaxMethod.GetLastPicNews().value;
// 如果返回了结果
if (news_ds) {
    // 判断数据表是否不为空
    if (news_ds.Tables[0].Rows.length > 0) {
        // 返回的图片新闻数据表
        news_dt = news_ds.Tables[0];
        for (var i = 0; i < news_dt.Rows.length; i++) {
            imgUrl[i] = news_dt.Rows[i].imgUrl;
            imgText[i] = news_dt.Rows[i].imgtext;
            imgLink[i] = news_dt.Rows[i].imgLink;
        }
        var newsPic = imgUrl.join('|');
        var newsLink = imgLink.join('|');
        var newsText = imgText.join('|');
        document.write('<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + imgWidth + '" height="' + swfHeight + '">');
        document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/images/picnewsviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
        document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
        document.write('<param name="FlashVars" value="pics=' + newsPic + '&links=' + newsLink + '&texts=' + newsText + '&borderwidth=' + imgWidth + '&borderheight=' + imgHeight + '&textheight=' + textHeight + '">');
        document.write('<embed ID="focus_flash" src="/images/picnewsviewer.swf" wmode="opaque" FlashVars="pics=' + newsPic + '&links=' + newsLink + '&texts=' + newsText + '&borderwidth=' + imgWidth + '&borderheight=' + imgHeight + '&textheight=' + textHeight + '" menu="false" bgcolor="#F4E623" quality="high" width="' + imgWidth + '" height="' + imgHeight + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>');
        document.write('</object>');
    }
    else {
        //document.write('没有图片新闻');
    }

}