﻿Browser = 
{
    //Check if the browser is modern
    IsModern:function()
        {
        return (typeof(document.body.style.maxHeight) != "undefined");
        }
}

function SetHeightsTo(sTarget, iHeight)
{
    if(document.getElementById(sTarget) != null)
    {
        document.getElementById(sTarget).style.height = (iHeight + 2) + 'px';
        //document.getElementById(sTarget).style.overflow = 'scroll-y';
    }
}

function goAnchor(sAnchor)
{
    sTemp = window.location.toString();
    if(sTemp.indexOf('#') == -1)
    {
        window.location = sTemp + sAnchor;
    }
    else
    {
        window.location = sTemp.substring(0, sTemp.indexOf('#')) + sAnchor;
    }
}

function Submitform(sAction)
{
    if (theForm != null)
    {
        //theForm.action =  'customs/' + sAction;
        if(document.getElementById('FormPosted') != null)
        {
            document.getElementById('FormPosted').value = 'true';
        }
        
        theForm.submit();
    }
}

function ResizeBookingFrame()
{
    //alert('offset = ' + document.body.offsetHeight);
    //alert('inner = ' + window.innerHeight);
    //alert('clientHeight = ' + document.body.clientHeight);
    //alert('scrollHeight = ' + document.body.scrollHeight);
    
    if(!Browser.IsModern())
    {
        document.getElementById('BeFrameLarge').style.height = (document.body.offsetHeight-190) + 'px';        
    }
    else
    {
        document.getElementById('BeFrameLarge').style.height = (document.body.offsetHeight-190) + 'px';
        //document.getElementById('BeFrameLarge').style.height = (window.innerHeight-190) + 'px';        
    }
}
