// JavaScript File

// WebEnrollment.js
// ========================================
// This file contains the client-side script
// library used in the Real Estate Institute
// WebEnrollment project.


// infowindow is used to hold a reference to the "More Info" popup window
var infowindow;

function displayMoreInfoWindow(windowId, contentSource)
{
    infowindow = dhtmlmodal.open(windowId, 'div', contentSource, 'Additional Information', 'width=500px,height=300px,center=1,resize=0,scrolling=1'); 
    
    //return false;
}

function displayModalMessageBoxFromDiv(windowId, contentSource, windowCaption)
{
    msgwindow = dhtmlmodal.open(windowId, 'div', contentSource, windowCaption, 'width=450px,height=250px,center=1,resize=0,scrolling=1'); 
}


function displayModalMessageBoxFromDivSizable(windowId, contentSource, windowCaption, width, height)
{
    msgwindow = dhtmlmodal.open(windowId, 'div', contentSource, windowCaption, 'width=' + width + 'px,height=' + height + 'px,center=1,resize=0,scrolling=1'); 
}

function getBrowserWindowHeight()
{
    // A default value in case this coes fails in some browsers
    var myHeight = 460;

    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        myHeight = window.innerHeight;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
    }
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
    }

    return myHeight;
}

function getBrowserWindowWidth()
{
    var myWidth = 620;

    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        myWidth = window.innerWidth;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
    }
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
    }

    return myWidth;
}

