﻿if(typeof(A4page) == 'undefined') A4page = {}; A4page.Zone = [];A4page.Zone["A767"]={"zonecode":"H767",content:[{ "aid":"773","title":"小语种 视频课程","link":"http://lesson.veduchina.com/","advtype":"P","width":"200","height":"80","color":"","source":"http://www.veduchina.com/UserFiles/Image/2009/07/15/37b13b9f-88ed-4701-9a2c-6ff10fb4c7c7.jpg"}]};A4page.Zone["A768"]={"zonecode":"H768",content:[{ "aid":"774","title":"外语资料下载","link":"http://www.veduchina.com/vip/","advtype":"P","width":"244","height":"80","color":"","source":"http://www.veduchina.com/UserFiles/Image/2009/07/15/a5a55334-db5a-4a2a-aa43-d9e01d85f000.jpg"}]};A4page.Zone["A769"]={"zonecode":"H769",content:[{ "aid":"775","title":"文国音乐 无限精彩","link":"http://music.veduchina.com/","advtype":"P","width":"956","height":"85","color":"","source":"http://www.veduchina.com/UserFiles/Image/2009/07/15/458b2efc-9af1-4d0b-a123-831bd2a27965.gif"}]};A4page.Zone["A770"]={"zonecode":"H770",content:[{ "aid":"777","title":"艾维达教育 西班牙留学","link":"http://www.ivedu.com/","advtype":"P","width":"255","height":"80","color":"","source":"http://www.veduchina.com/UserFiles/Image/2009/07/15/601075ce-00fe-4dd4-ae71-26ce0df9187b.jpg"}]};A4page.Zone["A771"]={"zonecode":"H771",content:[{ "aid":"778","title":"外语学习资料下载","link":"http://www.veduchina.com/vip/","advtype":"P","width":"244","height":"80","color":"","source":"http://www.veduchina.com/UserFiles/Image/2009/07/15/a5a55334-db5a-4a2a-aa43-d9e01d85f000.jpg"}]};A4page.Zone["A772"]={"zonecode":"H772",content:[{ "aid":"776","title":"艾维达教育 出国留学专家","link":"http://www.ivedu.com/","advtype":"P","width":"956","height":"85","color":"","source":"http://www.veduchina.com/UserFiles/Image/2009/07/16/7de8fd82-b593-4693-90ff-e26dc234420d.jpg"}]};
function show_a4_zone(zonecode){
if(A4page.Zone[zonecode].content.length==0)
{}
else{if(A4page.Zone[zonecode].content[0].advtype == "T"){
for (var i=0, post; post = A4page.Zone[zonecode].content[i]; i++) {
if(A4page.Zone[zonecode].zonecode.substring(0,1) == "H")
document.write("<a href=\"" + post.link + "\" title=\"" + post.title + "\" style=\"color:" + post.color + ";font-size:" + post.width + "px;\" target=\"_blank\">" + post.title + "</a>&nbsp;&nbsp;");
else
document.write("<li><a href=\""+ post.link +"\" title=\""+post.title+"\" style=\"color:" + post.color + ";font-size:" + post.width + "px;\" target=\"_blank\">" + post.title +"</a></li>");
}
}	else if (A4page.Zone[zonecode].content[0].advtype == "P"){
if( A4page.Zone[zonecode].content.length == 1 ){
document.write("<a href=\""+A4page.Zone[zonecode].content[0].link+"\" title=\""+A4page.Zone[zonecode].content[0].title+"\" target=\"_blank\"><img src=\""+ A4page.Zone[zonecode].content[0].source +"\"  style=\"height:" + A4page.Zone[zonecode].content[0].height + ";width:" + A4page.Zone[zonecode].content[0].width + "px;\" alt=\""+A4page.Zone[zonecode].content[0].title+"\" border=\"0\"></a>");
}else{
for (var i=0, post; post = A4page.Zone[zonecode].content[i]; i++) {
if(A4page.Zone[zonecode].zonecode.substring(0,1) == "H")
document.write("<a href=\""+ post.link + "\" target=\"_blank\" title=\""+post.title+"\"><img src=\""+ post.source +"\" style=\"height:" + post.height + ";width:" + post.width + "px;\" alt=\""+post.title+"\" border=\"0\"></a>&nbsp;&nbsp;");
else
document.write("<a href=\""+ post.link + "\" target=\"_blank\" title=\""+post.title+"\"><img src=\""+ post.source +"\" style=\"height:" + post.height + ";width:" + post.width + "px;\" alt=\""+post.title+"\" border=\"0\"></a><br/><br/>");
}
}
}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= "<OBJECT codeBase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\""
+ " classid=\"clsid:d27CDB6E-AE6D-11cf-96B8-444553540000\" "
+ "width=$1 height=$2>"
+ "<PARAM NAME=movie VALUE=\"$3\">"
+ "<PARAM NAME=quality VALUE=high>"
+ "<PARAM NAME=wmode VALUE=opaque>"
+ "<embed src=\"$3\" width=$1 height=$2 quality=high name=index type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/>"
+ "</OBJECT>";
//执行转换
Source=Source.replace(flash_ubb, flash_html );
return Source;
}
