﻿var xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
xmlDoc.async= false;
xmlDoc.load('../Upload/xml/flashimg.xml');

//var configs = xmlDoc.getElementsByTagName('config');
//var childs = configs[0].childNodes;

var interval_time = "1"; //childs[0].nodeTypedValue;
var focus_width = "355"; //childs[1].nodeTypedValue;
var focus_height = "285"; //childs[2].nodeTypedValue;
var text_height = "30"; //childs[3].nodeTypedValue;
var text_align = "center"; //childs[4].nodeTypedValue;
var borderStyle = "0"; //childs[5].nodeTypedValue;

//alert(interval_time);
var text_mtop = 0;
var text_lm = 0;
var textcolor = "#000|0xff0000";
var textmargin = text_mtop+"|"+text_lm;
var swf_height = parseFloat(focus_height)+parseFloat(text_height)+parseFloat(text_mtop);

var countobj = xmlDoc.getElementsByTagName('FlashImg');
var count = countobj.length;
var pics='';
var links='';
var texts = '';
if (count > 7)
    count = 7;
for(var i=0;i<count;i++)
{
    var chileele = countobj[i].childNodes;
    var tt1 = chileele[3];
    var tt2 = chileele[2];
    var tt3 = chileele[1];
    pics += '../Upload/FCKEditor/image/' + tt1.nodeTypedValue;
    links += tt2.nodeTypedValue;
    texts += tt3.nodeTypedValue;
    if(i!=count-1)
    {
        pics += '|';
        links += '|';
        texts += '|';
    }
}
//alert(pics);
//alert(links);
//alert(texts);


//var pics='http://www.auto369.com/newpic/1.jpg|http://www.auto369.com/newpic/2.jpg|http://www.auto369.com/newpic/3.jpg|http://www.auto369.com/newpic/4.jpg'; 
//var links='http://www.auto369.com|#|#|#'; 
//var texts='西安市驾驶员报名大厅正式开业|西安市汽车维修行业管理处学习党的十七大精神概况|心系地震灾区 爱心充满祖国大地|用我们最真的心 哀悼地震遇难的同胞'; 			
var output="";

output+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">';
output+='<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="../images/hot.swf"> <param name="quality" value="high"><param name="bgcolor" value="#ffffff"><param name=wmode value="transparent">';
output+='<param name="menu" value="false">';
output+='<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&textmargin='+textmargin+'&textcolor='+textcolor+'&borderstyle='+borderStyle+'&text_align='+text_align+'&interval_time='+interval_time+'">';
output+='<embed src="../images/hot.swf" wmode="transparent" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&textmargin='+textmargin+'&textcolor='+textcolor+'&borderstyle='+borderStyle+'&text_align='+text_align+'&interval_time='+interval_time+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
output+='</object>';

xmlDoc=null;