#!/usr/bin/perl
#
# Merge html files into one so that MSWord can read
# it and generate a ps file.
#

$file = $ARGV[0];                     # Name the file

open(INFO, "<$file" ) ;               # Open the file
@lines = <INFO> ;                     # Read it into an array
close(INFO) ;                         # Close the file


foreach $line (@lines)                # assign @lines to $line, one at a time
{                                     # braces {} are required, bracket code

  $line =~ s#"../../../../resources/#"../../../resources/#;

  if ($line =~ "IMG SRC")
  {
    $line =~ s#"../../../../Welcome/#"../../../Welcome/#g;
  }

    $line =~ s#"physicsProcessHAD.src/img1.gif"#"../html/PracticalApplications/physicsProcessHAD.src/img1.gif"#g;

    $line =~ s#"wwconcept.gif"#"../html/Fundamentals/wwconcept.gif" width=550#g;

    $line =~ s#"geometry.src/aBox.jpg"#"../html/Detector/geometry.src/aBox.jpg"#g;

    $line =~ s#"geometry.src/aTubs.jpg"#"../html/Detector/geometry.src/aTubs.jpg"#g;

    $line =~ s#"geometry.src/aCons.jpg"#"../html/Detector/geometry.src/aCons.jpg"#g;

    $line =~ s#"geometry.src/aPara.jpg"#"../html/Detector/geometry.src/aPara.jpg"#g;

    $line =~ s#"geometry.src/aTrap.jpg"#"../html/Detector/geometry.src/aTrap.jpg"#g;

    $line =~ s#"geometry.src/aTrd.jpg"#"../html/Detector/geometry.src/aTrd.jpg"#g;

    $line =~ s#"geometry.src/aSphere.jpg"#"../html/Detector/geometry.src/aSphere.jpg"#g;

    $line =~ s#"geometry.src/aOrb.jpg"#"../html/Detector/geometry.src/aOrb.jpg"#g;

    $line =~ s#"geometry.src/aTorus.jpg"#"../html/Detector/geometry.src/aTorus.jpg"#g;

    $line =~ s#"geometry.src/aBREPSolidPCone.jpg"#"../html/Detector/geometry.src/aBREPSolidPCone.jpg"#g;

    $line =~ s#"geometry.src/aBREPSolidPolyhedra.jpg"#"../html/Detector/geometry.src/aBREPSolidPolyhedra.jpg"#g;

    $line =~ s#"geometry.src/aEllipticalTube.jpg"#"../html/Detector/geometry.src/aEllipticalTube.jpg"#g;

    $line =~ s#"geometry.src/aEllipsoid.jpg"#"../html/Detector/geometry.src/aEllipsoid.jpg"#g;

    $line =~ s#"geometry.src/aEllipticalCone.jpg"#"../html/Detector/geometry.src/aEllipticalCone.jpg"#g;

    $line =~ s#"geometry.src/aHyperboloid.jpg"#"../html/Detector/geometry.src/aHyperboloid.jpg"#g;

    $line =~ s#"geometry.src/aTet.jpg"#"../html/Detector/geometry.src/aTet.jpg"#g;

    $line =~ s#"geometry.src/aTwistedBox.jpg"#"../html/Detector/geometry.src/aTwistedBox.jpg"#g;

    $line =~ s#"geometry.src/aTwistedTrap.jpg"#"../html/Detector/geometry.src/aTwistedTrap.jpg"#g;

    $line =~ s#"geometry.src/aTwistedTrd.jpg"#"../html/Detector/geometry.src/aTwistedTrd.jpg"#g;

    $line =~ s#"geometry.src/aTwistedTubs.jpg"#"../html/Detector/geometry.src/aTwistedTubs.jpg"#g;

    $line =~ s#"geometry.src/cad-tess1.jpg"#"../html/Detector/geometry.src/cad-tess1.jpg"#g;

    $line =~ s#"geometry.src/cad-tess2.jpg"#"../html/Detector/geometry.src/cad-tess2.jpg"#g;

    $line =~ s#"geometry.src/avex1.jpg"#"../html/Detector/geometry.src/avex1.jpg"#g;

    $line =~ s#"geometry.src/avex2.jpg"#"../html/Detector/geometry.src/avex2.jpg"#g;

    $line =~ s#"geometry.src/avpic.jpg"#"../html/Detector/geometry.src/avpic.jpg"#g;

    $line =~ s#"geometry.src/geomtest.gif"#"../html/Detector/geometry.src/geomtest.gif"#g;

    $line =~ s#"geometry.src/DAVID_SAMPLE.gif"#"../html/Detector/geometry.src/DAVID_SAMPLE.gif"#g;

    $line =~ s#"electroMagneticField.src/electroMagneticField.gif"#"../html/Detector/electroMagneticField.src/electroMagneticField.gif"#g;

    $line =~ s#"electroMagneticField.src/MissDistance.jpg"#"../html/Detector/electroMagneticField.src/MissDistance.jpg" width=550#g;

    $line =~ s#"electroMagneticField.src/IntersectionError.jpg"#"../html/Detector/electroMagneticField.src/IntersectionError.jpg"#g;

    $line =~ s#"hit.src/RO.gif"#"../html/Detector/hit.src/RO.gif"#g;

    $line =~ s#"persistency.src/GeomDBsolid3.gif"#"../html/Detector/persistency.src/GeomDBsolid3.gif"#g;

    $line =~ s#"persistency.src/pobject.gif"#"../html/Detector/persistency.src/pobject.gif"#g;

    $line =~ s#"persistency.src/UsingODBMS.gif"#"../html/Detector/persistency.src/UsingODBMS.gif"#g;

    $line =~ s#"persistency.src/schema.gif"#"../html/Detector/persistency.src/schema.gif"#g;

    $line =~ s#"persistency.src/schema2.gif"#"../html/Detector/persistency.src/schema2.gif"#g;

    $line =~ s#"physicsProcessPARAM.src/ComponentsWithRegion.gif"#"../html/TrackingAndPhysics/physicsProcessPARAM.src/ComponentsWithRegion.gif"#g;
    $line =~ s#"visualization.src/gagtree.jpg"#"../html/Visualization/visualization.src/gagtree.jpg" height=423 width=550#g;

    $line =~ s#"visualization.src/xmlnp.gif"#"../html/Visualization/visualization.src/xmlnp.gif"#g;

    $line =~ s#"visualization.src/xmlnpfind.gif"#"../html/Visualization/visualization.src/xmlnpfind.gif"#g;

  print "$line" ;    # print formatted lines to screen 
}

#
# DONE
#


