﻿//添加普通FLASH
function addFlash(width,height,src,vars)
{									  
		document.write('<object ID="KK_Flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ width +'" height="'+ height +'">');
		document.write('<param name="allowScriptAccess" value="sameDomain">');
		document.write('<param name="movie" value="'+src+'">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="#ffffff">');
		document.write('<param name="menu" value="false">');
		document.write('<param name=wmode value="transparent">');
		document.write('<param name="FlashVars" value="'+vars+'">');
		document.write('<embed ID="KK_Flash" src="'+src+'" wmode="transparent" FlashVars="'+vars
		+'" menu="false" bgcolor="#fff" quality="high" width="'+ width +'" height="'+ height 
		+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
}

//添加Flash轮播广告 width长,height高,pics图片,links链接,texts文字
function addFocus(width,height,pics,links,texts,src)
{

                    var pic_width=width; //图片宽度//this param387
                    var pic_height=height; //图片高度//this param244

                    var button_pos=4; //按扭位置 1左 2右 3上 4下//this param
                    var stop_time=7000; //图片停留时间(1000为1秒钟)//this param
                    var show_text=0; //是否显示文字标签 1显示 0不显示//this param
                    var txtcolor="000000"; //文字色

                    var bgcolor="DDDDDD"; //背景色
                  
                    var swf_height=show_text==0?pic_height:pic_height+50;//this param

                    var pics=pics;
                    var links=links.replace(/&/g,"#!#");
                    var texts=texts;

                    var wmode = 'movie';
					if(src)
					{
                    	var flashurl = src;
					}
					else
					{
						var flashurl = 'focus.swf';	
					}
                    var htmlstr = '<embed wmode="transparent" style="position:relative;top:0px;" src="' + flashurl + '" wmode=' + wmode +
                    ' quality="high" 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"></embed>';
                    document.write(htmlstr);
					
                
  }
