<%@ 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"%>
<%@ taglib uri="sitemesh-decorator" prefix="decorator" %>

<%
ApplicationProperties headerAP = ManagerFactory.getApplicationProperties();
%>

<%-- get the decorator page object, for use within the decorator --%>
<decorator:usePage id="decoratorPage" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title><decorator:title default="JIRA" /></title>
    <META http-equiv="Content-Type" content="<%= headerAP.getContentType() %>">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">

	<%@ include file="/includes/decorators/stylesheettag.jsp" %>
    <script language="JavaScript" type="text/javascript" src="<%=request.getContextPath()%>/includes/js/combined-javascript.js"></script>
<%
    WebResourceManager webResourceManager = ComponentManager.getInstance().getWebResourceManager();
    webResourceManager.includeResources(out);
%>

</head>
<%
    ApplicationProperties ap = ManagerFactory.getApplicationProperties();
    final LookAndFeelBean lookAndFeelBeanPopUps = LookAndFeelBean.getInstance(ap);
    String topBgColour = lookAndFeelBeanPopUps.getTopBackgroundColour();
    String menuBgColour = lookAndFeelBeanPopUps.getMenuBackgroundColour();
    String linkColour = lookAndFeelBeanPopUps.getTextLinkColour();
    String linkAColour = lookAndFeelBeanPopUps.getTextActiveLinkColour();

    String jiraLogo = lookAndFeelBeanPopUps.getLogoUrl();
    if (jiraLogo != null && !jiraLogo.startsWith("http://") && !jiraLogo.startsWith("https://"))
    {
        jiraLogo = request.getContextPath() + jiraLogo;
    }
%>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="<%= linkColour %>" vlink="<%= linkColour %>" alink="<%= linkAColour %>">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
<tr><td bgcolor="<%= topBgColour %>"><img src="<%= jiraLogo %>" width="<%= lookAndFeelBeanPopUps.getLogoWidth() %>" height="<%= lookAndFeelBeanPopUps.getLogoHeight() %>" border="0" alt="<%= headerAP.getDefaultBackedString(APKeys.JIRA_TITLE) %>"></td></tr>
<tr><td bgcolor="<%= menuBgColour %>"><img src="<%= request.getContextPath() %>/images/border/spacer.gif" height="5" width="1" alt=""></td></tr>
</table>

<table border="0" cellpadding="5" cellspacing="0" width="100%" bgcolor="#ffffff">
<tr><td>
		<h4 class="headline"><decorator:title /></h4>

		<decorator:body />
</td></tr>
</table>

</body>
</html>
