﻿function uploadFile(e)
{
    Page_ClientValidate();
    if ( Page_IsValid )
    {
	    document.getElementById("modalBackground").className = "modalShown";
	    document.getElementById("fileUploadDialog").className = "modalShown";
    }
}
function cancelFileUpload(e)
{	
	document.getElementById("modalBackground").className = "modalHidden";
	document.getElementById("fileUploadDialog").className = "modalHidden";
}
function confirmationDialog(e)
{	
	document.getElementById("modalBackground").className = "modalShown";
	document.getElementById("confirmationDialog").className = "modalShown";
}
function cancelConfirmationDialog(e)
{
	document.getElementById("modalBackground").className = "modalHidden";
	document.getElementById("confirmationDialog").className = "modalHidden";
}
               function ieBrowser()
            {
            var ua = window.navigator.userAgent;
            var msie = ua.indexOf ( "MSIE " );

            if ( msie > 0 )
               {
               return true
               }
            else
               {
               return false;
               }
           }                  
        function ieVersion()
            {
            var ua = window.navigator.userAgent;
            var msie = ua.indexOf ( "MSIE " );

            if ( msie > 0 )      
               {
               return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));
               }
            else
               {                 
               return 0;
               }
           }   
           
                   
        function startProgress()
            {           
            Sys.Net.WebRequestManager.set_defaultTimeout(2500);
            document.getElementById('progressImage').src = document.getElementById('ApplicationRoot').value + 'image/indicator.gif';

            document.getElementById('modalBackground').className = 'modalShown';
            document.getElementById('progressDiv').className = 'modalShown';

            if (ieBrowser() && ieVersion() <= 6.5)
                {
                document.getElementById('backgroundIE6Frame').className = 'modalShown';

                document.getElementById('progressIE6Div').className = 'modalShown';
                document.getElementById('progressIE6Frame').className = 'modalShown';

                document.getElementById('progressIE6Frame').style.height = document.getElementById('progressWindow').offsetHeight + 'px';
                document.getElementById('progressIE6Frame').style.width = document.getElementById('progressWindow').offsetWidth + 'px';
                }            
            }
        function endProgress(sender, args)
            {
            
            document.getElementById('modalBackground').className = 'modalHidden';
            
            if (ieBrowser() && ieVersion() <= 6.5)
                {
                document.getElementById('backgroundIE6Frame').className = 'modalHidden';

                document.getElementById('progressIE6Div').className = 'modalHidden';
                document.getElementById('progressIE6Frame').className = 'modalHidden';
                }   
            document.getElementById('progressDiv').className = 'modalHidden';
                                   
            args.set_errorHandled(true);
            }    