/*display a flash AD*/
function showFlashAD(strpic, strlink, strtext, width, height) {
	var pic = strpic.join("|");
	var link = strlink.join("|");
	var title = strtext.join("|");
	var path = "swf/player.swf";
	var str = '<embed src=\"' + path + '\" wmode=\"opaque\"'
			+ 'FlashVars="'
			+ 'pics=' + pic + ''
			+ '&links=' + link + ''
			+ '&texts=' + title + ''
			+ '&borderwidth=' + width + ''
			+ '&borderheight=' + (height - 18) + ''
			+ '&textheight=18'
			+ '" menu="false" bgcolor="#cbaa59" quality="high" '
			+ 'width="' + width + '" '
			+ 'height="' + height + '"'
			+ ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>';
	document.write(str);
	//alert(str);
}
/*end*/

function showFlashAD2(str, width, height) {
	var pic = str.join("|");
	var path = "swf/Index.swf";
	var str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="292" height="393" id="output" align="middle">'
		+ '<param name="allowScriptAccess" value="sameDomain" />'
		+ '<param name="allowFullScreen" value="false" />'
		+ '<param name="FlashVars" value="datas=' + pic + '"/>'
		+ '<param name="movie" value=\"' + path + '\" />'
		+ '<embed src=\"' + path + '\" wmode=\"opaque\" FlashVars="datas=' + pic + '" menu="false" bgcolor="#CBE0F2" quality="high" width=\"' + width + '\" height=\"' + height + '\"'
		+ ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
		+ '</object>';
	document.write(str);
}

function showFlashAD3(pic_width, pic_height, imag, link, text) {
	//var pic_width=395; //图片宽度
	//var pic_height=265; //图片高度
	var button_pos = 4; //按扭位置 1左 2右 3上 4下
	var stop_time = 10000; //图片停留时间(1000为1秒钟)
	var show_text = 0; //是否显示文字标签 1显示 0不显示
	var txtcolor = "000000"; //文字色
	var bgcolor = "DDDDDD"; //背景色
	//var imag=new Array();
	//var link=new Array();
	//var text=new Array();
	//可编辑内容结束
	var swf_height = show_text == 1 ? pic_height + 20 : pic_height;
	var pics, links, texts;
	pics = links = texts = "";
	for (var i = 1; i < imag.length; i++) {
		pics = pics + ("|" + imag[i]);
		links = links + ("|" + link[i]);
		texts = texts + ("|" + text[i]);
	}
	pics = pics.substring(1);
	links = links.substring(1);
	texts = texts.substring(1);
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="' + pic_width + '" height="' + swf_height + '">');
	document.write('<param name="movie" value="swf/focus.swf">');
	document.write('<param name="quality" value="high"><param name="wmode" value="opaque">');
	document.write('<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&texts=' + texts + '&pic_width=' + pic_width + '&pic_height=' + pic_height + '&show_text=' + show_text + '&txtcolor=' + txtcolor + '&bgcolor=' + bgcolor + '&button_pos=' + button_pos + '&stop_time=' + stop_time + '">');
	document.write('<embed src="swf/focus.swf" FlashVars="pics=' + pics + '&links=' + links + '&texts=' + texts + '&pic_width=' + pic_width + '&pic_height=' + pic_height + '&show_text=' + show_text + '&txtcolor=' + txtcolor + '&bgcolor=' + bgcolor + '&button_pos=' + button_pos + '&stop_time=' + stop_time + '" quality="high" width="' + pic_width + '" height="' + swf_height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
function showFlashAD4(pic_width, pic_height, imag, link, text, config) {
	// config 设置分别为: 自动播放时间(秒)|文字颜色|文字背景色|文字背景透明度|按键数字色|当前按键色|普通按键色
	var pics,links,texts;
	pics = links = texts = "";
	var r = /(^\s*)|(\s*$)/g;
	for (var i = 1; i < imag.length; i++) {
		pics = pics + ("|" + imag[i]);
		links = links + ("|" + link[i]);
		texts = texts + ("|" + text[i].replace(r, ""));
	}
	pics = pics.substring(1);
	links = links.substring(1);
	texts = texts.substring(1);
	document.write('<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="' + pic_width + '" height="' + pic_height + '">');
	document.write('<param name="movie" value="swf/bcastr2.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="FlashVars" value="config=' + config + '&bcastr_flie=' + pics + '&bcastr_link=' + links + '&bcastr_title=' + texts + '" />');
	document.write('<embed src="swf/bcastr2.swf" wmode="opaque" FlashVars="config=' + config + '&bcastr_flie=' + pics + '&bcastr_link=' + links + '&bcastr_title=' + texts + '" menu="false" quality="high" width="' + pic_width + '" height="' + pic_height + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');

}
