﻿var popupWindow = null;
var popupConfig = "resizable=1, menubar=0, scrollbars=1, titlebar=0, dependent=1, channelmode=true, top=0, left=0, ";
var popupWindowId = "popupWindow";

function ShowPopup( url )
{
    if( popupWindow == null || popupWindow.closed == true )
    {
        if( screen.width < 1024 )
        {
            popupWindow = open( url, popupWindowId, popupConfig + "width=750, height=600" );
        }
        else if( screen.width == 1024 )
        {
            popupWindow = open( url, popupWindowId, popupConfig + "width=750, height=650" );
        }
        else
        {
            popupWindow = open( url, popupWindowId, popupConfig + "width=750, height=700" );
        }

        popupWindow.opener = self;
    }
    else
    {
        popupWindow.location = url;
        popupWindow.focus();
    }

    return false;
}

function ShowWTFeePopup( url )
{
    popupWindow = open( url, "popupWTFee", popupConfig + "width=800, height=750" );
    popupWindow.opener = self;
}

function OpenNewBrowser( url )
{
    window.open( url );
}

function ShowPopupPolicy( url )
{
    if( screen.width < 1024 )
    {
        popupWindowPolicy = open( url, "popup_policy", popupConfig + "width=800, height=600" );
    }
    else if( screen.width == 1024 )
    {
        popupWindowPolicy = open( url, "popup_policy", popupConfig + "width=900, height=650" );
    }
    else
    {
        popupWindowPolicy = open( url, "popup_policy", popupConfig + "width=900, height=700" );
    }
}