//	eShox 3 OS
//	http://www.eshox.com/

//	Copyright (c) 2003, Secure.cc, Inc.

//	Released under the GNU General Public License

var popupwindow = null;

function makeWindow(url, width, height, centerx, centery) {
  realwidth = self.outerWidth - self.innerWidth + width;
  realheight = self.outerHeight - self.innerHeight + height;
  method = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + realwidth + ',height=' + realheight;
  if (!document.popupwindow) {
    method += ',screenX=' + centerx + ',screenY=' + centery + ',left=' + centerx + ',top=' + centery;
  }
  document.popupwindow = window.open(url,'popupwindow',method);
  document.popupwindow.focus();
}

function removeWindow() {
  if (document.popupwindow) document.popupwindow.close();
}

function popupWindow(url) {
  url += '?' + thepics;
  makeWindow(url, 320, 240, ((window.screen.width/2) - 160), ((window.screen.height/2) - 120));
}

function popupUpload(fieldname, image) {
  url = 'popup_upload.php?field=' + fieldname;
  if (image) url += '&action=change&pngimage=' + image;
  makeWindow(url, 240, 330, ((window.screen.width/2) - 160), ((window.screen.height/2) - 90));
}

function popupOption(fieldname, product_id) {
  url = 'popup_option.php?field=' + fieldname + '&products_id=' + product_id;
  makeWindow(url, 320, 480, 20, ((window.screen.height/2) - 240));
}

function popupQTWindow(url) {
  makeWindow(url, 480, 276, ((window.screen.width/2) - 240), ((window.screen.height/2) - 138));
}
