<%@ Page Language="C#" Inherits="SiteServer.BackgroundPages.Modal.SelectImage" Trace="false"%>
<%@ Register TagPrefix="bairong" Namespace="BaiRong.Controls" Assembly="BaiRong.Controls" %>
<%@ Register TagPrefix="user" Namespace="UserCenter.Controls" Assembly="UserCenter.Pages" %>
<%@ Register TagPrefix="site" Namespace="SiteServer.Controls" Assembly="SiteServer.Controls" %>

<HTML>
<HEAD>
<!--#include file="../inc/html_head.inc"-->
<user:custom type="style" runat="server"></user:custom>
<title>选择图片</title>
<bairong:Code type="Prototype" runat="server" />
<bairong:Code type="Scriptaculous" runat="server" />
<script language="javascript" type="text/javascript">
function selectImage(textBoxUrl, imageUrl)
{
	window.parent.document.getElementById('<%=Request.QueryString["TextBoxClientID"]%>').value = textBoxUrl;
	ShowImg(window.parent.document.getElementById('<%=Request.QueryString["TextBoxClientID"]%>'), window.parent.document.getElementById('preview_<%=Request.QueryString["TextBoxClientID"]%>'), '<%=RootUrl%>', '<%=PublishmentSystemUrl%>');
	window.parent.hidePopWin();
}

function ShowImg(txtObj, imgObj, rootUrl, publishmentSystemUrl){
	if(txtObj.value==""){
		imgObj.src = '../../sitefiles/bairong/Icons/empty.gif';
		return false;
	}
	if(txtObj.value.search(/\.swf$/i) != -1) {
		imgObj.src = '../../sitefiles/bairong/Icons/flash.jpg';
		return false;
	}
	if(txtObj.value.search(/\.flv|\.avi|\.mpg|\.mpeg|\.smi|\.mp3|\.mid|\.midi|\.rm|\.wmv|\.wma|\.asf|\.mov$/i) != -1) {
		imgObj.src = '../../sitefiles/bairong/Icons/player.gif';
		return false;
	}
	if(txtObj.value.search(/\.bmp|\.jpg|\.jpeg|\.gif|\.png$/i) != -1) {
		var imageUrl = txtObj.value;
		if (!_isNull(imageUrl)){
			if (imageUrl.charAt(0) == '~'){
				imageUrl = imageUrl.replace('~', rootUrl);
			}else if (imageUrl.charAt(0) == '@'){
				imageUrl = imageUrl.replace('@', publishmentSystemUrl);
			}
		}
		if(imageUrl && imageUrl.substr(0,2)=='//'){
			imageUrl = imageUrl.replace('//', '/');
		}
		imgObj.src=imageUrl;
	}
}
</script>

<meta http-equiv="content-type" content="text/html;charset=gb2312">
</HEAD>
<body>
<user:custom type="showpopwin" runat="server" />
<form style="margin:0" runat="server">
<div class="column" style="width:100%;">
<TABLE width="100%" cellSpacing=0 cellPadding=0 border=0 style="line-height:28px;">
	<TBODY>
	  <TR>
		<TD width="50"><asp:ImageButton runat="server" ImageUrl="~/sitefiles/bairong/icons/filesystem/management/back.gif" CommandName="NavigationBar" CommandArgument="Back" OnCommand="LinkButton_Command"></asp:ImageButton></TD>
		<TD width="50"><asp:ImageButton runat="server" ImageUrl="~/sitefiles/bairong/icons/filesystem/management/up.gif" CommandName="NavigationBar" CommandArgument="Up" OnCommand="LinkButton_Command"></asp:ImageButton></TD>
		<TD width="50"><asp:ImageButton runat="server" ImageUrl="~/sitefiles/bairong/icons/filesystem/management/reload.gif" CommandName="NavigationBar" CommandArgument="Reload" OnCommand="LinkButton_Command"></asp:ImageButton></TD>
		<TD width="5"><asp:ImageButton runat="server" ImageUrl="~/sitefiles/bairong/icons/filesystem/management/seperator.gif"></asp:ImageButton></TD>
		<TD width="80"><nobr><asp:HyperLink ID="UploadLink" runat="server"><asp:ImageButton  runat="server" ImageUrl="~/sitefiles/bairong/icons/add.gif" ImageAlign="AbsBottom"></asp:ImageButton>上传图片</asp:HyperLink></nobr></TD>
		<TD align="right"><SPAN>当前目录：<bairong:NoTagText id="CurrentDirectory" runat="server" />&nbsp;</SPAN></TD>
	  </TR>
	</TBODY>
  </TABLE>
</div>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td>
    </td>
</tr>
</table>

<div class="column" style="width:100%;">
<div class="columntitle">文件列表</div>
	<bairong:NoTagText id="FileSystems" runat="server" enableViewState="false" />
</div>
</form>
</body>
</html>