<%@ page contentType="text/html; charset=GBK" session="false"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>
<%@ page contentType="text/html; charset=GBK"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
		<link href="../style/blue/css/main.css" type="text/css" rel="stylesheet" />
		<link href="../style/blue/css/reset-min.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../common/js/jquery-1.7.gzjs"></script>
		<script language="javascript" type="text/javascript" src="../javascript/commonUtil.js"></script>
		<script type="text/javascript" src="../javascript/dialog/lhgdialog.min.js?skin=iblue"></script>
		<script type="text/javascript" src="../javascript/uuid.js"></script>
		<script type="text/javascript" src="../style/blue/js/tab_change.js"></script>
		<script language="javascript" type="text/javascript" src="../javascript/My97DatePicker/WdatePicker.js"></script>
		<script language="javascript" type="text/javascript" src="../javascript/upload/SWFUpload/swfupload.js"></script>
		<script language="javascript" type="text/javascript" src="../javascript/upload/SWFUpload/handler.js"></script>
		<script>
		$(window).load(function()
		{
		   $('#appearStartDateTime').mousedown
		   (
		      function()
		      {
		         WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
		      }
		   );
		   
		   $('#appearEndDateTime').mousedown
		   (
		      function()
		      {
		         WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
		      }
		   );
		   
		    
		})
		 
		</script>
		<script type="text/javascript">
var swfu;
window.onload = function () {
swfu = new SWFUpload({
upload_url: "../../content/editorUploadImage.cmd;jsessionid=<cms:SID/>",//上传的servlet

// File Upload Settings
file_size_limit : "50 MB", // 1000MB
file_types : "*.png;*.jpeg;*.jpg",//设置可上传的类型
file_types_description : "图片文件",
file_upload_limit : "50",

file_queue_error_handler : fileQueueError,//选择文件后出错
file_dialog_complete_handler : fileDialogComplete,//选择好文件后提交
file_queued_handler : fileQueued,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,

// Button Settings
button_image_url : "<cms:Domain/>/core/upload.png",
button_placeholder_id : "spanButtonPlaceholder",
button_width: 61,
button_height: 22,
button_text : '',
button_text_style : '',
button_text_top_padding: 0,
button_text_left_padding: 18,
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,

// Flash Settings
flash_url : "../javascript/upload/SWFUpload/swfupload.swf",

custom_settings : {
upload_target : "divFileProgressContainer"
},
// Debug Settings
debug: false //是否显示调试窗口
});
};
function startUploadFile(){
swfu.startUpload();
}

</script>
<cms:Domain/>
	</head>
	<body>
		<form action="../../content/addPhoto.cmd" id="photoForm" name="photoForm" method="post">
			<div class="breadnav">

				<table width="99.9%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td align="left">
							&nbsp;
							<img src="../style/blue/images/home.gif" width="16" height="16" class="home" />
							当前位置：
							<a href="#">内容管理</a> &raquo; 添加图集
						</td>
						<td align="right">
						</td>
					</tr>
				</table>
			</div>
			<div style="height:25px;"></div>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td class="mainbody" align="left" valign="top">
						<!--main start-->
						<div class="addtit">
							<img src="../style/blue/icon/application-import.png" width="16" height="16" />
							图片集信息
						</div>


						<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
							<tr>
								<td width="13%" class="input-title">
									所属栏目:
								</td>
								<td class="td-input">
									<select name="classId" id="classId">
										<option value="-9999">
											选择图片集所属栏目
										</option>
										<cms:DisplayClass modelId="2" initClassId="${param.classId}" />
									</select>
								</td>
							</tr>
							<tr>
								<td width="13%" class="input-title">
									标题
								</td>
								<td width="87%" class="td-input">
									<input id="title" name="title" type="text" size="60" class="form-input" />
									<span class="red">*</span><span class="ps"></span>
								</td>
							</tr>
							<tr style="display:none">
								<td width="13%" class="input-title">
									短标题
								</td>
								<td width="87%" class="td-input">
									<input id="simpleTitle" name="simpleTitle" type="text" class="form-input" size="40" />
									<span class="red">*</span><span class="ps"></span>
								</td>
							</tr>
							<tr>
								<td class="input-title">
									作者
								</td>
								<td class="td-input">
									<input id="author" name="author" type="text" class="form-input" value="" size="35" maxlength="50" />
								</td>
							</tr>
							<tr>
								<td class="input-title">
									来源
								</td>
								<td class="td-input">
									<input id="source" name="source" type="text" class="form-input" value="" size="35" maxlength="50" />
									<input type="button" value="选取来源" onclick="" class="btn-1" />
								</td>
							</tr>
							<tr>
								<td class="input-title">
									图片集简介
								</td>
								<td class="td-input">
									<textarea id="photoGroupDesc" name="photoGroupDesc" cols="53" rows="5" class="form-textarea" style="width:415px; height:60px;"></textarea>
								</td>
							</tr>

							<tr>
								<td class="input-title">
									TAG标签

								</td>
								<td class="td-input">
									<input name="tagKey" id="tagKey" type="text" class="form-input" size="50" />
									<input type="button" value="自动获取" onclick="" class="btn-1" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									发布时间:
								</td>
								<td class="td-input">
									<table width="405" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="37%">
												<input id="appearStartDateTime" name="appearStartDateTime" size="21" maxlength="30" type="text" class="f_input_time" />
											</td>
											<td width="7%" class="font_style_center">
												至
											</td>
											<td width="56%">
												<input id="appearEndDateTime" name="appearEndDateTime" size="21" maxlength="30" type="text" class="f_input_time" />
											</td>
									</table>
								</td>
							</tr>

							<tr>
								<td class="input-title">
									封面图片
								</td>
								<td class="td-input">
									<img id='showCover' src="../style/blue/images/no-image.png" name="showCover" height="80" width="105" />
								</td>
							</tr>

						</table>


						<div class="addtit">
							<img src="../style/blue/icon/application-import.png" width="16" height="16" />
							图片
						</div>
						<div style="height:10px;"></div>
						<table>
							<tr>
								<td>
									<!-- 上边定义的ID -->

									<span id="spanButtonPlaceholder">sss</span>
									<div id="divFileProgressContainer" style="width:200;display:;">
										
									</div>
									<div id="thumbnails">
										<table id="infoTable" border="0" width="50%" style="border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;margin-top:8px;">
										</table>
									</div>
									</b>
									<a onclick="javascript:addSinlePhotoDialog();" class="btnwithico"> <img src="../../core/style/default/images/doc_add.png" alt="" /><b>上传图片&nbsp;</b> </a>
									<a onclick="javascript:gotoAddUserDefineContentPage(${param.modelId});" class="btnwithico"> <img src="../../core/style/default/images/doc_add.png" alt="" /><b>上传ZIP包&nbsp;</b> </a>
								</td>

							</tr>
						</table>
						<div style="height:10px;"></div>
						<iframe id="groupFrame" name="groupFrame" src="PhotoGroupList.jsp?ids=${param.ids}" scrolling="no" frameborder="0" width="100%"></iframe>


					</td>
				</tr>

				<tr>
					<td height="10">
						&nbsp;
					</td>
				</tr>
			</table>


			<!-- hidden -->
			<input type="hidden" id="fileName" name="fileName" />
			<input type="hidden" id="cover" name="cover" />
			<input type="hidden" id="resizeCover" name="resizeCover" />
			<input type="hidden" id="ids" name="ids" value="" />
			<input type="hidden" id="newAddIds" name="newAddIds" value="" />
			<input type="hidden" id="needDeleteIds" name="needDeleteIds" value="" />
		</form>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" >
			<tr class="btnbg100">
				<td width="40%" class="input-title"></td>
				<td width="87%" class="td-input">
					<a onclick="javascript:submitPhotoGroup();" class="btnwithico"><img src="../style/icons/tick.png" width="16" height="16" /><b>确认&nbsp;</b> </a>
					<a href="javascript:;" class="btnwithico" onclick=""><img src="../style/icon/close.png" width="16" height="16"><b>取消&nbsp;</b> </a>
				</td>
				<td valign="top">
					<br />
				</td>
			</tr>
		</table>
		<div style="height:5px;"></div>
	</body>
</html>

<script type="text/javascript">

//alert("s-s:${param.title}");


var targetCoverPhoto = '';


var submitFlag=false;

var dialogMode=false;

//退出事件,注意:若是href触发事件,必须用onclick代替,IE下,onbeforeunload发生时间晚于onclick
window.onbeforeunload = beforeAction;
//window.onunload=unloadAction;

function beforeAction()
{

 //alert('start:'+submitFlag +"-"+ dialogMode);
  if(submitFlag || dialogMode)
  {
  	return;
  }
  
  var allIds = document.getElementById("ids").value;
  
 
  if(''==allIds)
  {
  	return;
  }
 
 //alert('delete');
  var url = '../../common/deleteTemp.cmd?fileType=photoGroup&ids='+ allIds;
  
  $.ajax({type:'POST',async:true,url:url,success:
  	function(data, textStatus)
  	{
         return;
  	}
  });
  
}


function submitPhotoGroup()
{  
   submitFlag=true;
   photoForm.submit();
}

function getResultFromFrame(frameName,targetName)
{
    return document.getElementById(frameName).contentWindow.document.getElementById(targetName).value;
}




function addSinlePhotoDialog()
{
	 dialogMode=true;
	
	 $.dialog({ 
    	title :'添加图片',
    	width: '640px', 
    	height: '340px', 
    	lock: true, 
        max: false, 
        min: false,
        resize: false,
        
        
        content: 'url:<cms:Domain/>/core/content/AddSingleGroupPhoto.jsp'
	
	  
	});

}


</script>
