﻿/***************************\
* Greybox popup integration *
\***************************/
var GB_ROOT_DIR = '/js/greybox/';
var curID = '';

function CloseGB()
{
    GB_hide();
}

function CloseGBandPost()
{
    GB_hide();

    // based on which button was clicked
    if (curID == '')
        alert('Unknown error. Please try again.');
    else
        causePostback(curID);
}

function CloseGBandRedirect(url)
{
    if (window.top.location != window.location)
        GB_hide();

    window.location = url;

    return false;
}

function causePostback(id)
{
    eval(document.getElementById(id).href);
}

function gb_FrontEndLaunch(title, url)
{
    // scroll the window to the top of the page
    scroll(0, 0);
    // get the browser width
    var iWidth = document.body.clientWidth - 20;
    // set the GB window to use that width
    GB_show(title, url, 500, 800);
    // return false
    return false;
}
