﻿//Author: Kishore Gorjala
var popWin = null;

function OpenPopUp(pageName,windowName,width,height,pos,queryString,scrollbar)
{
    var status      = "no";
    var toolbar     = "no";
    //var scrollbar   = "no";
    var menubar     = "no";
    var resizable   = "auto";
    var directories = "yes";
    var posLeft     = 0;
    var posTop      = 25;
    var windowstring;
    if(pos=="random"){posLeft=(screen.width)?Math.floor(Math.random()*(screen.width-width)):100;posTop=(screen.height)?Math.floor(Math.random()*((screen.height-height)-75)):100;}
    if(pos=="center"){posLeft=(screen.width)?(screen.width-width)/2:100;posTop=(screen.height)?(((screen.height-height)/2)- 100):100;}
    else if((pos!="center" && pos!="random") || pos==null){posLeft=0;posTop=25}
    //
    windowstring = "'toolbar=" + toolbar + ",status=" + status + ",menubar=" + menubar;
    windowstring += ",resizable=" + resizable + ",scrollbars=" + scrollbar + ",directories=" + directories;
    windowstring += ",left=" + posLeft + ",top=" + posTop + ",location=no";
    if (width != 0 && height != 0)
    {
        windowstring += ",width=" + width + ",height=" + height + "'";
    }
    if(popWin != null)
    {
        if(!popWin.closed)
        {
            popWin.close();
        }
    }
    popWin = window.open(pageName, windowName, windowstring);
    popWin.focus();
}
function ClosePopUp()
{
    popWin.close();
}
//kigo

function MyAccessUPS(url) {
  var status      = "yes";
  var toolbar     = "yes";
  var scrollbar   = "yes";
  var menubar     = "yes";
  var resizable   = "auto";
  var directories = "yes";
  var width       = 800;
  var height      = 500;
  var windowstring;
  var myaccesswin;
  windowstring = "'toolbar=" + toolbar + ",status=" + status + ",menubar=" + menubar + ",";
  windowstring += "resizable=" + resizable + ",scrollbars=" + scrollbar + ",directories=" + directories + ",";
  windowstring += "width=" + width + ",height=" + height + "'";
  if(myaccesswin != null){if(!myaccesswin.closed){myaccesswin.close();}}
  myaccesswin = window.open(url, 'UPS', windowstring);
  myaccesswin.focus();
}
function MyAccessTrackUpsHTML(trackingnumber) {

  var url = "BrochuresUPSTracking.aspx?TrackingNumber=" + trackingnumber; 
  
  var status      = "yes";
  var toolbar     = "no";
  var scrollbar   = "yes";
  var menubar     = "no";
  var resizable   = "auto";
  var directories = "no";
  var width       = 585;
  var height      = 500;
  var windowstring;
  var myaccesswin;
  windowstring = "'toolbar=" + toolbar + ",status=" + status + ",menubar=" + menubar + ",";
  windowstring += "resizable=" + resizable + ",scrollbars=" + scrollbar + ",directories=" + directories + ",";
  windowstring += "width=" + width + ",height=" + height + "'";
  if(myaccesswin != null){if(!myaccesswin.closed){myaccesswin.close();}}
  myaccesswin = window.open(url, 'UPS', windowstring);
  myaccesswin.focus();
  
}