<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:template name="uiWarning">
        <!-- type = 'error' | 'danger-warning' | 'warning' | 'success' | 'info' -->
        <xsl:param name="type" select="'info'" />
        <xsl:param name="title" select="''"/>
        <xsl:param name="description" />
        <xsl:param name="descriptionId" select="''" />
        <xsl:param name="id" />
        <xsl:param name="className" select="''" />
        <xsl:param name="hidden" select="'false'" />
        <xsl:param name="showDismiss" select="'false'" />
        <xsl:param name="noIcon" select="'false'" />

        <div class="Warning" id="{$id}">
            <xsl:attribute name="class">
                <xsl:text>Warning Warning-type-</xsl:text><xsl:value-of select="$type" />
                <xsl:if test="$hidden = 'true'">
                    <xsl:text> Warning-hidden</xsl:text>
                </xsl:if>
                <xsl:if test="$className != ''">
                    <xsl:text> </xsl:text><xsl:value-of select="$className" />
                </xsl:if>
            </xsl:attribute>
            <xsl:if test="$noIcon = 'false'">
                <div class="Warning-icon-wrapper">
                    <xsl:call-template name="icon">
                        <xsl:with-param name="size" select="'big'" />
                        <xsl:with-param name="type">
                            <xsl:choose>
                                <xsl:when test="$type = 'error'">
                                    <xsl:text>attention</xsl:text>
                                </xsl:when>
                                <xsl:when test="$type = 'danger-warning'">
                                    <xsl:text>attention</xsl:text>
                                </xsl:when>
                                <xsl:when test="$type = 'warning'">
                                    <xsl:text>attention</xsl:text>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:text>complete</xsl:text>
                                </xsl:otherwise>
                            </xsl:choose>
                        </xsl:with-param>
                    </xsl:call-template>
                </div>
            </xsl:if>
            <div class="Warning-content">
                <div class="Warning-title">
                    <xsl:choose>
                        <xsl:when test="$title != ''">
                            <xsl:value-of select="$title" />
                        </xsl:when>
                        <xsl:when test="$type = 'error'">
                            <xsl:text>Error</xsl:text>
                        </xsl:when>
                        <xsl:when test="$type = 'danger-warning'">
                            <xsl:text>Warning</xsl:text>
                        </xsl:when>
                        <xsl:when test="$type = 'warning'">
                            <xsl:text>Warning</xsl:text>
                        </xsl:when>
                        <xsl:when test="$type = 'success'">
                            <xsl:text>Success</xsl:text>
                        </xsl:when>
                        <xsl:when test="$type = 'info'">
                            <xsl:text>Info</xsl:text>
                        </xsl:when>
                    </xsl:choose>
                </div>
                <div class="Warning-description">
                    <xsl:if test="$descriptionId != ''">
                        <xsl:attribute name="id">
                            <xsl:value-of select="$descriptionId" />
                        </xsl:attribute>
                    </xsl:if>
                    <xsl:choose>
                        <xsl:when test="$description">
                            <xsl:copy-of select="$description" />
                        </xsl:when>
                    </xsl:choose>
                </div>
            </div>
            <xsl:if test="$showDismiss = 'true'">
                <div class="Warning-dismiss">
                    <a href="javascript:void(0)" onClick="window.rsUtils.removeElement(window.rsUtils.getParentByClass(this, 'Warning'))">Dismiss Message</a>
                </div>
            </xsl:if>
        </div>

    </xsl:template>

</xsl:stylesheet>
