function SwitchLinkToProcessing(theLink) {
    
    if (theLink != null) {

        theLink.innerHTML = '<em>Processing...</em>';
    
    }

}

function ShowPDFLinks() {

    var theDiv = document.getElementById('PDFLinks');
    if (theDiv != null)
        theDiv.style.display = 'block';
}

function hideGeneratedPDFMessage()
{

    setTimeout("document.getElementById('generatedMessage').style.display = 'none'", 3000);

}

function showElement(id) {

    var theElement = document.getElementById(id);

    if (theElement != null) {
        if (theElement.style.display == 'block')
            theElement.style.display = 'none';
        else
            theElement.style.display = 'block';
    }
}

function ToggleShowHide(theElementID, theControllerID, showMessage, hideMessage) {

    var theElement = document.getElementById(theElementID);
    var theController = document.getElementById(theControllerID);
    if (theElement != null && theController != null) {
        if (theElement.style.display == 'none') {
            theElement.style.display = 'block';
            if (hideMessage != null && hideMessage != '')
                theController.innerHTML = hideMessage;
            else
                theController.innerHTML = 'Hide';
        }
        else {
            theElement.style.display = 'none';
            if (showMessage != null && showMessage != '')
                theController.innerHTML = showMessage;
            else
                theController.innerHTML = 'Show';
        }
    }
}


function ToogleExpandBox(imageControllerID, boxID) {

    var theBox = document.getElementById(boxID);
    var theImage = document.getElementById(imageControllerID);
    if (theBox != null && theImage != null) {
        if (theBox.style.display == 'none') {
            theBox.style.display = 'block';
            theImage.src = 'http://www.rexamcatalogue.com/webpac_content/global/images/up_arrow.gif';
        }
        else {
            theBox.style.display = 'none';
            theImage.src = 'http://www.rexamcatalogue.com/webpac_content/global/images/down_arrow.gif';
        }
    }
}

function Link_ToogleExpandBox(imageControllerID, boxID) {

    var theBox = document.getElementById(boxID);
    var theImage = document.getElementById(imageControllerID);

    if (theBox != null && theImage != null) {
        if (theBox.style.display == 'none') {
            theBox.style.display = 'block';
            theImage.src = 'http://www.rexamcatalogue.com/webpac_content/global/images/up_arrow.gif';
        }
        else {
            theBox.style.display = 'none';
            theImage.src = 'http://www.rexamcatalogue.com/webpac_content/global/images/down_arrow.gif';
        }
    }
}

function fillElementValue(elementID, theValue) {
    var theElement = document.getElementById(elementID);
    if (theElement != null) {

        if (theValue != null && theValue != '') {

            theElement.value = theValue;
        }


    }
}