// Created & Produced by Blossom Hill Web Design
function openWinFull(url,newName,width,height,left,top,directories,location,menubar,scrollbars,status,toolbar,resizable,channelmode,dependent,fullscreen,orgName)
  {
  var newFeatures =
         'width='        + width +
         ',height='      + height +
		 ',screenX='     + left +
		 ',left='        + left +
		 ',screenY='     + top +
		 ',top='         + top +
         ',directories=' + directories +
         ',location='    + location +
         ',menubar='     + menubar +
         ',scrollbars='  + scrollbars +
         ',status='      + status +
         ',toolbar='     + toolbar +
         ',resizable='   + resizable +
         ',channelmode=' + channelmode +
         ',dependent='   + dependent +
         ',fullscreen='  + fullscreen;

  var remote = doOpenWin(url, newName, newFeatures, orgName);
  return remote;
  }

function doOpenWin(newURL, newName, newFeatures, orgName)
  {
  var remote = open(newURL, newName, newFeatures);
  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = orgName;
  remote.focus();
  return remote;
  }

// Do a quick popup windoiw positioned at 50, 50
// Parameters: Url, windowname, width,height,scroll (0=off, 1=on)
function popupQuick(url,newName,width,height,scroll)
  {
  var remote = openWinFull(url,newName,width,height,50,50,0,0,0,scroll,0,0,0,0,0,0,"mainWin");
  return remote;
  }

// Popup window with positioning  
function popup(url,newName,width,height,left,top,scroll)
  {
  var remote = openWinFull(url,newName,width,height,left,top,0,0,0,scroll,0,0,0,0,0,0,"mainWin");
  return remote;
  }

// Popup window auto centered on page  
function popupCentre(url,newName,width,height,scroll)
  {
  var winW = 480, winH = 340;
  winW = (document.layers) ? window.innerWidth : document.body.clientWidth;
  winH = (document.layers) ? window.innerHeight : document.body.clientHeight; 
  var left = (winW-width)/2, top = (winH-height)/2;
  var remote = openWinFull(url,newName,width,height,left,top,0,0,0,scroll,0,0,0,0,0,0,"mainWin");
  return remote;
  }

// Popup window at position on screen  
// Values of pos:
//     topleft, topright, bottomleft, bottomright, topcentre, bottomcentre, leftcentre, rightcentre, centre
function popupScreen(url,newName,width,height,scroll,pos)
  {
  var winW = 480, winH = 340;
  var left = 50, top = 50;
  if (document.all || document.layers)
    {
    winW = screen.availWidth;
    winH = screen.availHeight;
    }
  switch (pos)
    {
	case "topleft":
	  left = 0;
	  top = 0;
	  break;
	case "topright":
	  left = winW - width;
	  top = 0;
	  break;
	case "bottomleft":
	  left = 0;
	  top = winH - height;
	  break;
	case "bottomright":
	  left = winW - width;
	  top = winH - height;
	  break;
	case "topcentre":
	  left = (winW - width)/2;
	  top = 0;
	  break;
	case "bottomcentre":
	  left = (winW - width)/2;
	  top = winH - height;
	  break;
	case "leftcentre":
	  left = 0;
	  top = (winH - height)/2;
	  break;
	case "rightcentre":
	  left = winW - width;
	  top = (winH - height)/2;
	  break;
	case "centre":
	  left = (winW - width)/2;
	  top = (winH - height)/2;	
	  break;
	}
  var remote = openWinFull(url,newName,width,height,left,top,0,0,0,scroll,0,0,0,0,0,0,"mainWin");
  return remote;
  }



