<%@ page language="java" buffer="100kb" errorPage="/common/error.jsp"%>
<%@ page import="org.apache.struts.Globals" %>

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

<vkc:checkLogin />
<vkc:init/>
<html:html locale="true">
<head>

	<vkc:cssinclude />

    <meta http-equiv="content-type"  content="text/html; charset=iso-8859-1" />
	<script type="text/javascript" src="<vkc:rewrite page='/common/utils.js'/>"></script>

    <script type="text/javascript">
	window.name = "MAINVIEW";

	function init(){ 
	}
 	
    function documentViewTypeChanged() {
        var form = document.forms[0];

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + '?action.change.documentviewtype=true';
        } else {
          form.action = form.action + '&action.change.documentviewtype=true';
        }

        form.submit();
	}

    </script> 
</head>
<body onload="init();" topmargin="0" marginheight="0">

<html:form action="/userDocumentViewSettings" method="post">
<bean:define id="form" name="userDocumentViewSettingsForm" scope="request" type="vkc.profile.form.UserDocumentViewSettingsForm" toScope="request"/>

<table width="1%" align="center" cellspacing="1" cellpadding="5" border="0">
  <tr>
    <td width="1%" align="center">
	  <table width="1%" align="center" border="0" cellpadding="0" cellspacing="5">
        <logic:present name="<%=Globals.ERROR_KEY%>">
        <tr><td align="left" nowrap="nowrap" colspan="4"><font color="red"><b><vkc:errors/></b></font></td></tr>
        </logic:present>

        <tr><td align="center" nowrap="nowrap" colspan="4"><b><vkc:message key="vkc.profile.button.manageUserDocumentViewSettings"/>:</b></td></tr>

        <vkc:hline colspan="4" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>

        <tr>
          <td align="center" nowrap="nowrap" colspan="4">
		    <logic:equal name="form" property="fullViewType" value="true">
			<html:radio property="documentViewType" name="form" value="fullview"/>
			&nbsp;<vkc:message key="vkc.profile.manageUserDocumentViewSettings.type.fullview"/>&nbsp;&nbsp;
		    </logic:equal>
		    <logic:equal name="form" property="fullViewType" value="false">
			<html:radio property="documentViewType" name="form" value="fullview" onclick="documentViewTypeChanged();" />
			&nbsp;<vkc:message key="vkc.profile.manageUserDocumentViewSettings.type.fullview"/>&nbsp;&nbsp;
		    </logic:equal>
		    <logic:equal name="form" property="defaultViewType" value="true">
			<html:radio property="documentViewType" name="form" value="defaultview"/>
			&nbsp;<vkc:message key="vkc.profile.manageUserDocumentViewSettings.type.defaultview"/>&nbsp;&nbsp;
		    </logic:equal>
		    <logic:equal name="form" property="defaultViewType" value="false">
			<html:radio property="documentViewType" name="form" value="defaultview" onclick="documentViewTypeChanged();" />
			&nbsp;<vkc:message key="vkc.profile.manageUserDocumentViewSettings.type.defaultview"/>&nbsp;&nbsp;
		    </logic:equal>
		    <logic:equal name="form" property="userViewType" value="true">
			<html:radio property="documentViewType" name="form" value="userview"/>
			&nbsp;<vkc:message key="vkc.profile.manageUserDocumentViewSettings.type.userview"/>
		    </logic:equal>
		    <logic:equal name="form" property="userViewType" value="false">
			<html:radio property="documentViewType" name="form" value="userview" onclick="documentViewTypeChanged();" />
			&nbsp;<vkc:message key="vkc.profile.manageUserDocumentViewSettings.type.userview"/>
		    </logic:equal>
          </td>
        </tr>

		<vkc:hline colspan="4" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>

		<logic:equal name="form" property="fullViewType" value="true">
        <tr>
          <td align="center" nowrap="nowrap" colspan="4">
			  <jsp:include page="documentViewNoEditable.jsp" flush="true"/>
          </td>
        </tr>
		</logic:equal>

		<logic:equal name="form" property="defaultViewType" value="true">
        <tr>
          <td align="center" nowrap="nowrap" colspan="4">
			  <jsp:include page="documentViewNoEditable.jsp" flush="true"/>
          </td>
        </tr>
		</logic:equal>

		<logic:equal name="form" property="userViewType" value="true">
        <tr>
          <td align="center" nowrap="nowrap" colspan="4">
			  <jsp:include page="documentViewEditable.jsp" flush="true"/>
          </td>
        </tr>
		</logic:equal>

		<vkc:hline colspan="4" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>
        
        <tr>
          <td align="center" nowrap="nowrap" colspan="4">
            <vkc:button property="action.save" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.save"/></vkc:button>&nbsp;
            <vkc:button property="action.back" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.back"/></vkc:button>
          </td>
		</tr>
	  </table>
    </td>
  </tr>
</table>
</html:form>
</body>
</html:html>