function resizeContent()
{
    var l_intViewportHeight;
    var l_intViewportWidth;
    var l_objBackgroundDiv = document.getElementById('Background');
    var l_objContentDiv = document.getElementById('MainContainer');
     
     // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    if (typeof window.innerWidth != 'undefined')
    {
        l_intViewportWidth = window.innerWidth;
        l_intViewportHeight = window.innerHeight;
    }     
    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
    {
        l_intViewportWidth =  document.documentElement.clientWidth;
        l_intViewportHeight = document.documentElement.clientHeight;
    }
    // older versions of IE
    else
    {
        l_intViewportWidth = document.getElementsByTagName('body')[0].clientWidth
        l_intViewportHeight = document.getElementsByTagName('body')[0].clientHeight
    }
 
    var l_intBackgroundWidth = l_objBackgroundDiv.offsetWidth;
    var l_intContentWidth = l_objContentDiv.offsetWidth;
    
    if (l_intViewportWidth >= l_intContentWidth && l_intViewportWidth < 1219){
        l_objBackgroundDiv.style.width = l_intViewportWidth + 'px';
    }else{
        l_objBackgroundDiv.style.width = l_intBackgroundWidth + 'px';
    }
    
    var l_intBackgroundHeight = l_objBackgroundDiv.offsetHeight;
    var l_intContentHeight = l_objContentDiv.offsetHeight;
    
    if (l_intViewportHeight >= l_intBackgroundHeight){
        l_objBackgroundDiv.style.height = l_intViewportHeight + 'px';
    }else if (l_intBackgroundHeight == l_intContentHeight){
        l_objBackgroundDiv.style.height = (l_intBackgroundHeight + 20) + 'px';
    }else{
        l_objBackgroundDiv.style.height = l_intBackgroundHeight + 'px';
    }
    
}
function changeLinkImage(p_objAnchor)
{
    var l_objChildren = p_objAnchor.childNodes;
    for(var i=0;i<l_objChildren.length;i++){
        if (l_objChildren[i].src){
            if (l_objChildren[i].src.indexOf('/Images/Arrow.jpg') != -1){
                l_objChildren[i].src = '/Images/Ball.jpg';
            }else if (l_objChildren[i].src.indexOf('/Images/Ball.jpg') != -1){
                l_objChildren[i].src = '/Images/Arrow.jpg';
            }
        }
    }
}

function addInputSubmitEvent(l_objForm, l_objInput) {
    l_objInput.onkeydown = function(e) {
        e = e || window.event;
        if (e.keyCode == 13) {
            l_objForm.submit();
            return false;
        }
    };
}

window.onload = function() {
    var l_objForms = document.getElementsByTagName('form');

    for (var i=0;i < l_objForms.length;i++) {
        var l_objInputs = l_objForms[i].getElementsByTagName('input');

        for (var n=0;n < l_objInputs.length;n++){
            addInputSubmitEvent(l_objForms[i], l_objInputs[n]);
        }
    }
};

function submitForm(p_strForm) {
    eval(p_strForm+'.submit()');
}