<%@ page contentType="text/html; charset=GBK"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="gbase.init.*,gbase.db.*,java.sql.*,gbase.util.*"%>
<%
//CMS站点的发布上下文(虚拟目录）
WebConfig theWebConfig1=new WebConfig();
String cms_url=theWebConfig1.getCms_url(); //已包括“/”
String old_cms_url="";
if(cms_url.lastIndexOf("/")>0)
old_cms_url=cms_url.substring(0,cms_url.lastIndexOf("/"));

//参数:网站账号web_account
String web_account=request.getParameter("web_account")==null?"":request.getParameter("web_account");

//参数:要显示栏目的ID
String bar_id=request.getParameter("bar_id")==null?"":request.getParameter("bar_id");

//参数:行数
String str_page_size=request.getParameter("page_size")==null?"0":request.getParameter("page_size");
int page_size=Integer.parseInt(str_page_size);

//参数:图像宽度
String  str_img_width=request.getParameter("img_width")==null?"0":request.getParameter("img_width");
int img_width=Integer.parseInt(str_img_width);

//参数:图像高度
String str_img_height=request.getParameter("img_height")==null?"0":request.getParameter("img_height");
int img_height=Integer.parseInt(str_img_height);

//参数:是否显示标题
String title_flag=request.getParameter("title_flag")==null?"0":request.getParameter("title_flag");

//标题高度
int text_height=18;
if(title_flag.equals("true"))
text_height=18;
else
text_height=0;


//参数:标题的汉字数
String str_title_length=request.getParameter("title_length")==null?"0":request.getParameter("title_length");
int title_length=Integer.parseInt(str_title_length);

//参数:打开方式　与html中<a>的target属性相同
String target=request.getParameter("target")==null?"_blank":request.getParameter("target");

//图片展播控件
String ppt_object="/images/focus.swf";
%>

<!--图片幻灯效果JS-->
<%
int i = 0;
DBOperation theDBOperation1 = new DBOperation();
String imgUrl="";
String imgLink="";
String imgText="";
String sql1="";
if(bar_id.equals("all"))
sql1="select * from web_imageinfo  where web_account='"+web_account+"'  order by id desc";
else
sql1="select * from web_imageinfo  where bar_id="+bar_id+" and web_account='"+web_account+"' order by id desc";
ResultSet rs1 =theDBOperation1.getResultSet(sql1);
while(rs1.next() && i<page_size)
{
if(i!=0)
{
imgUrl=imgUrl+"|";
imgLink=imgLink+"|";
imgText=imgText+"|";
}
String temp_imgUrl=rs1.getString("image_url");
String temp_imgLink="/"+rs1.getString("bar_id")+"/content"+rs1.getString("id")+".html";
String temp_imgText=StringUtils.getStringLength(rs1.getString("title"),title_length);
imgUrl=imgUrl+temp_imgUrl;
imgLink=imgLink+temp_imgLink;
imgText=imgText+temp_imgText;
i++;
}

%>
<a target=<%=target%> href="javascript:goUrl()"> 
<script type="text/javascript">
var focus_width=<%=img_width%>;
var focus_height=<%=img_height%>;
var text_height=<%=text_height%>;
var swf_height = focus_height+text_height;
var pics='<%=imgUrl%>';
var links='<%=imgLink%>';
var texts='<%=imgText%>';
		 
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="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="<%=ppt_object%>"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="<%=ppt_object%>" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
</script>
</a>

