// Open a window
function MM_openBrWindow(theURL,winName,features) { //v2.0

    topPos = 0;
    leftPos = 0;

    if (screen)
    {
        leftPos = (screen.width / 2) - 200;
        topPos  = (screen.height / 2) - 340;
    }

    window.open(theURL,winName,features+"left="+leftPos+",top="+topPos);
}

/* Set this variable to true if the popup windows are supposed to be full
 * screen. This will disregard the image's height and width. Set it to
 * false if it should honor the height and width of the given image.
 */
var SHOW_POPUP_FULL_SCREEN = true;

function OpenArtPopup(theUrl,winName,img_size_x,img_size_y) {
    topPos = 0;
    leftPos = 0;

    if (screen)
    {
        if (SHOW_POPUP_FULL_SCREEN)
        {
            img_size_x = screen.width;
            img_size_y = screen.height;
        }
        else
        {
            leftPos = (screen.width / 2) - ((img_size_x + 50) / 2);
            topPos  = (screen.height / 2) - ((img_size_y + 50) / 2);
        }
    }

    features = 'scrollbars=yes'
             +',width='+(img_size_x+100)
             +',height='+(img_size_y+100)
             +',left='+leftPos
             +',top='+topPos
             +',resizable=yes';

//alert(theUrl);
//alert(winName);
//alert(features);

    newWindow = window.open(theUrl,winName,features);
    newWindow.focus();
}

function PopupPurchaseInfo() {

    theUrl = '/purchaseinfo.php';
    winName = ''; //'Purchasing from GreenHouse Studio';

    leftpos = 0;
    toppos  = 0;

    contact_width  = 600;
    contact_height = 700;

    if (screen)
    {
        leftPos = (screen.width / 2) - (contact_width / 2);
        topPos  = (screen.height / 2) - (contact_height / 2);
    }

    features = 'scrollbars=yes'
             +',width='+contact_width
             +',height='+contact_height
             +',left='+leftPos
             +',top='+topPos
             +',resizable=yes';

    newWindow = window.open(theUrl,winName,features);
    newWindow.focus();
}

function OpenPopupCenter(theUrl, winName, height, width) {

    leftpos = 0;
    toppos  = 0;

    contact_width  = width;
    contact_height = height;

    if (screen)
    {
        leftPos = (screen.width / 2) - (contact_width / 2);
        topPos  = (screen.height / 2) - (contact_height / 2);
    }

    features = 'scrollbars=yes'
             +',width='+contact_width
             +',height='+contact_height
             +',left='+leftPos
             +',top='+topPos
             +',resizable=yes';


/*
alert(theUrl);
alert(winName);
alert(features);
*/
    newWindow = window.open(theUrl,winName,features);
    newWindow.focus();
}

