function iframeHeight() { 
    if(document.getElementById('inschr')) {
        document.getElementById('inschr').style.height = parseInt(document.body.scrollHeight) + 1 + 'px'; 
        document.getElementById('ContentPadding').style.paddingLeft = '18px'; 
        document.getElementById('ContentPadding').style.paddingRight = '18px'; 
    }
} 

window.onload=iframeHeight;

function ViewImage(p_strFile, p_strTarget)
{
    document.getElementById(p_strTarget).src = p_strFile;
}

function PreLoadImage(p_strImage)
{
    var l_imgPreload = new Image();
	l_imgPreloadCloseButton.src = g_strCloseButton;
}

function StartFadeImg(p_strId, p_intOpac)
{
    var l_objImg = document.getElementById('FadeImg_' + p_strId + '_0');
    
    if(l_objImg!=null) {
        l_objImg.style.filter = 'alpha(opacity=' + p_intOpac + ')';
        l_objImg.style.opacity = p_intOpac/100;
        p_intOpac = p_intOpac + 5;
        
        if(p_intOpac < 101)
        {
            setTimeout("StartFadeImg('" + p_strId + "'," +p_intOpac+ ")",70);
        }
        else if(document.getElementById('FadeImg_' + p_strId + '_1'))
        {
            var l_intStart = 0;
            var l_intNext = 0;
            
            if(document.getElementById('FadeImg_' + p_strId + '_1'))
           { 
                l_intNext = 1;
                setTimeout("FadeImg('" + p_strId + "'," + l_intStart + "," + l_intNext + ",0)", 3000);
           } 
        }
    }
}

function FadeImg(p_strId, p_intStart, p_intNext, p_intOpac)
{
    var l_objCurrentImg = document.getElementById('FadeImg_' + p_strId + '_' + p_intStart);
    var l_objNextImg = document.getElementById('FadeImg_' + p_strId + '_' + p_intNext);
    var l_intCurrentOpac = 100 - p_intOpac;
    
    l_objCurrentImg.style.filter = 'alpha(opacity=' + l_intCurrentOpac + ')';
    l_objCurrentImg.style.opacity = l_intCurrentOpac/100;
    l_objNextImg.style.filter = 'alpha(opacity=' + p_intOpac + ')';
    l_objNextImg.style.opacity = p_intOpac/100;

    p_intOpac = p_intOpac + 5;

    if(p_intOpac < 101)
    {
        setTimeout("FadeImg('" + p_strId + "'," + p_intStart + "," + p_intNext + "," + p_intOpac + ")", 70);
    }
    else
    {
        p_intStart = p_intNext;
        if(document.getElementById('FadeImg_' + p_strId + '_' + (p_intNext + 1)))
            p_intNext = p_intNext +1;
        else
            p_intNext = 0;
        setTimeout("FadeImg('" + p_strId + "'," + p_intStart + "," + p_intNext + ",0)", 5000);
    }
}

function ShowMenu(p_objThis, p_strId, p_strColor)
{
    if(document.getElementById(p_strId))
    {
        document.getElementById(p_strId).style.display = 'block';
    }
    if(p_objThis)
    {
        p_objThis.style.backgroundColor = p_strColor;
    } 
}

function HideMenu(p_objThis, p_strId, p_strColor)
{
    if(document.getElementById(p_strId))
    {
        document.getElementById(p_strId).style.display = 'none';
    }
    if(p_objThis)
    {
        p_objThis.style.backgroundColor = p_strColor;
    } 
}

function ChangeValue(p_objThis, p_strOldValue, p_strNewValue)
{
    if(p_objThis.value == p_strOldValue)
    {
        p_objThis.value = p_strNewValue;
    }
}

function ClearIf(p_objThis, p_strValue)
{
    if(p_objThis.value == p_strValue)
    {
        p_objThis.value = '';
    }
}