﻿//Flash广告
var picstr = "";
var linkstr = "";

jQuery.ajax({
    url: "/Web/IndexAD?r=" + Math.random(),
    type: 'get',
    data: {},
    dataType: 'json',
    async: (false),
    beforeSend: function(XMLHttpRequest) {

    },
    success: function(json) {
        if (json.pics != "" && json.links != "") {
            picstr = json.pics;
            linkstr = json.links;
        }
        else {
            picstr = '../../../uploads/_1PF1164.jpg|../../../uploads/_1Q523J2.jpg|../../../uploads/_1Q235155.jpg|../../../uploads/_1QA3D5.jpg|../../../uploads/_1K25DO.jpg|';
            linkstr = 'javascript:void(0)|javascript:void(0)|javascript:void(0)|javascript:void(0)|javascript:void(0)|';
        }
    }
});


var focus_width = 396
var focus_height = 246
var text_height = 0
var swf_height = focus_height + text_height
var pics = clearText(picstr);
var links = clearText(linkstr);

//var texts = clearText("互联网巨头与通讯运营商纷纷跑马圈地SNS|尼尔森公布中国网竿月流量排吿百度第一|<font color='#0000FF'>工信部推互联网网络安全信息通报实施办法</font>|搜索引擎理念对对碿 谷歌相比百度谁更搜|<font color='#FF0000'>新恢复会员投稿站长投递文章更加方便快捿/font>|")
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabjavascript:void(0)version=6,0,0,0" width="' + focus_width + '" height="' + swf_height + '" align="left"  hspace="0">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="http://www.chinaz.com/images/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
//document.write('<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">');
document.write('<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">');
document.write('<embed src="../../../Content/web/images/pixviewer.swf" wmode="opaque" FlashVars="pics=' + pics + '&links=' + links + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '" menu="false" bgcolor="#F0F0F0" quality="high" width="' + focus_width + '" height="' + swf_height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');

function clearText(str) {
    return str.substr(0, str.length - 1);
}