<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Summary.ascx.cs" Inherits="bitrix_install_Summary" %>
<script type="text/javascript">
window['<%= ClientID %>_OldValidationSummaryOnSubmit'] = (typeof(ValidationSummaryOnSubmit) == "function") ? ValidationSummaryOnSubmit : null;
window['ValidationSummaryOnSubmit'] = function(validationGroup) 
{
    if (window['<%= ClientID %>_OldValidationSummaryOnSubmit'] != null)
		window['<%= ClientID %>_OldValidationSummaryOnSubmit'](validationGroup);
    
    if (typeof(Page_ValidationSummaries) == "undefined")
        return;
    var summary, sums, s;
    for (sums = 0; sums < Page_ValidationSummaries.length; sums++) 
    {
        summary = Page_ValidationSummaries[sums];
        if (summary.id != "<%= ClientID %>")
			continue;
			
        summary.style.display = "none";
        if (Page_IsValid || !IsValidationGroupMatch(summary, validationGroup))
			return;
        
        var errorHtml = '';
        
        for (var i=0; i<Page_Validators.length; i++) 
        {
			if (Page_Validators[i].isvalid || typeof(Page_Validators[i].errormessage) != "string")
				continue;
			
			var msgHtml = Page_Validators[i].errormessage;
			if (errorHtml.length > 0)
				errorHtml += "<br/>";
			errorHtml += msgHtml;
        }
        
        if (errorHtml.length == 0)
			return;
			
		var errorContainers = summary.getElementsByTagName("font");
		for(var i = 0; i < errorContainers.length; i++)
		{
			if (errorContainers[i].className != "error_text")
				continue;
				
			errorContainers[i].innerHTML = errorHtml;
		}
		
		summary.style.display = "";
    }
}
</script>
<%
	bool inError;
	string[] errors = GetErrorMessages(out inError);
%>
<% if (false) { %><asp:PlaceHolder runat="server" ID="ErrorValidators" /><% } %>
<div id="<%= ClientID %>"<% if (!inError) { %> style="display: none"<% } %>>
	<table width="100%" cellspacing="0" cellpadding="2" border="0" bgcolor="#e6f1f9" style="border: 1px solid rgb(216, 232, 244);">
        <tbody>
            <tr>
                <td width="0%">
                    <img width="19" height="19" border="0" align="left" src="images/error.gif" /></td>
                <td width="100%">
                    <font class="error_text"><% if (inError) { %><%= string.Join("<br/>", errors) %><% } %></font>
                </td>
            </tr>
        </tbody>
    </table>
</div>