if(typeof(A4page) == 'undefined') A4page = {}; A4page.Zone = []; A4page.Zone["S1"]={"zonecode":"S1",content:[{ "aid":"15474", "zid":"335", "title":"博客园T恤", "link":"http://www.hjbook.net/product/2289/", "advtype":"P", "source":"http://a4.yeshj.com/upload/200806/YU-O-S1P-15474_35.jpg", "adFormCode":"S1", "protected":false }]};A4page.Zone["S2"]={"zonecode":"S2",content:[{ "aid":"17545", "zid":"338", "title":"沪江网店品牌广告", "link":"http://www.hjbook.net/", "advtype":"P", "source":"http://a4.yeshj.com/upload/200810/YU-O-S2P-17545_49.jpg", "adFormCode":"S2", "protected":false }]}; function show_a4_zone(zonecode) { if(A4page.Zone[zonecode].content[0].advtype == "T"){ for (var i=0, post; post = A4page.Zone[zonecode].content[i]; i++) { if(zonecode.substring(0,1) == "H") document.write("" + post.title +"  "); else document.write("" + post.title +"
"); } } else if (A4page.Zone[zonecode].content[0].advtype == "P"){ if( A4page.Zone[zonecode].content.length == 1 ){ document.write(""); }else{ for (var i=0, post; post = A4page.Zone[zonecode].content[i]; i++) { document.write("

"); } } }else if (A4page.Zone[zonecode].content[0].advtype == "F"){ document.write(ConvertUbb(A4page.Zone[zonecode].content[0].source)); } } function ConvertUbb(Source){ //定义ubb转换参数 var flash_ubb = /\[flash=(\d*),(\d*)\](\S*)\[\/flash\]/igm; var flash_html= "" + "" + "" + "" + ""; //执行转换 Source=Source.replace(flash_ubb, flash_html ); return Source; }