﻿function growForDatePickers()
{
    if (!pscIsExpanded)
    {
        g_oPscContainer.style.height = (g_oPscContainer.offsetHeight + 100) + "px";
        g_oPscContainer.style.width = (g_oPscContainer.offsetWidth + 60) + "px";
        g_bDatePickersVisible = true; /* Disable auto-sizing of PSC containers */
    }
}

function shrinkForDatePickers()
{
    if (!pscIsExpanded)
    {
        g_oPscContainer.style.height = (g_oPscContainer.offsetHeight - 100) + "px";
        g_oPscContainer.style.width = (g_oPscContainer.offsetWidth - 60) + "px";
        g_bDatePickersVisible = false; /* Enable auto-sizing of PSC containers */
    }
}

/************************************/

function growIframe(targetObj, w, h)
{
    if (!pscIsExpanded && targetObj.tagName.toLowerCase() == "iframe")
    {
        targetObj.style.height = (targetObj.offsetHeight + h) + "px";
        targetObj.style.width = (targetObj.offsetWidth + w) + "px";
    }
}

function shrinkIframe(targetObj, w, h)
{
    if (!pscIsExpanded && targetObj.tagName.toLowerCase() == "iframe")
    {
        targetObj.style.height = (targetObj.offsetHeight - h) + "px";
        //160 = width of pscContainer iframe
        if(targetObj.offsetWidth - w > 160){
            targetObj.style.width = (targetObj.offsetWidth - w) + "px";
        } 
    }
}