<%@ page import="com.atlassian.jira.ManagerFactory,
				 com.atlassian.jira.config.properties.APKeys,
				 com.atlassian.jira.config.properties.ApplicationProperties"%>
<%@ page import="com.atlassian.plugin.webresource.WebResourceManager"%>
<%@ page import="com.atlassian.jira.ComponentManager"%>
<%@ page import="com.atlassian.jira.config.properties.LookAndFeelBean"%>
<%-- a printable decorator --%>
<%@ taglib uri="webwork" prefix="webwork" %>
<%@ taglib uri="sitemesh-decorator" prefix="decorator" %>

<%-- get the decorator page object, for use within the decorator --%>
<decorator:usePage id="decoratorPage" />
<%
    ApplicationProperties headerAP = ManagerFactory.getApplicationProperties();

    final LookAndFeelBean lookAndFeelBeanPrintable = LookAndFeelBean.getInstance(headerAP);
    String linkColour = lookAndFeelBeanPrintable.getTextLinkColour();
    String linkAColour = lookAndFeelBeanPrintable.getTextActiveLinkColour();

    WebResourceManager webResourceManagerPrintable = ComponentManager.getInstance().getWebResourceManager();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title><%= headerAP.getDefaultBackedString(APKeys.JIRA_TITLE) %> - <decorator:title default="New Generation Issue Tracking" /></title>

    <link rel="stylesheet" type="text/css" media="print,screen" href="<%= request.getContextPath() %>/styles/combined.css">
    <link rel="stylesheet" type="text/css" media="print,screen" href="<%= webResourceManagerPrintable.getStaticResourcePrefix(String.valueOf(lookAndFeelBeanPrintable.getVersion())) %>/styles/global.css">
    <%-- Ensure that the printable style sheet is last so it overrides the previous styles --%> 
    <link rel="stylesheet" type="text/css" media="print,screen" href="<%= request.getContextPath() %>/styles/combined-printable.css">
    <script language="JavaScript" type="text/javascript" src="<%=request.getContextPath()%>/includes/js/combined-javascript.js"></script>
</head>

<body bgcolor="ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="<%= linkColour %>" vlink="<%= linkColour %>" alink="<%= linkAColour %>">

	<table border=0 cellpadding=2 cellspacing=0 width=100% bgcolor=ffffff>
	<tr><td> &nbsp; <b><a href="#" onClick="javascript:history.go(-1); ">&lt;&lt; <webwork:text name="'common.concepts.back.to.previous.view'"/></a></b></td></tr>
	<tr><td bgcolor="003366"><img src="<%= request.getContextPath() %>/images/border/spacer.gif" height=1 width=1></td></tr>
	</table>
    <div id="printableBody">
        <decorator:body />
    </div>
<script language="JavaScript" type="text/javascript">
<!--
    <%-- Javascript to prevent links from working under this view. The bestest of solution would be to filter this through a servelt that strips all the anchor tags.. If it's *that* important --%>
    var printableBody = document.getElementById("printableBody");
    var anch = printableBody.getElementsByTagName("A");
    for(i=0;i<anch.length;i++)
    {
        anch[i].href = '';
        anch[i].onclick = '';
        anch[i].removeAttribute('href');
    }

    var tds = printableBody.getElementsByTagName("TD");
    for(i=0;i<tds.length;i++)
    {
        if(tds[i].onclick)
        {
            tds[i].onclick = '';
        }
    }
//-->
</script>

</body>
</html>