

var centered=1;
function checkBrowser(){
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.mac=(navigator.appVersion.indexOf("Mac")!=-1)?1:0;
	this.ie5mac=(navigator.appVersion.indexOf("Mac")!=-1 && this.ie5)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie5mac);

	this.version="none";
	if (this.ie5)this.version="ie5";
	else if (this.ie6)this.version="ie6";
	else if (this.ie4)this.version="ie4";
	else if (this.ns4)this.version="ns4";
	else if (this.ns5)this.version="ns5";
        if (this.mac) this.version+=" mac"
        else this.version+=" nonmac"
	return this;
}
function openshop(windowURL,wname,w,h)
{
//alert (browser.version);
//return;

var browser=new checkBrowser();

var width;
var height;
if (w && w>10)width=w;else width="300";
if (h && h>10)height=h;else height="300";
if (browser.ns4 && !browser.mac)
  {
  width -=4;
  height-=1;
  }
else if (browser.ie6 && !browser.mac)
  {
  width=width;
  height=height;
  }
else if (browser.ie5 && browser.mac)
  {
  width -=4;
  height-=4;
  }
else if (browser.ns4 && browser.mac)
  {
  width -=0;
  height-=0;
  }

var window_left=0;
var window_top=0;
//if(document.layers || document.all){
  if (centered){
   window_left = (screen.width-width)/2;
   window_top = (screen.height-height)/2;
   }
else {
   window_left = 100;
   window_top = 100;
   }

//  }

windowName=wname;
windowFeatures="width="+width+",height="+height+",left="+window_left+",top="+window_top+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no";
newWindow =  window.open( windowURL, windowName, windowFeatures );
newWindow.focus();
}

function openWindow(windowURL,wname,w,h)
{
//alert (browser.version);
//return;

var browser=new checkBrowser();

var width;
var height;
if (w && w>10)width=w;else width="300";
if (h && h>10)height=h;else height="300";
if (browser.ns4 && !browser.mac)
  {
  width -=4;
  height-=1;
  }
else if (browser.ie6 && !browser.mac)
  {
  width=width;
  height=height;
  }
else if (browser.ie5 && browser.mac)
  {
  width -=4;
  height-=4;
  }
else if (browser.ns4 && browser.mac)
  {
  width -=0;
  height-=0;
  }

var window_left=0;
var window_top=0;
//if(document.layers || document.all){
  if (centered){
   window_left = (screen.width-width)/2;
   window_top = (screen.height-height)/2;
   }
else {
   window_left = 100;
   window_top = 100;
   }

//  }

windowName=wname;
windowFeatures="width="+width+",height="+height+",left="+window_left+",top="+window_top+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";
newWindow =  window.open( windowURL, windowName, windowFeatures );
newWindow.focus();
}

function openWindowscroll(windowURL,wname,w,h)
{
//alert (browser.version);
//return;

var browser=new checkBrowser();

var width;
var height;
if (w && w>10)width=w;else width="300";
if (h && h>10)height=h;else height="300";
if (browser.ns4 && !browser.mac)
  {
  width -=4;
  height-=1;
  }
else if (browser.ie6 && !browser.mac)
  {
  width=width;
  height=height;
  }
else if (browser.ie5 && browser.mac)
  {
  width -=4;
  height-=4;
  }
else if (browser.ns4 && browser.mac)
  {
  width -=0;
  height-=0;
  }

var window_left=0;
var window_top=0;
//if(document.layers || document.all){
  if (centered){
   window_left = (screen.width-width)/2;
   window_top = (screen.height-height)/2;
   }
else {
   window_left = 100;
   window_top = 100;
   }

//  }

windowName=wname;
windowFeatures="width="+width+",height="+height+",left="+window_left+",top="+window_top+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";
newWindow =  window.open( windowURL, windowName, windowFeatures );
newWindow.focus();
}


/*
trick 17:

<body onLoad="window.resizeTo(300,50)">
<A HREF="JavaScript:self.close();">
close
</A>
</body>
*/

