<%@ page import="com.atlassian.jira.config.properties.ApplicationProperties"%>
<%@ page import="com.atlassian.jira.config.properties.APKeys"%>
<%@ page import="com.atlassian.jira.ManagerFactory"%>
<%@ page import="com.atlassian.plugin.webresource.WebResourceManager"%>
<%@ page import="com.atlassian.jira.ComponentManager"%>
<%@ taglib uri="sitemesh-decorator" prefix="decorator" %>
<%@ taglib uri="sitemesh-page" prefix="page" %>
<%@ taglib uri="webwork" prefix="webwork" %>
<%-- IF YOU EDIT THIS - BE SURE TO CHECK IF YOU NEED TO EDIT DECORATORS/FRONTPAGE.JSP && popups.jsp &&  --%>
<%
ApplicationProperties headerAP = ManagerFactory.getApplicationProperties();
%>
<decorator:usePage id="originalPage" />
<%
    //this is all to ensure that the title prefix is not the same as the title.
    //See JRA-404
    String origTitle = originalPage.getTitle();
    String titlePrefix = headerAP.getDefaultBackedString(APKeys.JIRA_TITLE);
    if (origTitle != null && origTitle.equals(titlePrefix))
    {
        titlePrefix = null;
    }

    WebResourceManager webResourceManager = ComponentManager.getInstance().getWebResourceManager();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title><decorator:title default="Welcome" /><% if (titlePrefix != null) { %> - <%= titlePrefix %> <% } %></title>

    <decorator:head/>
    <META http-equiv="Content-Type" content="<%= headerAP.getContentType() %>">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    <link rel="shortcut icon" href="<%= request.getContextPath()%>/favicon.ico">
    <link rel="icon" type="image/png" href="<%= request.getContextPath()%>/images/icons/favicon.png">
	<%@ include file="/includes/decorators/stylesheettag.jsp" %>
    <script language="JavaScript" type="text/javascript" src="<%=request.getContextPath()%>/includes/js/combined-javascript.js"></script>


    <webwork:if test="/hasCalendarTranslationForLanguage == true">
        <script type="text/javascript" src="<%= webResourceManager.getStaticResourcePrefix() %>/includes/js/calendar/calendar.js"></script>
        <script type="text/javascript" src="<%= webResourceManager.getStaticResourcePrefix() %>/includes/js/calendar/lang/<webwork:property value="/calendarTranslationFilenameForLanguage"/>"></script>
        <script type="text/javascript" src="<%= webResourceManager.getStaticResourcePrefix() %>/includes/js/calendar/calendar-setup.js"></script>
        <script type="text/javascript">
            // Hack to avoid bug in jscalendar - JRA-7713
            if (!Calendar._TT["WEEKEND"]) { Calendar._TT["WEEKEND"] = "0,6";}
            if (!Calendar._TT["DAY_FIRST"]) { Calendar._TT["DAY_FIRST"] = "Display %s first";}
        </script>
    </webwork:if>

<%
    webResourceManager.includeResources(out);
%>

</head>

<%@ include file="/includes/decorators/bodytop.jsp" %>

