function popup_details(url, height)
{
  var default_height = 380;
  window.open(url,'connies_details','width=380,height=380,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');

}

function popup_details_better(url, height)
{
// outer border includes a six-pixel pad, so we add 12 to dimensions
  win = window.open(url,'connies_details','innerwidth=372, innerheight=200, toolbar=0, location=0, directories=0, status=1, menubar=0, copyhistory=0, resizable=0, scrolbars=0, alwaysRaised=1');
  if (win.focus) {win.focus()};
  return false;
}


//untested:
function connies_SetWindowSize(winWidth,winHeight)
{
  var d=document;
  if (typeof window.innerWidth!='undefined')
    {
      window.innerWidth = winWidth;
      window.innerHeight = winHeight;
    }
  else
    {
      if (d.documentElement &&
	  typeof d.documentElement.clientWidth!='undefined' &&
	  d.documentElement.clientWidth!=0)
	{
	  d.documentElement.clientWidth = winWidth;
	  d.documentElement.clientHeight = winHeight;
	}
      else
	{
	  if (d.body && typeof d.body.clientWidth!='undefined')
	    {
	      d.body.clientWidth = winWidth;
	      d.body.clientHeight = winHeight;
	    }
	}
    }
}


//================================================
// http://www.howtocreate.co.uk/perfectPopups.html
//================================================

function getRefToDivMod( divID, oDoc ) {
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
    if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
      for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
        y = getRefToDivMod(divID,oDoc.layers[x].document); }
      return y; } }
  if( document.getElementById ) { return oDoc.getElementById(divID); }
  if( document.all ) { return oDoc.all[divID]; }
  return document[divID];
}

// not used here
function openPerfectPopup(oW,oTitle,oContent) {
  var x = window.open('','windowName','width=500,height=400,resizable=1');
  if( !x ) { return true; }
  x.document.open();
  x.document.write('<html><head><title>'+oTitle+'<\/title><\/head><body>'+
		   (document.layers?('<layer left="0" top="0" width="'+oW+'" id="myID">')
		    :('<div style="position:absolute;left:0px;top:0px;display:table;width:'+oW+'px;" '+
		      'id="myID">'))+
		   oContent+(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
  x.document.close();
  var oH = getRefToDivMod( 'myID', x.document ); if( !oH ) { return false; }
  var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
  x.resizeTo( oW + 200, oH + 200 );
  var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
  if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
  else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
  else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
  if( window.opera && !document.childNodes ) { myW += 16; }
  x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );
  if( x.focus ) { x.focus(); }
  return false;
}


// another function from http://www.howtocreate.co.uk/perfectPopups.html
/* If the window is already open, and you want to resize it to fit its contents, the process is the same as before, without the opening and writing parts. Many browsers do not allow resizing if the window is maximised. Again, I recommend using an absolutely positioned DIV. The window must not be resized until the page has completed loading: */

function resizeWinTo( idOfDiv ) {
  var oH = getRefToDivMod( idOfDiv ); 
  if( !oH ) { return false; }
  var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
  var oH = oH.clip ? oH.clip.height : oH.offsetHeight; 
  if( !oH ) { return false; }
  var x = window; x.resizeTo( oW + 200, oH + 200 );
  var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
  if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
  else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
  else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
  if( window.opera && !document.childNodes ) { myW += 16; }
  x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );
}

function resizeWinToPLUS( idOfDiv, additionalWidth ) {
  var oH = getRefToDivMod( idOfDiv ); 
  if( !oH ) { return false; }
  var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
  var oH = oH.clip ? oH.clip.height : oH.offsetHeight; 
  if( !oH ) { return false; }
  var x = window; x.resizeTo( oW + 500, oH + 500 );
  var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
  if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
  else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
  else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
  if( window.opera && !document.childNodes ) { myW += 16; }
  x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );
}
