#######################################################################
# This software has been created by Genome Research Limited (GRL).    # 
# GRL hereby grants permission to use, copy, modify and distribute    # 
# this software and its documentation for non-commercial purposes     # 
# without fee at the user's own risk on the basis set out below.      #
# GRL neither undertakes nor accepts any duty whether contractual or  # 
# otherwise in connection with the software, its use or the use of    # 
# any derivative, and makes no representations or warranties, express #
# or implied, concerning the software, its suitability, fitness for   #
# a particular purpose or non-infringement.                           #
# In no event shall the authors of the software or GRL be responsible # 
# or liable for any loss or damage whatsoever arising in any way      # 
# directly or indirectly out of the use of this software or its       # 
# derivatives, even if advised of the possibility of such damage.     #
# Our software can be freely distributed under the conditions set out # 
# above, and must contain this copyright notice.                      #
#######################################################################
#! /usr/local/bin/perl
#######################################################################
#                                                                     #
# THIS MODULE CONTAINS VARIOUS FUNCTIONS USED BY DODO.                #
# THESE FUNCTIONS ARE FOR USED BY DNA PREP TO PRINT WORKSHEETS ETC    #
# NOT AVAILABLE TO FINGER PRINTERs                                         #
#                                                                     #
#######################################################################
#use lib '/nfs/disk65/bsw/dev/database/',
#	'/nfs/disk65/bsw/dev/DNAprep/',
#	'/nfs/disk65/bsw/dev/selector/';

use dodo-LB_P001;
use strict;
use Tk;
use NewBrowseEntry;
use vars qw(@ISA);
@ISA = qw(Labreport);

my $select = Labreport->new();
$select->Initialisedb();

if($select->Connect_To_DB() == 0)
{
tie *STDERR,'Utilities',$select->{Mainwin};
if(($ARGV[0])&&($ARGV[1])&&($ARGV[2]))
	{$select->Logon($ARGV[0],$ARGV[1],$ARGV[2]);}
elsif(($ARGV[0])&&($ARGV[1]))
	{$select->Logon($ARGV[0],$ARGV[1]);}
elsif($ARGV[0])
	{$select->Logon($ARGV[0]);}
else
	{$select->Logon();}
my $main = new MainWindow;

$select->Topwindow($main);
$select->{Mainwin}->minsize(590, 307); 
$select->{Mainwin}->maxsize(590, 307);
$select->{Mainwin}->geometry("1x1+10+490");
$select->{Mainwin}->title("(F5) DODO Laboratory Reporter");
$select->Display();


if($ARGV[3])
	{
	if(kill 0 => $ARGV[3])
		{kill 9 => $ARGV[3];}
	}
MainLoop;
}
