﻿    // NAME: addAddressBookUser
    // PURPOSE: insert userEmail from address book into the appropriate to/cc/bcc field 
    function addAddressBookUser(userEmail, insertInto)
    {
        var controlClientID = "ctl00_BodyZone_" + insertInto + "_emailTextBox";
        
        var insertIntoTextBox = document.getElementById(controlClientID);
        if(insertIntoTextBox)
        {
            if(insertIntoTextBox.value == "")
            {
                insertIntoTextBox.value = userEmail;
            } else {
                if(insertIntoTextBox.value.search(userEmail) == -1)
                    insertIntoTextBox.value = insertIntoTextBox.value + "," + userEmail;
            }
        } 
    }

    // NAME: errorMessagePop
    // PURPOSE: open error message popup
    function errorMessagePop(errorType)
    {
        tb_open_new('ErrorPopup.aspx?errorType=' + errorType + '&TB_iframe=true&height=160&width=315&modal=true');
        //hiding the overflow for thickbox window, fixes display problems with firefox
        var iFrameWindow = document.getElementById('TB_iframeContent');
        if(iFrameWindow)
            iFrameWindow.style.overflow = "hidden";
    }
  
  
    // NAME: showProgressBar
    // PURPOSE: show progress bar popup, waits in the event a server side error occurs
    function showProgressBar(path)
    {
        // This method is called by the "setTimeout()" after submitting a form.
        // we delay by 1 second because for small or fast file uploads there is
        // no point in showing the "please wait" message.
        setTimeout("showLoadingAnimation('" + path +"');", 1);
    }	

    // NAME: showLoadingAnimation
    // PURPOSE: shows the progress bar div used for popup animation
    function showLoadingAnimation(path)
    {
        tb_open_new('#TB_inline?height=155&width=300&inlineId=modalWaitBody&modal=true');
    }
        
