﻿function proxies() 
{
    var width = 1024;
    var height = 768;
    //var left = parseInt((screen.availWidth / 2) - (width / 2));
    var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    //myWindow = window.open('printproxies.aspx', "Proxies", windowFeatures);
    myWindow = window.open('printproxies.aspx', "Proxies", windowFeatures);
    myWindow.focus();
}

function getQuerystring2(key, default_) 
{
    if (default_ == null) default_ = "";
    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
    var qs = regex.exec(window.location.href);
    if (qs == null)
        return default_;
    else
        return qs[1];
}

function oak(searchset, searchnumber) 
{
    var width = 1024;
    var height = 768;
    var left = parseInt((screen.availWidth / 2) - (width / 2));
    //var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    //var windowFeatures = "width=" + width + ",height=" + height + "toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var windowFeatures = "toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=no,status=yes,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;

    var url = "http://www.professor-oak.com/cardorders/searchresults.asp?set=" + searchset + "&number=" + searchnumber + "&Ref=bebessearch";

    myWindow = window.open(url, "Oak", windowFeatures);
    myWindow.focus();
}

function newwindowComboBoxMR() 
{
    var comboBoxValue = ASPxComboBoxInsertCardID.GetValue();
    if (comboBoxValue > 0) {
        imageviewerMR(comboBoxValue);
    }
}

function imageviewerMR(id) 
{
    var width = 450;
    var height = 700;

    var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "width=" + width + ",height=" + height + "toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;

    myWindow = window.open('imageviewerMR.aspx?url=' + id * 1024, "ImgVwr", windowFeatures);
    myWindow.focus();
}

function google(searchcard, searchset) 
{
    var width = 1024;
    var height = 768;
    var left = parseInt((screen.availWidth / 2) - (width / 2));
    //var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    //var windowFeatures = "width=" + width + ",height=" + height + "toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var windowFeatures = "toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=no,status=yes";
    var url = "http://www.google.com/cse?cx=partner-pub-6124746825601160%3A41oppf-bens&ie=ISO-8859-1&q=" + searchcard + "+" + searchset + "&sa=Search";

    myWindow = window.open(url, "google", windowFeatures);
    myWindow.focus();
}

function store() 
{
    var width = 1024;
    var height = 768;
    //var left = parseInt((screen.availWidth / 2) - (width / 2));
    var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "width=" + width + ",height=" + height + ",toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=no,status=yes,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open('store.htm', "Store", windowFeatures);
    myWindow.focus();
}

function mobile() 
{
    var width = 1024;
    var height = 768;
    //var left = parseInt((screen.availWidth / 2) - (width / 2));
    var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open('mobile.htm', "Mobile", windowFeatures);
    myWindow.focus();
}

function newDialog(arg) 
{
    Pokemon.Refresh();
    TSS.Refresh();
    Energy.Refresh();

    var webpage = "deckcheck.aspx";
    var windowID = "NewDialog";
    var width = 400;
    var height = 400;
    var left = parseInt(screen.availWidth - width); //var left = parseInt((screen.availWidth / 2) - (width / 2));
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "width=" + width + ",height=" + height + ",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(webpage, windowID, windowFeatures);
    myWindow.focus();
}

function DeleteDeck() 
{
    var answer = prompt("Type DELETE to delete this deck.", "");
    var answerUpper = answer.toUpperCase();

    if (answerUpper == "DELETE") {
        __doPostBack('LinkButtonConfirmDelete', '');
    }
    else {
        alert("Delete was CANCELED");
    }
}

function newwindowComboBox() 
{
    var comboBoxValue = ASPxComboBoxInsertCardID.GetValue();
    if (comboBoxValue > 0) 
    {
        var width = 440;
        var height = 625;
        //var left = parseInt((screen.availWidth / 2) - (width / 2));
        var left = parseInt(screen.availWidth - width);
        var top = parseInt((screen.availHeight / 2) - (height / 2));
        var windowFeatures = "width=" + width + ",height=" + height + ",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;

        myWindow = window.open('imageviewer.aspx?url=' + comboBoxValue * 1024, "subWind", windowFeatures);
        myWindow.focus();
    }
}

function newwindow(imageurl) 
{
    var width = 440;
    var height = 625;
    //var left = parseInt((screen.availWidth / 2) - (width / 2));
    var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "width=" + width + ",height=" + height + "toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;

    myWindow = window.open('imageviewer.aspx?url=' + imageurl * 1024, "ImgVwr", windowFeatures);
    myWindow.focus();
}

function training(url) 
{
    var width = 1024;
    var height = 768;
    var left = parseInt((screen.availWidth / 2) - (width / 2));
    //var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "width=" + width + ",height=" + height + "toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;

    myWindow = window.open(url, "Training", windowFeatures);
    myWindow.focus();
}

function ebay(searchcard, searchset) 
{
    var width = 1024;
    var height = 768;
    var left = parseInt((screen.availWidth / 2) - (width / 2));
    //var left = parseInt(screen.availWidth - width);
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    //var windowFeatures = "width=" + width + ",height=" + height + "toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var windowFeatures = "width=" + width + ",height=" + height + "toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,directories=no,status=yes,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var url = "http://shop.ebay.com/?_from=R40&_trksid=p3907.m38.l1313&_nkw=" + searchcard + "+" + searchset;

    myWindow = window.open(url, "eBay", windowFeatures);
    myWindow.focus();
}