<%@ page language="java" buffer="100kb" errorPage="/common/error.jsp"%>

<%@ taglib uri="struts-bean"  prefix="bean"  %>
<%@ taglib uri="struts-html"  prefix="html"  %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="vkc-taglib"   prefix="vkc"   %>

<%@ page import="vkc.view.WebShare" %>
<%@ page import="vkc.view.form.ClusterResultSaveForm" %>
<%@ page import="org.apache.struts.Globals" %>

<vkc:checkLogin/>
<vkc:init/>
<html:html locale="true">
<head>
    <meta http-equiv="content-type"  content="text/html; charset=iso-8859-1" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="pragma"        content="no-cache" />
    <meta http-equiv="expires"       content="0" />
    <meta http-equiv="robots"        content="noindex" />
    <meta http-equiv="robots"        content="nofollow" />
    <script type="text/javascript" src="<vkc:rewrite page='/common/utils.js'/>"></script>
    <vkc:cssinclude />

    <script type="text/javascript">
    window.name = "CLUSTERRESULTSAVEVIEW";
    var currentCalendar = null;
    var windowOpen = null;

    function init(){
		setAnchor();

	    <logic:present name="clusterResultSaveForm">
	      <logic:equal name="clusterResultSaveForm" property="redirect" value="true">
            var clusterFrameset = getClusterFrameset();
            
            if (clusterFrameset && clusterFrameset.parent) {
			  clusterFrameset.parent.location.replace('<%=ctxPath%><vkc:write name="clusterResultSaveForm" property="redirectPath"/>');
            }
	      </logic:equal>
	    </logic:present>
    }

	function setAnchor() {
		<logic:present parameter="anchor">
			<bean:parameter id="anchor2" name="anchor"/>
			this.location.hash = '<%=anchor2%>';
		</logic:present>
	}

	function unloadPage() {
    	if ( currentCalendar!=null ) {
      		hideCalendar();
    	}

	    if ( windowOpen != null ) {
	    	windowOpen.close();
	    }
    }

	</script>
</head>

<body onload="init();" onUnload="unloadPage();">
<html:form action="/clusterResultSave" method="post">
<bean:define id="form" name="clusterResultSaveForm" scope="request" type="vkc.view.form.ClusterResultSaveForm"/>

<html:hidden property="categoryId"/>
<html:hidden property="sourcePageId"/>
<logic:notEmpty name="form" property="targetId">
  <html:hidden property="targetId"/>
</logic:notEmpty>
<logic:notEmpty name="form" property="subTargetId">
  <html:hidden property="subTargetId"/>
</logic:notEmpty>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <logic:present name="<%=org.apache.struts.Globals.ERROR_KEY%>">
  <html:messages id="error" message="false">
  <tr><td align="left" nowrap="nowrap" colspan="2"><span class="error"><b><vkc:write name="error"/></b></span></td></tr>
  </html:messages>
  <tr><td colspan="2"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="5" border="0"/></td></tr>
  </logic:present>

  <tr>
    <td width="100%" valign="top">
      <table cellspacing="0" cellpadding="0" width="100%" border="0">
        <tr>
          <td align="center" nowrap="nowrap" colspan="2">
            <vkc:button property="action.save" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.save"/></vkc:button>
            <vkc:button property="action.cancel" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.cancel"/></vkc:button>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</html:form>
</body>
</html:html>