/*
  Swwwing JS Window Opener
  Author: Unknown
  Copyright (c) 2002 Swwwing ApS
  $Id: winopener.js,v 1.15 2005/08/30 20:27:05 frans Exp $
  $Revision: 1.15 $
  
  Note: Set type to 0 or 9 if you want to specify your own window size with p_intWidth and p_intHeight.
*/

function openWin(inURL,inType,inName,inLeft,inScroll,inResize,bReturn,p_intWidth,p_intHeight)
{
	var debug = 0
	var WinDialog
	var inType = eval(inType); 
	var intTop = 40
  if (!inLeft)
    inLeft=100;
  
  switch (inType) {
    case 1:
      intWidth=500;
      intHeight=340;
      break;
    case 2:
      intWidth=600;
      intHeight=375;
      break;
    case 3:
      intWidth=550;
      intHeight=375;
      break;
    case 4:
      intWidth=340;
      intHeight=340;
      intTop=100;
      break;
    case 5:
      intWidth=240;
      intHeight=400;
      intTop=100;
      break;
    case 6:
      intWidth=300;
      intHeight=140;
      intTop=100;
      break;
    case 7:
      intWidth=440;
      intHeight=240;
      intTop=100;
      break;
    case 8:
      intWidth=440;
      intHeight=300;
      intTop=100;
      break;
    case 10:
      intTop=100;
      break;
    case 11:
      intWidth=540;
      intHeight=370;
      intTop=100;
      break;      
    default:
      intWidth=p_intWidth
      intHeight=p_intHeight
      inScroll=1
	}

	if ( navigator.appName.indexOf("Netscape") > -1 ){
		intX = screen.availHeight / 2 - ( intHeight / 2) ;
		intY = screen.availWidth / 2 - ( intWidth / 2 );
	} else {
		intX = window.screenTop + intTop;
		intY = window.screenLeft + inLeft;
	}

	if (inName=="")
		inName="HaburiWin";

	if (debug==1)
		var strFeatures = 'width=' + intWidth + ',height=' + intHeight + ',top=' + intX + ',left=' + intY +',statusbar=1,menubar=1,toolbar=0,hotkeys=0';
	else
  {
		var strFeatures = 'width=' + intWidth + ',height=' + intHeight + ',top=' + intX + ',left=' + intY +',statusbar=0,menubar=0,toolbar=0,hotkeys=0';
	}
  if (inScroll==1)
		strFeatures += 'scrollbars=yes';
	else
		strFeatures += ',scrollbars=no';
	if (inResize == 1)
		strFeatures += ',resizable=1';
	else
		strFeatures += ',resizable=0';

	if (!WinDialog || WinDialog.closed){
		WinDialog = window.open( inURL,inName, strFeatures);
		WinDialog.focus();
	}else{
		WinDialog.close();
		WinDialog = window.open( inURL,inName, strFeatures);
		WinDialog.focus();
	}
	if (bReturn==true) {
    top.js.WinDialog=WinDialog;
	}
}

