dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dojox.form.Rating");

var riverMap = null;
var riverLayer = null;

var f_faughan_1 = null;
var f_faughan_2 = null;
var f_finn_1 = null;
var f_finn_2 = null
var f_reelan = null
var f_mourne_1 = null;
var f_roe = null;
var ni_agivey = null;
var ni_wee_agivey = null;
var ni_clady_1 = null;
var ni_clady_2 = null;
var ni_grillagh = null;
var ni_lower_bann_1 = null;
var ni_lower_bann_2 = null;
var ni_moyola = null;
var n_crolly_gweedore = null;
var n_drowes = null;
var n_gweebarra = null;
var n_owenea = null;
var nw_bonet_1 = null;
var nw_bonet_2 = null;
var nw_easky = null;
var nw_moy_1 = null;
var nw_moy_2 = null;
var nw_moy_3 = null;
var nw_owenmore_mayo_1 = null;
var nw_owenmore_mayo_2 = null;
var w_bundorragh_delphi = null;
var w_cashla_costello = null;
var w_corrib_galway_fishery = null;
var w_erriff = null;
var e_boyne_1 = null;
var e_boyne_2 = null;
var e_boyne_3 = null;
var e_castletown_courtbane = null;
var e_fane_1 = null;
var e_fane_2 = null;
var e_fane_3 = null;
var e_slaney_1 = null;
var e_slaney_2 = null;
var sh_feale_1 = null;
var sh_feale_2 = null;
var sh_mulcair = null;
var sh_shannon_1 = null;
var sh_shannon_2 = null;
var sh_shannon_3 = null;
var sh_suck_1 = null;
var sh_suck_2 = null;
var sh_suck_3 = null;
var s_barrow_1 = null;
var s_barrow_2 = null;
var s_barrow_3 = null;
var s_colligan = null;
var s_munster_blackwater_1 = null;
var s_munster_blackwater_2 = null;
var s_munster_blackwater_3 = null;
var s_nore_1 = null;
var s_nore_2 = null;
var s_nore_3 = null;
var sw_bandon_1 = null;
var sw_bandon_2 = null;
var sw_brown_flesk = null;
var sw_roughty = null;
var sw_sheen = null;

getRiverMap = function (mainMap)
{
  var longitude = null;
  var latitude = null;
  var zoom = null;
  var targetDiv = null;
  
  if (mainMap)
  {
    longitude = "53.40953185308644";
    latitude = "-7.921142578125009";
    zoom = 7;
    targetDiv = "si_mapMainPanel";
  }
  else
  {
    longitude = document.getElementById("longitude").innerHTML;
    latitude = document.getElementById("latitude").innerHTML;
    zoom = 11;
    targetDiv = "si_riverMap";
  }
  
  riverMap = new VEMap(targetDiv);
  riverMap.SetDashboardSize(VEDashboardSize.Tiny);
  riverMap.LoadMap();
  
  createLayer();
  
  addFFaughan ();
  addFFinn ();
  addFMourne ();
  addFRoe ();
  addNIAgivey ();
  addNIClady ();
  addNILowerBann ();
  addNIMoyola ();
  addNCrollyGweedore ();
  addNDrowes ();
  addNGweebarra ();
  addNOwenea ();
  addNWBonet ();
  addNWEasky ();
  addNWMoy ();
  addNWOwenmoreMayo ();
  addWBundorraghaDelphi ();
  addWCashlaCostello ();
  addWCorribGalwayFishery ();
  addWErriff ();
  addEBoyne ();
  addECastletownCourtbane ();
  addEFane ();
  addESlaney ();
  addSHFeale ();
  addSHMulcair ();
  addSHShannon ();
  addSHSuck ();
  addSBarrow ();
  addSColligan ();
  addSMunsterBlackwater ();
  addSNore ();
  addSWBandon ();
  addSWBrownFlesk ();
  addSWRoughty ();
  addSWSheen ();
  
  if (mainMap)
  {
    riverLayer.Hide();
  }
  
  riverMap.SetCenterAndZoom(new VELatLong(longitude, latitude),zoom);

  riverMap.AttachEvent("onclick",mouseHandler);
  riverMap.AttachEvent("onendzoom",zoomHandler);

  document.getElementById("si_riverMap").childNodes[0].style.cursor = "pointer";
};

function zoomHandler(e)
{
  var zoomLevel = riverMap.GetZoomLevel();
  
  if (zoomLevel >= 9)
  {
    riverLayer.Show();
  }
  else
  {
    riverLayer.Hide();
  }
}

mouseHandler = function (e)
{
  var shapeName;
  var coordinates;

  if (e.eventName == "onclick")
  {
    if (e.leftMouseButton)
    {
      if (e.elementID != null)
      {
        shapeName = e.elementID.substring (0,18);
        
        switch (shapeName)
        {
          case f_faughan_1.GetID():
            document.location = '/salmon-rivers/foyle/river-faughan.jsp';
            return;
            break;
          case f_faughan_2.GetID():
            document.location = '/salmon-rivers/foyle/river-faughan.jsp';
            return;
            break;
          case f_finn_1.GetID():
            document.location = '/salmon-rivers/foyle/river-finn.jsp';
            return;
            break;
          case f_finn_2.GetID():
            document.location = '/salmon-rivers/foyle/river-finn.jsp';
            return;
            break;
          case f_reelan.GetID():
            document.location = '/salmon-rivers/foyle/river-finn.jsp';
            return;
            break;
          case f_mourne_1.GetID():
            document.location = '/salmon-rivers/foyle/river-mourne.jsp';
            return;
            break;
          case f_roe.GetID():
            document.location = '/salmon-rivers/foyle/river-roe.jsp';
            return;
            break;
          case ni_agivey.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-agivey.jsp';
            return;
            break;
          case ni_wee_agivey.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-agivey.jsp';
            return;
            break;
          case ni_clady_1.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-clady.jsp';
            return;
            break;
          case ni_clady_2.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-clady.jsp';
            return;
            break;
          case ni_grillagh.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-clady.jsp';
            return;
            break;
          case ni_lower_bann_1.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-lower-bann.jsp';
            return;
            break;
          case ni_lower_bann_2.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-lower-bann.jsp';
            return;
            break;
          case ni_moyola.GetID():
            document.location = '/salmon-rivers/northern-ireland/river-moyola.jsp';
            return;
            break;
          case n_crolly_gweedore.GetID():
            document.location = '/salmon-rivers/northern/river-crolly-gweedore.jsp';
            return;
            break;
          case n_drowes.GetID():
            document.location = '/salmon-rivers/northern/river-drowes.jsp';
            return;
            break;
          case n_gweebarra.GetID():
            document.location = '/salmon-rivers/northern/river-gweebarra.jsp';
            return;
            break;
          case n_owenea.GetID():
            document.location = '/salmon-rivers/northern/river-owenea.jsp';
            return;
            break;
          case nw_bonet_1.GetID():
            document.location = '/salmon-rivers/north-western/river-bonet.jsp';
            return;
            break;
          case nw_bonet_2.GetID():
            document.location = '/salmon-rivers/north-western/river-bonet.jsp';
            return;
            break;
          case nw_easky.GetID():
            document.location = '/salmon-rivers/north-western/river-easkey.jsp';
            return;
            break;
          case nw_moy_1.GetID():
            document.location = '/salmon-rivers/north-western/river-moy.jsp';
            return;
            break;
          case nw_moy_2.GetID():
            document.location = '/salmon-rivers/north-western/river-moy.jsp';
            return;
            break;
          case nw_moy_3.GetID():
            document.location = '/salmon-rivers/north-western/river-moy.jsp';
            return;
            break;
          case nw_owenmore_mayo_1.GetID():
            document.location = '/salmon-rivers/north-western/river-owenmore-mayo.jsp';
            return;
            break;
          case nw_owenmore_mayo_2.GetID():
            document.location = '/salmon-rivers/north-western/river-owenmore-mayo.jsp';
            return;
            break;
          case w_bundorragh_delphi.GetID():
            document.location = '/salmon-rivers/western/river-bundorragh-delhpi.jsp';
            return;
            break;
          case w_cashla_costello.GetID():
            document.location = '/salmon-rivers/western/river-cashla-costello.jsp';
            return;
            break;
          case w_corrib_galway_fishery.GetID():
            document.location = '/salmon-rivers/western/river-corrib-galway-fishery.jsp';
            return;
            break;
          case w_erriff.GetID():
            document.location = '/salmon-rivers/western/river-erriff.jsp';
            return;
            break;
          case e_boyne_1.GetID():
            document.location = '/salmon-rivers/eastern/river-boyne.jsp';
            return;
            break;
          case e_boyne_2.GetID():
            document.location = '/salmon-rivers/eastern/river-boyne.jsp';
            return;
            break;
          case e_boyne_3.GetID():
            document.location = '/salmon-rivers/eastern/river-boyne.jsp';
            return;
            break;
          case e_castletown_courtbane.GetID():
            document.location = '/salmon-rivers/eastern/river-castletown-courtbane.jsp';
            return;
            break;
          case e_fane_1.GetID():
            document.location = '/salmon-rivers/eastern/river-fane.jsp';
            return;
            break;
          case e_fane_2.GetID():
            document.location = '/salmon-rivers/eastern/river-fane.jsp';
            return;
            break;
          case e_fane_3.GetID():
            document.location = '/salmon-rivers/eastern/river-fane.jsp';
            return;
            break;
          case e_slaney_1.GetID():
            document.location = '/salmon-rivers/eastern/river-slaney.jsp';
            return;
            break;
          case e_slaney_2.GetID():
            document.location = '/salmon-rivers/eastern/river-slaney.jsp';
            return;
            break;
          case sh_feale_1.GetID():
            document.location = '/salmon-rivers/shannon/river-feale.jsp';
            return;
            break;
          case sh_feale_2.GetID():
            document.location = '/salmon-rivers/shannon/river-feale.jsp';
            return;
            break;
          case sh_mulcair.GetID():
            document.location = '/salmon-rivers/shannon/river-mulcair.jsp';
            return;
            break;
          case sh_shannon_1.GetID():
            document.location = '/salmon-rivers/shannon/river-shannon.jsp';
            return;
            break;
          case sh_shannon_2.GetID():
            document.location = '/salmon-rivers/shannon/river-shannon.jsp';
            return;
            break;
          case sh_shannon_3.GetID():
            document.location = '/salmon-rivers/shannon/river-shannon.jsp';
            return;
            break;
          case sh_suck_1.GetID():
            document.location = '/salmon-rivers/shanon/river-suck.jsp';
            return;
            break;
          case sh_suck_2.GetID():
            document.location = '/salmon-rivers/shanon/river-suck.jsp';
            return;
            break;
          case sh_suck_3.GetID():
            document.location = '/salmon-rivers/shanon/river-suck.jsp';
            return;
            break;
          case s_barrow_1.GetID():
            document.location = '/salmon-rivers/southern/river-barrow.jsp';
            return;
            break;
          case s_barrow_2.GetID():
            document.location = '/salmon-rivers/southern/river-barrow.jsp';
            return;
            break;
          case s_barrow_3.GetID():
            document.location = '/salmon-rivers/southern/river-barrow.jsp';
            return;
            break;
          case s_colligan.GetID():
            document.location = '/salmon-rivers/southern/river-colligan.jsp';
            return;
            break;
          case s_munster_blackwater_1.GetID():
            document.location = '/salmon-rivers/southern/river-munster-blackwater.jsp';
            return;
            break;
          case s_munster_blackwater_2.GetID():
            document.location = '/salmon-rivers/southern/river-munster-blackwater.jsp';
            return;
            break;
          case s_munster_blackwater_3.GetID():
            document.location = '/salmon-rivers/southern/river-munster-blackwater.jsp';
            return;
            break;
          case s_nore_1.GetID():
            document.location = '/salmon-rivers/southern/river-nore.jsp';
            return;
            break;
          case s_nore_2.GetID():
            document.location = '/salmon-rivers/southern/river-nore.jsp';
            return;
            break;
          case s_nore_3.GetID():
            document.location = '/salmon-rivers/southern/river-nore.jsp';
            return;
            break;
          case sw_bandon_1.GetID():
            document.location = '/salmon-rivers/south-western/river-bandon.jsp';
            return;
            break;
          case sw_bandon_2.GetID():
            document.location = '/salmon-rivers/south-western/river-bandon.jsp';
            return;
            break;
          case sw_brown_flesk.GetID():
            document.location = '/salmon-rivers/south-western/river-brown-flesk.jsp';
            return;
            break;
          case sw_roughty.GetID():
            document.location = '/salmon-rivers/south-western/river-roughty.jsp';
            return;
            break;
          case sw_sheen.GetID():
            document.location = '/salmon-rivers/south-western/river-sheen.jsp';
            return;
            break;
        }
      }
    }
  }
}
      
createLayer = function ()
{
  riverLayer = new VEShapeLayer();
  riverMap.AddShapeLayer(riverLayer);
}

addFFaughan = function ()
{
  f_faughan_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(55.048679135743974, -7.238273620605464),
							new VELatLong(55.03963070344664, -7.233982086181633),
							new VELatLong(55.04189300316059, -7.228832244873058),
							new VELatLong(55.03894215208696, -7.225742340087889),
							new VELatLong(55.02566063214695, -7.2338104248047035),
							new VELatLong(55.02477504095748, -7.242565155029299),
							new VELatLong(55.02133088921037, -7.247886657714832),
							new VELatLong(55.022511774575314, -7.252864837646478),
							new VELatLong(55.01788644152806, -7.2556114196777255),
							new VELatLong(55.01404799406661, -7.2544097900390625),
							new VELatLong(55.010996658305935, -7.256984710693349),
							new VELatLong(55.004991738999976, -7.2556114196777255),
							new VELatLong(54.99878899328631, -7.261447906494143),
							new VELatLong(54.996130380095586, -7.259387969970708),
							new VELatLong(54.99297920300393, -7.263336181640618),
							new VELatLong(54.98963080619362, -7.260932922363293),
							new VELatLong(54.986971586176644, -7.265567779541016),
							new VELatLong(54.98490318213215, -7.2751808166503835),
							new VELatLong(54.980372019869726, -7.276725769042969),
							new VELatLong(54.98086456228125, -7.28033065795899),
							new VELatLong(54.97554478445468, -7.281703948974615)
                         ]);

  f_faughan_1.SetTitle('River Faughan');
  f_faughan_1.SetDescription('Click on the river name to view the details.');
  f_faughan_1.SetLineWidth (2);
  f_faughan_1.SetCustomIcon ('/images/salmon-rivers/foyle/map-titles/faughan.gif');
  f_faughan_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(f_faughan_1);

  f_faughan_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.97544626340332, -7.281188964843764),
							new VELatLong(54.97505217678069, -7.263851165771469),
							new VELatLong(54.97071696866919, -7.259902954101558),
							new VELatLong(54.96460747198282, -7.2605895996093714),
							new VELatLong(54.9630306768252, -7.254753112792986),
							new VELatLong(54.956328606927734, -7.246856689453131),
							new VELatLong(54.953075728911415, -7.2472000122070215),
							new VELatLong(54.95130132083113, -7.241535186767565),
							new VELatLong(54.94469589111961, -7.238101959228503),
							new VELatLong(54.94252670731805, -7.2276306152343634),
							new VELatLong(54.94410430714461, -7.221965789794907),
							new VELatLong(54.94154067598976, -7.218189239501957)
                         ]);

  f_faughan_2.SetTitle('River Faughan');
  f_faughan_2.SetDescription('Click on the river name to view the details.');
  f_faughan_2.SetLineWidth (2);
  f_faughan_2.SetCustomIcon ('/images/salmon-rivers/foyle/map-titles/faughan.gif');
  f_faughan_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(f_faughan_2);
}

addFFinn = function ()
{
  f_finn_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.83075431924242, -7.479629516601553),
							new VELatLong(54.821261120976246, -7.485122680664048),
							new VELatLong(54.8113699993228, -7.511215209960936),
							new VELatLong(54.80662140058498, -7.515335083007808),
							new VELatLong(54.80701713846256, -7.5263214111328),
							new VELatLong(54.802663808640595, -7.527008056640611),
							new VELatLong(54.80147645547757, -7.533874511718764),
							new VELatLong(54.788809184417865, -7.546234130859379),
							new VELatLong(54.793955742009906, -7.571640014648422),
							new VELatLong(54.79791418668333, -7.579879760742198),
							new VELatLong(54.80028906743069, -7.601852416992182),
							new VELatLong(54.79474746195475, -7.646484374999994),
							new VELatLong(54.7943516039205, -7.662963867187512),
							new VELatLong(54.788809184417865, -7.675323486328128),
							new VELatLong(54.79474746195475, -7.685623168945307),
							new VELatLong(54.79633085532888, -7.705535888671887),
							new VELatLong(54.79910164449945, -7.7227020263671875),
							new VELatLong(54.80226802812887, -7.737121582031238),
							new VELatLong(54.7967266939818, -7.7735137939453045)
 						 ]);

  f_finn_1.SetTitle('River Finn');
  f_finn_1.SetDescription('Click on the river name to view the details.');
  f_finn_1.SetLineWidth (2);
  f_finn_1.SetCustomIcon ('/images/salmon-rivers/foyle/map-titles/finn.gif');
  f_finn_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(f_finn_1);

  f_finn_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.7967266939818, -7.77488708496093),
							new VELatLong(54.80147645547757, -7.7790069580078),
							new VELatLong(54.7983100098315, -7.784500122070297),
							new VELatLong(54.80385112692027, -7.794113159179697),
							new VELatLong(54.8058299132026, -7.819519042968739),
							new VELatLong(54.81018290195897, -7.819519042968739),
							new VELatLong(54.81018290195897, -7.84629821777344),
							new VELatLong(54.814139757529865, -7.861404418945303),
							new VELatLong(54.81374408941228, -7.87307739257814),
							new VELatLong(54.816909325843646, -7.886123657226567),
							new VELatLong(54.82165671546501, -7.916336059570327),
							new VELatLong(54.82838122891304, -7.930068969726565),
							new VELatLong(54.84182689655048, -7.939682006835932),
							new VELatLong(54.85052464798044, -7.949981689453113),
							new VELatLong(54.85684910779353, -7.966461181640633),
							new VELatLong(54.85803483361682, -7.992553710937486),
							new VELatLong(54.861196598723986, -8.009033203125007),
							new VELatLong(54.86080139164162, -8.036499023437487)
                         ]);

  f_finn_2.SetTitle('River Finn');
  f_finn_2.SetDescription('Click on the river name to view the details.');
  f_finn_2.SetLineWidth (2);
  f_finn_2.SetCustomIcon ('/images/salmon-rivers/foyle/map-titles/finn.gif');
  f_finn_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(f_finn_2);

  f_reelan = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.82838122891304, -7.931442260742189),
							new VELatLong(54.82798570029685, -7.945861816406241),
							new VELatLong(54.82086552261244, -7.963714599609385),
							new VELatLong(54.81295274155089, -7.967834472656256),
							new VELatLong(54.80108066333795, -7.973327636718752),
							new VELatLong(54.78564174642233, -7.974700927734377)
                         ]);

  f_reelan.SetTitle('River Reelan');
  f_reelan.SetDescription('Click on the river name to view the details.');
  f_reelan.SetLineWidth (2);
  f_reelan.SetCustomIcon ('/images/salmon-rivers/foyle/map-titles/reelan.gif');
  f_reelan.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(f_reelan);
}

addFMourne = function ()
{
  f_mourne_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.831545318355445, -7.477569580078117),
							new VELatLong(54.818887472667356, -7.453536987304698),
							new VELatLong(54.792372255603915, -7.470703124999997),
							new VELatLong(54.784453893208216, -7.459030151367195),
							new VELatLong(54.771781287811315, -7.459716796875005),
							new VELatLong(54.7654434962254, -7.466583251953126),
							new VELatLong(54.75712363826353, -7.43431091308593),
							new VELatLong(54.750387262528136, -7.439804077148426),
							new VELatLong(54.73651472417763, -7.426757812499999)
                         ]);

  f_mourne_1.SetTitle('River Mourne');
  f_mourne_1.SetDescription('Click on the river name to view the details.');
  f_mourne_1.SetLineWidth (2);
  f_mourne_1.SetCustomIcon ('/images/salmon-rivers/foyle/map-titles/mourne.gif');
  f_mourne_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(f_mourne_1);
}

addFRoe = function ()
{
  f_roe = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(55.10233756014167, -6.9687652587890545),
							new VELatLong(55.10626575126004, -6.9625854492187464),
							new VELatLong(55.110193556270566, -6.95022583007813),
							new VELatLong(55.10351605801966, -6.93923950195314),
							new VELatLong(55.09448001950344, -6.94953918457032),
							new VELatLong(55.079546436609505, -6.950912475585943),
							new VELatLong(55.07443629897097, -6.957778930664062),
							new VELatLong(55.057528885141465, -6.940612792968763),
							new VELatLong(55.05123593092886, -6.955718994140627),
							new VELatLong(55.037466645035806, -6.95022583007813),
							new VELatLong(55.02684138996225, -6.947479248046884),
							new VELatLong(55.01896901411753, -6.929626464843739),
							new VELatLong(55.007945090356564, -6.934432983398423),
							new VELatLong(55.00518863585595, -6.927566528320303),
							new VELatLong(54.988251973363, -6.924133300781244),
							new VELatLong(54.97288463122323, -6.9261932373046795),
							new VELatLong(54.96460747198282, -6.93031311035155),
							new VELatLong(54.95593433270673, -6.935119628906235),
							new VELatLong(54.95475148683276, -6.939926147460953),
							new VELatLong(54.95238569063362, -6.936492919921892),
							new VELatLong(54.951597060951514, -6.925506591796866),
							new VELatLong(54.945287466389296, -6.9165802001953125),
							new VELatLong(54.94173788419, -6.9261932373046795),
							new VELatLong(54.94055462047904, -6.929626464843739),
							new VELatLong(54.93345430690935, -6.928939819335928),
							new VELatLong(54.92911460920316, -6.933746337890611),
							new VELatLong(54.923196084988746, -6.933059692382799)
                         ]);

  f_roe.SetTitle('River Roe');
  f_roe.SetDescription('Click on the river name to view the details.');
  f_roe.SetLineWidth (2);
  f_roe.SetCustomIcon ('/images/salmon-rivers/foyle/map-titles/roe.gif');
  f_roe.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(f_roe);
}

addNIAgivey = function ()
{
  ni_agivey = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(55.041401209743306, -6.5760040283203125),
							new VELatLong(55.03982743023284, -6.586303710937492),
							new VELatLong(55.033531693880164, -6.606903076171884),
							new VELatLong(55.021724521530594, -6.600723266601577),
							new VELatLong(55.01463854836345, -6.603469848632825),
							new VELatLong(55.01267000021621, -6.621322631835935),
							new VELatLong(55.017394353414716, -6.643295288085952),
							new VELatLong(55.01109509211589, -6.654281616210943),
							new VELatLong(54.99770587584443, -6.65702819824219),
							new VELatLong(54.98785801242519, -6.66389465332031),
							new VELatLong(54.98746404762045, -6.682434082031266),
							new VELatLong(54.98076605428234, -6.686553955078137),
							new VELatLong(54.974855132019044, -6.690673828125011),
							new VELatLong(54.97446103959507, -6.7037200927734375),
							new VELatLong(54.97249051946118, -6.7181396484374884),
							new VELatLong(54.97012576766702, -6.734619140625009),
							new VELatLong(54.964213278995565, -6.742858886718753),
							new VELatLong(54.95554005461726, -6.757965087890615),
							new VELatLong(54.94923107905584, -6.778564453125007),
							new VELatLong(54.935821217398704, -6.799850463867179)
                         ]);

  ni_agivey.SetTitle('River Agivey');
  ni_agivey.SetDescription('Click on the river name to view the details.');
  ni_agivey.SetLineWidth (2);
  ni_agivey.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/agivey.gif');
  ni_agivey.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_agivey);

  ni_wee_agivey = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(55.04022088090695, -6.586990356445304),
							new VELatLong(55.04612217730811, -6.5966033935546715),
							new VELatLong(55.04769570951165, -6.613082885742192),
							new VELatLong(55.0445485832797, -6.624755859374995),
							new VELatLong(55.037860118896404, -6.626129150390619),
							new VELatLong(55.03235113317319, -6.638488769531234),
							new VELatLong(55.0280221129925, -6.6563415527343785),
							new VELatLong(55.033531693880164, -6.67762756347655),
							new VELatLong(55.02762854251406, -6.685180664062515),
							new VELatLong(55.02133088921037, -6.709213256835933),
							new VELatLong(55.02369262515329, -6.720199584960924),
							new VELatLong(55.03195760520809, -6.737365722656257),
							new VELatLong(55.034712219805066, -6.751098632812496),
							new VELatLong(55.024873440944816, -6.7655181884765465),
							new VELatLong(55.01778802438857, -6.792984008789058)
                         ]);

  ni_wee_agivey.SetTitle('River Wee Agivey');
  ni_wee_agivey.SetDescription('Click on the river name to view the details.');
  ni_wee_agivey.SetLineWidth (2);
  ni_wee_agivey.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/wee-agivey.gif');
  ni_wee_agivey.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_wee_agivey);
}

addNIClady = function ()
{
  ni_clady_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.87818683956831, -6.486740112304691),
							new VELatLong(54.87502640669145, -6.499099731445306),
							new VELatLong(54.870285292681835, -6.513519287109391),
							new VELatLong(54.86870479742191, -6.5190124511718865),
							new VELatLong(54.86909992704594, -6.542358398437494),
							new VELatLong(54.87265591939239, -6.549224853515612),
							new VELatLong(54.87660665410869, -6.56089782714845),
							new VELatLong(54.87779179901187, -6.581497192382808),
							new VELatLong(54.86989017467588, -6.595916748046859)
                         ]);

  ni_clady_1.SetTitle('River Clady');
  ni_clady_1.SetDescription('Click on the river name to view the details.');
  ni_clady_1.SetLineWidth (2);
  ni_clady_1.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/clady.gif');
  ni_clady_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_clady_1);

  ni_clady_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.870285292681835, -6.595916748046859),
							new VELatLong(54.877396754583124, -6.621322631835935),
							new VELatLong(54.88213703216092, -6.637115478515611),
							new VELatLong(54.88885147093585, -6.654281616210943),
							new VELatLong(54.89477504651281, -6.665267944335935),
							new VELatLong(54.898723612960005, -6.667327880859371),
							new VELatLong(54.904250955616085, -6.661148071289062),
							new VELatLong(54.912145843281245, -6.671447753906241),
							new VELatLong(54.91490868818237, -6.694793701171882),
							new VELatLong(54.92122305008297, -6.709899902343745),
							new VELatLong(54.91490868818237, -6.730499267578137),
							new VELatLong(54.90543528747276, -6.751098632812496)
                         ]);

  ni_clady_2.SetTitle('River Clady');
  ni_clady_2.SetDescription('Click on the river name to view the details.');
  ni_clady_2.SetLineWidth (2);
  ni_clady_2.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/clady.gif');
  ni_clady_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_clady_2);

  ni_grillagh = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.870285292681835, -6.597290039062517),
							new VELatLong(54.8655436210096, -6.597976684570329),
							new VELatLong(54.86198700126941, -6.6137695312500035),
							new VELatLong(54.86909992704594, -6.621322631835935),
							new VELatLong(54.86909992704594, -6.638488769531234),
							new VELatLong(54.86672909121034, -6.646728515625011),
							new VELatLong(54.86317257603965, -6.65290832519532),
							new VELatLong(54.86633393834961, -6.661834716796874),
							new VELatLong(54.87423625974833, -6.673507690429677),
							new VELatLong(54.87897690906441, -6.684494018554702),
							new VELatLong(54.87897690906441, -6.7037200927734375),
							new VELatLong(54.881347024619664, -6.721572875976548),
							new VELatLong(54.88806159504048, -6.740112304687504)
                         ]);

  ni_grillagh.SetTitle('River Grillagh');
  ni_grillagh.SetDescription('Click on the river name to view the details.');
  ni_grillagh.SetLineWidth (2);
  ni_grillagh.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/grillagh.gif');
  ni_grillagh.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_grillagh);
}

addNILowerBann = function ()
{
  ni_lower_bann_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(55.1545509263351, -6.705780029296873),
							new VELatLong(55.14434917097696, -6.678314208984362),
							new VELatLong(55.13178958302215, -6.672821044921866),
							new VELatLong(55.1188333682902, -6.665954589843746),
							new VELatLong(55.10980079314381, -6.649475097656259),
							new VELatLong(55.098016103933624, -6.62681579589843),
							new VELatLong(55.08229777881319, -6.610336303710944),
							new VELatLong(55.06775282630606, -6.595230102539047),
							new VELatLong(55.057528885141465, -6.580123901367185),
							new VELatLong(55.044941987582945, -6.578063964843749),
							new VELatLong(55.02644780788886, -6.573257446289065),
							new VELatLong(55.011882553897536, -6.578063964843749),
							new VELatLong(54.99849360052015, -6.575317382812501),
							new VELatLong(54.98510017758563, -6.571197509765629),
							new VELatLong(54.98194813431665, -6.553344726562485),
							new VELatLong(54.97524922057545, -6.549224853515612),
							new VELatLong(54.95908841815876, -6.543731689453118)
                         ]);

  ni_lower_bann_1.SetTitle('Lower Bann');
  ni_lower_bann_1.SetDescription('Click on the river name to view the details.');
  ni_lower_bann_1.SetLineWidth (2);
  ni_lower_bann_1.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/lower-bann.gif');
  ni_lower_bann_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_lower_bann_1);

  ni_lower_bann_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.95711714376435, -6.539611816406245),
							new VELatLong(54.94607621987404, -6.526565551757818),
							new VELatLong(54.9314817750882, -6.51077270507811),
							new VELatLong(54.91806599298336, -6.498413085937494),
							new VELatLong(54.90938280871961, -6.504592895507802),
							new VELatLong(54.89753908367512, -6.499786376953118),
							new VELatLong(54.88569187443072, -6.491546630859375),
							new VELatLong(54.867914526555616, -6.47918701171876),
							new VELatLong(54.85526808580273, -6.4716339111328285),
							new VELatLong(54.84538529420953, -6.469573974609393),
							new VELatLong(54.83787275333975, -6.465454101562487),
							new VELatLong(54.82759016780596, -6.4592742919921795),
							new VELatLong(54.81493108213896, -6.4592742919921795),
							new VELatLong(54.76782028439745, -6.4592742919921795),
							new VELatLong(54.75395371871184, -6.462707519531239)
                         ]);

  ni_lower_bann_2.SetTitle('Lower Bann');
  ni_lower_bann_2.SetDescription('Click on the river name to view the details.');
  ni_lower_bann_2.SetLineWidth (2);
  ni_lower_bann_2.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/lower-bann.gif');
  ni_lower_bann_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_lower_bann_2);
}

addNIMoyola = function ()
{
  ni_moyola = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.74285704556977, -6.503906249999989),
							new VELatLong(54.74444247076275, -6.513519287109391),
							new VELatLong(54.75276493488904, -6.516952514648451),
							new VELatLong(54.75870850496398, -6.513519287109391),
							new VELatLong(54.763858893223286, -6.528625488281254),
							new VELatLong(54.771781287811315, -6.544418334960929),
							new VELatLong(54.78484984815636, -6.559524536132825),
							new VELatLong(54.79355987622298, -6.576690673828125),
							new VELatLong(54.79633085532888, -6.595916748046859),
							new VELatLong(54.8018722437412, -6.623382568359371),
							new VELatLong(54.80860005121589, -6.637115478515611),
							new VELatLong(54.81216137818778, -6.655654907226568),
							new VELatLong(54.814139757529865, -6.680374145507797),
							new VELatLong(54.81611803998763, -6.692733764648446),
							new VELatLong(54.82165671546501, -6.7188262939453),
							new VELatLong(54.82363462978406, -6.730499267578137),
							new VELatLong(54.81770059619871, -6.74217224121094),
							new VELatLong(54.81770059619871, -6.762771606445298),
							new VELatLong(54.81374408941228, -6.778564453125007),
							new VELatLong(54.80543416369776, -6.7778778076171955),
							new VELatLong(54.799497456019274, -6.788864135742187),
							new VELatLong(54.79712252875849, -6.803283691406238)
                         ]);

  ni_moyola.SetTitle('River Moyola');
  ni_moyola.SetDescription('Click on the river name to view the details.');
  ni_moyola.SetLineWidth (2);
  ni_moyola.SetCustomIcon ('/images/salmon-rivers/northern-ireland/map-titles/moyola.gif');
  ni_moyola.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(ni_moyola);
}

addNCrollyGweedore = function ()
{
  n_crolly_gweedore = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(55.041401209743306, -8.28643798828124),
							new VELatLong(55.03982743023284, -8.27613830566406),
							new VELatLong(55.03667968572115, -8.269958496093753),
							new VELatLong(55.03117053768363, -8.267211914062503),
							new VELatLong(55.02369262515329, -8.263092041015633),
							new VELatLong(55.018575354739966, -8.264465332031257),
							new VELatLong(55.013851140701504, -8.269958496093753),
							new VELatLong(55.009520122163096, -8.274078369140625),
							new VELatLong(55.00321962380237, -8.274765014648435)
                         ]);

  n_crolly_gweedore.SetTitle('River Crolly (Gweedore)');
  n_crolly_gweedore.SetDescription('Click on the river name to view the details.');
  n_crolly_gweedore.SetLineWidth (2);
  n_crolly_gweedore.SetCustomIcon ('/images/salmon-rivers/northern/map-titles/crolly-gweedore.gif');
  n_crolly_gweedore.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(n_crolly_gweedore);
}

addNDrowes = function ()
{
  n_drowes = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.473878090044614, -8.321886062622086),
							new VELatLong(54.47248159457989, -8.318967819213877),
							new VELatLong(54.474376826871875, -8.313217163085941),
							new VELatLong(54.47133443764265, -8.305749893188487),
							new VELatLong(54.4712845605244, -8.303518295288091),
							new VELatLong(54.46968846063409, -8.304376602172865),
							new VELatLong(54.467493721613714, -8.302230834960948),
							new VELatLong(54.46395196266532, -8.299226760864257),
							new VELatLong(54.46285445402037, -8.287467956542974),
							new VELatLong(54.464849902391514, -8.284206390380875),
							new VELatLong(54.4638023041287, -8.279914855957043),
							new VELatLong(54.46225580053549, -8.27622413635254),
							new VELatLong(54.4607092385006, -8.271417617797857),
							new VELatLong(54.45901294197193, -8.261203765869124),
							new VELatLong(54.45696731441831, -8.256740570068363),
							new VELatLong(54.457815513859316, -8.253479003906266),
							new VELatLong(54.45641847012005, -8.252019882202162),
							new VELatLong(54.4551710693469, -8.24901580810547),
							new VELatLong(54.45497148169574, -8.244466781616196),
							new VELatLong(54.452775953307885, -8.244895935058599),
							new VELatLong(54.45087972039684, -8.240346908569323)
                         ]);

  n_drowes.SetTitle('River Drowes');
  n_drowes.SetDescription('Click on the river name to view the details.');
  n_drowes.SetLineWidth (2);
  n_drowes.SetCustomIcon ('/images/salmon-rivers/northern/map-titles/drowes.gif');
  n_drowes.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(n_drowes);
}

addNGweebarra = function ()
{
  n_gweebarra = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.89497248402975, -8.21777343750001),
							new VELatLong(54.90306658892034, -8.205070495605472),
							new VELatLong(54.907803846671044, -8.20781707763672),
							new VELatLong(54.90918544185048, -8.198547363281243),
							new VELatLong(54.909777539554824, -8.188247680664062),
							new VELatLong(54.91392197963238, -8.177604675292961),
							new VELatLong(54.91550070170089, -8.1731414794922),
							new VELatLong(54.91313259537499, -8.167991638183593),
							new VELatLong(54.91707936184206, -8.15975189208985),
							new VELatLong(54.923196084988746, -8.150482177734371),
							new VELatLong(54.9275364212175, -8.1463623046875),
							new VELatLong(54.92733914336571, -8.130226135253901),
							new VELatLong(54.93246805309137, -8.11580657958985),
							new VELatLong(54.937004620405304, -8.11168670654298)
                         ]);

  n_gweebarra.SetTitle('River Gweebarra');
  n_gweebarra.SetDescription('Click on the river name to view the details.');
  n_gweebarra.SetLineWidth (2);
  n_gweebarra.SetCustomIcon ('/images/salmon-rivers/northern/map-titles/gweebarra.gif');
  n_gweebarra.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(n_gweebarra);
}

addNOwenea = function ()
{
  n_owenea = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.77415770374261, -8.412094116210928),
							new VELatLong(54.77455375949383, -8.405914306640621),
							new VELatLong(54.77574190348391, -8.396644592285143),
							new VELatLong(54.77950412924489, -8.385658264160152),
							new VELatLong(54.784057934383256, -8.379478454589843),
							new VELatLong(54.78168210001961, -8.373985290527347),
							new VELatLong(54.78148410752266, -8.358879089355484),
							new VELatLong(54.78287003464739, -8.338966369628904),
							new VELatLong(54.78346398887678, -8.325920104980477),
							new VELatLong(54.78484984815636, -8.31699371337892),
							new VELatLong(54.78544377330962, -8.309097290039067),
							new VELatLong(54.7878193866963, -8.299140930175777),
							new VELatLong(54.792768133020004, -8.302574157714838),
							new VELatLong(54.79296607027439, -8.293304443359359),
							new VELatLong(54.790788707175174, -8.288497924804676),
							new VELatLong(54.79534124173806, -8.283348083496102),
							new VELatLong(54.799893263663016, -8.274078369140625),
							new VELatLong(54.80207013641953, -8.27854156494142),
							new VELatLong(54.80840219051293, -8.267555236816393)
                         ]);

  n_owenea.SetTitle('River Owenea');
  n_owenea.SetDescription('Click on the river name to view the details.');
  n_owenea.SetLineWidth (2);
  n_owenea.SetCustomIcon ('/images/salmon-rivers/northern/map-titles/owenea.gif');
  n_owenea.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(n_owenea);
}

addNWBonet = function ()
{
  nw_bonet_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.249380574260286, -8.337936401367203),
							new VELatLong(54.243763693808326, -8.33347320556641),
							new VELatLong(54.23533693908522, -8.33038330078124),
							new VELatLong(54.2345343012614, -8.315963745117187),
							new VELatLong(54.22871471018815, -8.302574157714838),
							new VELatLong(54.222091418752164, -8.296051025390641),
							new VELatLong(54.219080480461116, -8.280944824218744),
							new VELatLong(54.225904958745936, -8.266525268554692),
							new VELatLong(54.23353098202982, -8.255195617675777),
							new VELatLong(54.241356225204576, -8.246269226074224),
							new VELatLong(54.2467728320186, -8.239746093749993),
							new VELatLong(54.25138641765193, -8.233566284179684),
							new VELatLong(54.25740336256992, -8.236656188964856),
							new VELatLong(54.265625100978596, -8.223609924316395),
							new VELatLong(54.26522407860566, -8.21434020996095),
							new VELatLong(54.27103852119818, -8.203010559082036),
							new VELatLong(54.27605031343389, -8.206443786621095),
							new VELatLong(54.28587165828031, -8.20438385009766),
							new VELatLong(54.29088164657006, -8.202667236328114),
							new VELatLong(54.3011001331842, -8.196487426757807)
                         ]);

  nw_bonet_1.SetTitle('River Bonet');
  nw_bonet_1.SetDescription('Click on the river name to view the details.');
  nw_bonet_1.SetLineWidth (2);
  nw_bonet_1.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/bonet.gif');
  nw_bonet_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_bonet_1);

  nw_bonet_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.30130047031906, -8.196830749511727),
							new VELatLong(54.306308581863064, -8.195114135742182),
							new VELatLong(54.311916943480675, -8.193740844726557),
							new VELatLong(54.31652324025826, -8.199234008789053),
							new VELatLong(54.32233044475411, -8.203353881835925),
							new VELatLong(54.327736415565155, -8.20781707763672),
							new VELatLong(54.33314167591467, -8.21468353271484),
							new VELatLong(54.33754543686356, -8.217430114746086),
							new VELatLong(54.341348305403756, -8.219146728515635),
							new VELatLong(54.34435032156453, -8.227043151855454),
							new VELatLong(54.34775234151605, -8.235969543457043),
							new VELatLong(54.35115407988333, -8.246955871582034),
							new VELatLong(54.35655626208956, -8.25485229492189),
							new VELatLong(54.36015732232431, -8.259315490722651)
                         ]);

  nw_bonet_2.SetTitle('River Bonet');
  nw_bonet_2.SetDescription('Click on the river name to view the details.');
  nw_bonet_2.SetLineWidth (2);
  nw_bonet_2.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/bonet.gif');
  nw_bonet_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_bonet_2);
}

addNWEasky = function ()
{
  nw_easky = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.29168318814592, -8.957290649414059),
							new VELatLong(54.2812619308271, -8.955917358398434),
							new VELatLong(54.27404566967877, -8.944931030273442),
							new VELatLong(54.263619950102296, -8.938751220703135),
							new VELatLong(54.25439499984446, -8.922958374023428),
							new VELatLong(54.243161839827195, -8.917465209960932),
							new VELatLong(54.2347349621808, -8.922958374023428),
							new VELatLong(54.22710916135269, -8.918838500976553),
							new VELatLong(54.21667157174726, -8.92433166503905),
							new VELatLong(54.21305794519892, -8.929138183593734),
							new VELatLong(54.205428139689545, -8.919525146484368),
							new VELatLong(54.19659186739648, -8.92776489257811),
							new VELatLong(54.18936078453945, -8.933944702148451),
							new VELatLong(54.17730616841934, -8.92433166503905),
							new VELatLong(54.17007171175943, -8.905792236328126),
							new VELatLong(54.166052022412366, -8.881072998046862)
                         ]);

  nw_easky.SetTitle('River Easky');
  nw_easky.SetDescription('Click on the river name to view the details.');
  nw_easky.SetLineWidth (2);
  nw_easky.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/easky.gif');
  nw_easky.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_easky);
}

addNWMoy = function ()
{
  nw_moy_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.11496798438369, -9.143371582031267),
							new VELatLong(54.10933281663397, -9.15573120117188),
							new VELatLong(54.09604689032577, -9.152984619140633),
							new VELatLong(54.08154829778735, -9.135818481445301),
							new VELatLong(54.06664168685226, -9.145431518554703),
							new VELatLong(54.04810167901885, -9.143371582031267),
							new VELatLong(54.03681240523652, -9.123458862304685),
							new VELatLong(54.027940110275836, -9.128952026367182),
							new VELatLong(54.02188973273341, -9.11453247070313),
							new VELatLong(54.006154631521646, -9.119338989257814),
							new VELatLong(54.0017154500755, -9.109725952148448),
							new VELatLong(53.99122095718603, -9.115905761718753),
							new VELatLong(53.97951244026377, -9.11453247070313),
							new VELatLong(53.96578102161268, -9.126892089843746),
							new VELatLong(53.95366130598903, -9.128952026367182),
							new VELatLong(53.93628356867313, -9.115905761718753),
							new VELatLong(53.93709199606596, -9.091186523437491),
							new VELatLong(53.93062413833472, -9.085693359374994),
							new VELatLong(53.93304970246447, -9.07676696777344),
							new VELatLong(53.92941130340207, -9.071960449218755),
							new VELatLong(53.933858192512524, -9.058914184570328),
							new VELatLong(53.93183693802202, -9.051361083984364),
							new VELatLong(53.94598366363025, -9.038314819335935)
                         ]);

  nw_moy_1.SetTitle('River Moy');
  nw_moy_1.SetDescription('Click on the river name to view the details.');
  nw_moy_1.SetLineWidth (2);
  nw_moy_1.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/moy.gif');
  nw_moy_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_moy_1);

  nw_moy_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.951641010824, -9.029388427734382),
							new VELatLong(53.956489554785016, -9.014968872070328),
							new VELatLong(53.95285319966853, -9.005355834960928),
							new VELatLong(53.96012559278585, -8.986129760742194),
							new VELatLong(53.96618495145453, -8.969650268554673),
							new VELatLong(53.96376131368408, -8.957290649414059),
							new VELatLong(53.968608448300124, -8.938064575195323),
							new VELatLong(53.96618495145453, -8.933944702148451),
							new VELatLong(53.96780063167635, -8.903732299804691),
							new VELatLong(53.973051159850044, -8.911285400390623),
							new VELatLong(53.976685753377744, -8.92089843749999),
							new VELatLong(53.97951244026377, -8.911285400390623),
							new VELatLong(53.986780183052055, -8.907852172851564),
							new VELatLong(53.9924319952205, -8.907852172851564),
							new VELatLong(53.999293878815855, -8.892745971679701),
							new VELatLong(54.00897931866081, -8.881759643554676),
							new VELatLong(54.01099683495079, -8.862533569335941)
                         ]);

  nw_moy_2.SetTitle('River Moy');
  nw_moy_2.SetDescription('Click on the river name to view the details.');
  nw_moy_2.SetLineWidth (2);
  nw_moy_2.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/moy.gif');
  nw_moy_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_moy_2);

  nw_moy_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.01099683495079, -8.861160278320317),
							new VELatLong(54.015838474966564, -8.865966796875),
							new VELatLong(54.0263267623275, -8.862533569335941),
							new VELatLong(54.02995670719502, -8.836441040039053),
							new VELatLong(54.03439287618642, -8.817214965820317),
							new VELatLong(54.04124784277777, -8.808288574218762),
							new VELatLong(54.04568280705819, -8.795242309570301),
							new VELatLong(54.05414824295584, -8.810348510742198),
							new VELatLong(54.06180596080369, -8.823394775390626),
							new VELatLong(54.071476849844544, -8.815841674804694),
							new VELatLong(54.07953420368011, -8.800735473632798),
							new VELatLong(54.08638172488551, -8.789749145507807),
							new VELatLong(54.097254877694425, -8.774642944335944),
							new VELatLong(54.09806018306312, -8.764343261718764),
							new VELatLong(54.108930275340924, -8.748550415039055),
							new VELatLong(54.11818773633813, -8.732757568359382),
							new VELatLong(54.13186889208542, -8.720397949218766),
							new VELatLong(54.14071899775583, -8.726577758789073),
							new VELatLong(54.1503715019465, -8.741683959960935),
							new VELatLong(54.152784276412554, -8.763656616210953)
                         ]);

  nw_moy_3.SetTitle('River Moy');
  nw_moy_3.SetDescription('Click on the river name to view the details.');
  nw_moy_3.SetLineWidth (2);
  nw_moy_3.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/moy.gif');
  nw_moy_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_moy_3);
}

addNWOwenmoreMayo = function ()
{
  nw_owenmore_mayo_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.12643720917657, -9.831733703613274),
							new VELatLong(54.13005841023855, -9.818000793457034),
							new VELatLong(54.13729986290939, -9.816284179687487),
							new VELatLong(54.141121230356774, -9.791564941406257),
							new VELatLong(54.14554553112429, -9.786415100097651),
							new VELatLong(54.14212679476705, -9.780235290527342),
							new VELatLong(54.140920114544656, -9.76856231689454),
							new VELatLong(54.1403167612481, -9.753456115722643),
							new VELatLong(54.14152345905096, -9.740066528320328),
							new VELatLong(54.143333439828936, -9.726676940917977),
							new VELatLong(54.13810439062091, -9.715347290039062),
							new VELatLong(54.13005841023855, -9.706420898437507),
							new VELatLong(54.12764431136346, -9.699211120605465),
							new VELatLong(54.13106424325487, -9.688911437988284),
							new VELatLong(54.13669645687003, -9.677238464355483),
							new VELatLong(54.138506648616314, -9.665565490722645),
							new VELatLong(54.13448389284938, -9.650459289550783),
							new VELatLong(54.132070051851045, -9.634666442871108),
							new VELatLong(54.12905255280179, -9.62196350097657),
							new VELatLong(54.12462648995818, -9.613723754882826),
							new VELatLong(54.12060238617575, -9.6017074584961),
							new VELatLong(54.121608448755275, -9.589004516601562),
							new VELatLong(54.120803600645495, -9.582138061523442),
							new VELatLong(54.117986509168205, -9.575958251953133)
                         ]);

  nw_owenmore_mayo_1.SetTitle('River Owenmore (Mayo)');
  nw_owenmore_mayo_1.SetDescription('Click on the river name to view the details.');
  nw_owenmore_mayo_1.SetLineWidth (2);
  nw_owenmore_mayo_1.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/owenmore-mayo.gif');
  nw_owenmore_mayo_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_owenmore_mayo_1);

  nw_owenmore_mayo_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.117584051897495, -9.575614929199213),
							new VELatLong(54.114364253048386, -9.579048156738272),
							new VELatLong(54.11134546447653, -9.582481384277331),
							new VELatLong(54.107923905009834, -9.58763122558594),
							new VELatLong(54.10389817941618, -9.591064453124998),
							new VELatLong(54.09967074689618, -9.590377807617185),
							new VELatLong(54.098462829884404, -9.59140777587892),
							new VELatLong(54.09504020731227, -9.58591461181639),
							new VELatLong(54.089200964060325, -9.58179473876952),
							new VELatLong(54.08336089891939, -9.580764770507817),
							new VELatLong(54.08295810550927, -9.584197998046878),
							new VELatLong(54.07691573522145, -9.583511352539066),
							new VELatLong(54.072081205630234, -9.584197998046878),
							new VELatLong(54.071879754679145, -9.592781066894545),
							new VELatLong(54.07308844572374, -9.600677490234366),
							new VELatLong(54.074095661380845, -9.609947204589843),
							new VELatLong(54.07087248526158, -9.614067077636715),
							new VELatLong(54.06865640652423, -9.624710083007817),
							new VELatLong(54.06744758645126, -9.63294982910156),
							new VELatLong(54.06482835556887, -9.644622802734364)
                         ]);

  nw_owenmore_mayo_2.SetTitle('River Owenmore (Mayo)');
  nw_owenmore_mayo_2.SetDescription('Click on the river name to view the details.');
  nw_owenmore_mayo_2.SetLineWidth (2);
  nw_owenmore_mayo_2.SetCustomIcon ('/images/salmon-rivers/north-western/map-titles/owenmore-mayo.gif');
  nw_owenmore_mayo_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(nw_owenmore_mayo_2);
}

addWBundorraghaDelphi = function ()
{
  w_bundorragh_delphi = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.60513668234058, -9.751396179199208),
							new VELatLong(53.61002542571895, -9.750366210937505),
							new VELatLong(53.61470994041143, -9.750366210937505),
							new VELatLong(53.61837571981683, -9.75173950195313),
							new VELatLong(53.62224480831409, -9.752426147460941),
							new VELatLong(53.628149575449356, -9.752426147460941),
							new VELatLong(53.63120344118008, -9.750022888183583),
							new VELatLong(53.63466422182815, -9.747619628906258),
							new VELatLong(53.63771761607282, -9.745903015136711),
							new VELatLong(53.640770789319845, -9.749336242675772)
                         ]);

  w_bundorragh_delphi.SetTitle('Bundorragh (Delphi)');
  w_bundorragh_delphi.SetDescription('Click on the river name to view the details.');
  w_bundorragh_delphi.SetLineWidth (2);
  w_bundorragh_delphi.SetCustomIcon ('/images/salmon-rivers/western/map-titles/bundorragh-delphi.gif');
  w_bundorragh_delphi.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(w_bundorragh_delphi);
}

addWCashlaCostello = function ()
{
  w_cashla_costello = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.27958469355967, -9.540596008300768),
							new VELatLong(53.27609485262594, -9.534759521484383),
							new VELatLong(53.27794245096817, -9.531326293945325),
							new VELatLong(53.28266372834263, -9.530982971191401),
							new VELatLong(53.28820543193897, -9.530639648437512),
							new VELatLong(53.28902636393971, -9.524116516113281),
							new VELatLong(53.29169428400565, -9.520683288574222),
							new VELatLong(53.2962088461138, -9.52274322509766),
							new VELatLong(53.298671133435235, -9.518623352050784),
							new VELatLong(53.30503138535016, -9.517936706542974),
							new VELatLong(53.308724000154676, -9.515876770019538)
                         ]);

  w_cashla_costello.SetTitle('Cashla (Costello)');
  w_cashla_costello.SetDescription('Click on the river name to view the details.');
  w_cashla_costello.SetLineWidth (2);
  w_cashla_costello.SetCustomIcon ('/images/salmon-rivers/western/map-titles/cashla-costello.gif');
  w_cashla_costello.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(w_cashla_costello);
}

addWCorribGalwayFishery = function ()
{
  w_corrib_galway_fishery = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.2696276294803, -9.055137634277345),
							new VELatLong(53.271475507357145, -9.055824279785158),
							new VELatLong(53.27322065201545, -9.055824279785158),
							new VELatLong(53.274349825303155, -9.055137634277345),
							new VELatLong(53.27599220593189, -9.055309295654307),
							new VELatLong(53.27763452345725, -9.055137634277345),
							new VELatLong(53.27927677788033, -9.054965972900385),
							new VELatLong(53.280816334093195, -9.056510925292968),
							new VELatLong(53.28174004120046, -9.059257507324217),
							new VELatLong(53.28399790785686, -9.062004089355467),
							new VELatLong(53.28605041038767, -9.063205718994128),
							new VELatLong(53.28800019647412, -9.062690734863277),
							new VELatLong(53.290360344798614, -9.0630340576172),
							new VELatLong(53.29251514896906, -9.066295623779298),
							new VELatLong(53.29425943464474, -9.070243835449208),
							new VELatLong(53.2957984510927, -9.074192047119153)
                         ]);

  w_corrib_galway_fishery.SetTitle('River Corrib (Galway Fishery)');
  w_corrib_galway_fishery.SetDescription('Click on the river name to view the details.');
  w_corrib_galway_fishery.SetLineWidth (2);
  w_corrib_galway_fishery.SetCustomIcon ('/images/salmon-rivers/western/map-titles/corrib-galway-fishery.gif');
  w_corrib_galway_fishery.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(w_corrib_galway_fishery);
}

addWErriff = function ()
{
  w_erriff = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.6161355591152, -9.671401977539064),
							new VELatLong(53.62000485293593, -9.669342041015628),
							new VELatLong(53.62000485293593, -9.660415649414071),
							new VELatLong(53.624688260431526, -9.65320587158203),
							new VELatLong(53.628556770316706, -9.643592834472663),
							new VELatLong(53.63018551049389, -9.635009765624998),
							new VELatLong(53.63018551049389, -9.62196350097657),
							new VELatLong(53.63283207919946, -9.62196350097657),
							new VELatLong(53.63446065435397, -9.613723754882826),
							new VELatLong(53.635071353829794, -9.607887268066408),
							new VELatLong(53.636699842546925, -9.600677490234366),
							new VELatLong(53.64138139745018, -9.594154357910168),
							new VELatLong(53.64504486060365, -9.58797454833986),
							new VELatLong(53.648708005545856, -9.583854675292956),
							new VELatLong(53.64952199454264, -9.575958251953133),
							new VELatLong(53.65237083228949, -9.57458496093751),
							new VELatLong(53.65460906977197, -9.570121765136717),
							new VELatLong(53.659492084557264, -9.56497192382811),
							new VELatLong(53.66213681473139, -9.568748474121092),
							new VELatLong(53.666001891089515, -9.561195373535161),
							new VELatLong(53.670070009574665, -9.553298950195305),
							new VELatLong(53.6751546053835, -9.550895690917983),
							new VELatLong(53.67454448628689, -9.54471588134764),
							new VELatLong(53.67962854209751, -9.539909362792958),
							new VELatLong(53.68511863317591, -9.534072875976571),
							new VELatLong(53.689998113329764, -9.524116516113281)
                         ]);

  w_erriff.SetTitle('River Erriff');
  w_erriff.SetDescription('Click on the river name to view the details.');
  w_erriff.SetLineWidth (2);
  w_erriff.SetCustomIcon ('/images/salmon-rivers/western/map-titles/erriff.gif');
  w_erriff.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(w_erriff);
}

addEBoyne = function ()
{
  e_boyne_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.72027890176102, -6.301689147949218),
							new VELatLong(53.71885680216116, -6.3219451904296875),
							new VELatLong(53.71438703322412, -6.344261169433593),
							new VELatLong(53.713574296931206, -6.354904174804695),
							new VELatLong(53.716825147889914, -6.364860534667986),
							new VELatLong(53.717840987292455, -6.39060974121095),
							new VELatLong(53.72048205492139, -6.406059265136735),
							new VELatLong(53.72596681931765, -6.419792175292975),
							new VELatLong(53.72291981630308, -6.427345275878906),
							new VELatLong(53.71540293150898, -6.421165466308599),
							new VELatLong(53.70605574181212, -6.42562866210936),
							new VELatLong(53.699755377372, -6.430778503417966),
							new VELatLong(53.70077162898382, -6.440391540527335),
							new VELatLong(53.692844215631325, -6.4530944824218714),
							new VELatLong(53.686745189388155, -6.476097106933589),
							new VELatLong(53.689998113329764, -6.494979858398434),
							new VELatLong(53.699552124105, -6.495666503906247),
							new VELatLong(53.701178122757796, -6.510086059570298),
							new VELatLong(53.69894235841468, -6.526565551757818),
							new VELatLong(53.70930717377283, -6.553344726562485),
							new VELatLong(53.70361700295342, -6.565704345703134),
							new VELatLong(53.694063914862895, -6.579093933105483),
							new VELatLong(53.688574990027895, -6.596946716308594),
							new VELatLong(53.68410200363792, -6.609649658203132),
							new VELatLong(53.67739163313866, -6.624412536621105),
							new VELatLong(53.672714075978654, -6.631278991699226),
							new VELatLong(53.672714075978654, -6.651535034179695),
							new VELatLong(53.66478137895582, -6.660461425781251),
							new VELatLong(53.656033340847216, -6.670074462890618),
							new VELatLong(53.65521947755351, -6.686210632324215)
                         ]);

  e_boyne_1.SetTitle('River Boyne');
  e_boyne_1.SetDescription('Click on the river name to view the details.');
  e_boyne_1.SetLineWidth (2);
  e_boyne_1.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/boyne.gif');
  e_boyne_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_boyne_1);

  e_boyne_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.6542021263408, -6.681747436523454),
							new VELatLong(53.64219552787356, -6.67076110839843),
							new VELatLong(53.626927967271726, -6.659774780273439),
							new VELatLong(53.609414363746225, -6.641921997070328),
							new VELatLong(53.600654837069925, -6.660804748535173),
							new VELatLong(53.59535749769301, -6.684494018554702),
							new VELatLong(53.59168971976165, -6.699943542480455),
							new VELatLong(53.582518881926795, -6.69857025146483),
							new VELatLong(53.57783079627527, -6.714706420898429),
							new VELatLong(53.56539465968141, -6.7329025268554625),
							new VELatLong(53.55132314566441, -6.746635437011735),
							new VELatLong(53.55540232708106, -6.764831542968735),
							new VELatLong(53.5517310815021, -6.783370971679691),
							new VELatLong(53.5570338895412, -6.796417236328119),
							new VELatLong(53.552546941380015, -6.821823120117195),
							new VELatLong(53.55213901340729, -6.839332580566416),
							new VELatLong(53.54601962190941, -6.849975585937485),
							new VELatLong(53.53847115373214, -6.846199035644536),
							new VELatLong(53.528064301939835, -6.842765808105476),
							new VELatLong(53.51887966157474, -6.849975585937485),
							new VELatLong(53.51867553583642, -6.871261596679689),
							new VELatLong(53.52153320667785, -6.888771057128911)
                         ]);

  e_boyne_2.SetTitle('River Boyne');
  e_boyne_2.SetDescription('Click on the river name to view the details.');
  e_boyne_2.SetLineWidth (2);
  e_boyne_2.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/boyne.gif');
  e_boyne_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_boyne_2);

  e_boyne_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.521329093724475, -6.887741088867176),
							new VELatLong(53.51785902304841, -6.8970108032226545),
							new VELatLong(53.51887966157474, -6.914520263671877),
							new VELatLong(53.508876343794036, -6.926879882812491),
							new VELatLong(53.49703262987648, -6.928253173828115),
							new VELatLong(53.489679694775454, -6.933059692382799),
							new VELatLong(53.493764816118386, -6.947822570800772),
							new VELatLong(53.48865835295432, -6.952629089355455),
							new VELatLong(53.482938384238494, -6.948165893554695),
							new VELatLong(53.48007811063232, -6.960868835449233),
							new VELatLong(53.46863508774875, -6.9615554809570455),
							new VELatLong(53.46045961072169, -6.951255798339833),
							new VELatLong(53.45187366525012, -6.961212158203122),
							new VELatLong(53.445330827258004, -6.982841491699215),
							new VELatLong(53.436332779353926, -7.005500793457044),
							new VELatLong(53.423650477287055, -7.015800476074224),
							new VELatLong(53.4113736785955, -7.030563354492197),
							new VELatLong(53.40236844016237, -7.05596923828124),
							new VELatLong(53.39254236949268, -7.0758819580078205),
							new VELatLong(53.37657016529287, -7.084465026855452),
							new VELatLong(53.36878666426245, -7.088928222656247),
							new VELatLong(53.36018219246917, -7.074165344238273)
                         ]);

  e_boyne_3.SetTitle('River Boyne');
  e_boyne_3.SetDescription('Click on the river name to view the details.');
  e_boyne_3.SetLineWidth (2);
  e_boyne_3.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/boyne.gif');
  e_boyne_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_boyne_3);
}

addECastletownCourtbane = function ()
{
  e_castletown_courtbane = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.01140032647095, -6.403656005859378),
							new VELatLong(54.016241919536995, -6.419448852539053),
							new VELatLong(54.02229311862033, -6.416015624999993),
							new VELatLong(54.0263267623275, -6.419448852539053),
							new VELatLong(54.02552006488194, -6.424942016601548),
							new VELatLong(54.027940110275836, -6.437988281250008),
							new VELatLong(54.031569914318766, -6.446228027343753),
							new VELatLong(54.02673010518241, -6.4448547363281285),
							new VELatLong(54.02834343748328, -6.462707519531239),
							new VELatLong(54.03076331858032, -6.480560302734384),
							new VELatLong(54.03439287618642, -6.503219604492179),
							new VELatLong(54.03802211695682, -6.514892578125015),
							new VELatLong(54.04407014753034, -6.526565551757818),
							new VELatLong(54.04527964804285, -6.533432006835938),
							new VELatLong(54.04850481065723, -6.547164916992177),
							new VELatLong(54.05132662262107, -6.553344726562485),
							new VELatLong(54.05858183061357, -6.558151245117203),
							new VELatLong(54.069059338728486, -6.56433105468751),
							new VELatLong(54.078325700301484, -6.573944091796877),
							new VELatLong(54.08557619279561, -6.578063964843749),
							new VELatLong(54.09765753233313, -6.577377319335937),
							new VELatLong(54.10409947497826, -6.579437255859372),
							new VELatLong(54.11295551240447, -6.582870483398432),
							new VELatLong(54.11979751852751, -6.587677001953116),
							new VELatLong(54.12502887884481, -6.595230102539047),
							new VELatLong(54.13267352528722, -6.602783203125012),
							new VELatLong(54.1403167612481, -6.605529785156261),
							new VELatLong(54.147556420663406, -6.606216430664072)
                         ]);

  e_castletown_courtbane.SetTitle('River Castletown (Courtbane)');
  e_castletown_courtbane.SetDescription('Click on the river name to view the details.');
  e_castletown_courtbane.SetLineWidth (2);
  e_castletown_courtbane.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/castletown-courtbane.gif');
  e_castletown_courtbane.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_castletown_courtbane);
}

addEFane = function ()
{
  e_fane_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.95406535327657, -6.378936767578114),
							new VELatLong(53.95204507768737, -6.383056640624986),
							new VELatLong(53.94840833496745, -6.385803222656266),
							new VELatLong(53.95042878674245, -6.3912963867187615),
							new VELatLong(53.947196016918234, -6.398849487304695),
							new VELatLong(53.9427505492469, -6.401596069335942),
							new VELatLong(53.945175408527604, -6.4118957519531214),
							new VELatLong(53.947600126850034, -6.4215087890624884),
							new VELatLong(53.94315470224929, -6.434555053710949),
							new VELatLong(53.95042878674245, -6.446228027343753),
							new VELatLong(53.95446939664898, -6.463394165039051),
							new VELatLong(53.959317611745604, -6.4764404296875115),
							new VELatLong(53.96578102161268, -6.4908599853515625),
							new VELatLong(53.97183955821784, -6.498413085937494),
							new VELatLong(53.973455019232205, -6.510086059570298),
							new VELatLong(53.97143568317845, -6.52381896972657),
							new VELatLong(53.97708957753223, -6.538238525390622),
							new VELatLong(53.98274270472304, -6.553344726562485),
							new VELatLong(53.98839506479995, -6.5554046630859535),
							new VELatLong(53.99727579515571, -6.558837890625014),
							new VELatLong(54.002119031589814, -6.575317382812501)
                         ]);

  e_fane_1.SetTitle('River Fane');
  e_fane_1.SetDescription('Click on the river name to view the details.');
  e_fane_1.SetLineWidth (2);
  e_fane_1.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/fane.gif');
  e_fane_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_fane_1);

  e_fane_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.002522609191146, -6.577377319335937),
							new VELatLong(54.00373331851739, -6.58905029296874),
							new VELatLong(54.00857580366484, -6.597290039062517),
							new VELatLong(54.01261077755601, -6.593856811523423),
							new VELatLong(54.01825908370411, -6.597976684570329),
							new VELatLong(54.02430998937393, -6.607589721679696),
							new VELatLong(54.032779778588896, -6.619262695312499),
							new VELatLong(54.04407014753034, -6.632308959960928),
							new VELatLong(54.05172972297256, -6.641235351562515),
							new VELatLong(54.06099995171849, -6.6501617431640705),
							new VELatLong(54.06220895948078, -6.668014526367182),
							new VELatLong(54.0557605113977, -6.672821044921866),
							new VELatLong(54.05535745015318, -6.679687499999986),
							new VELatLong(54.05938788662358, -6.68380737304689),
							new VELatLong(54.06341793205028, -6.696166992187506),
							new VELatLong(54.07067102844564, -6.700286865234378),
							new VELatLong(54.07953420368011, -6.69754028320313),
							new VELatLong(54.086784485066595, -6.693420410156258)
                         ]);

  e_fane_2.SetTitle('River Fane');
  e_fane_2.SetDescription('Click on the river name to view the details.');
  e_fane_2.SetLineWidth (2);
  e_fane_2.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/fane.gif');
  e_fane_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_fane_2);

  e_fane_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(54.124224097164046, -6.707839965820309),
							new VELatLong(54.12502887884481, -6.70097351074219),
							new VELatLong(54.13025957879544, -6.69754028320313),
							new VELatLong(54.136294181293415, -6.689987182617199),
							new VELatLong(54.137903260158126, -6.684494018554702),
							new VELatLong(54.13548961841917, -6.673507690429677),
							new VELatLong(54.1322712106399, -6.660461425781251),
							new VELatLong(54.12905255280179, -6.644668579101575),
							new VELatLong(54.13468503991687, -6.637802124023423),
							new VELatLong(54.14393674917482, -6.635055541992175),
							new VELatLong(54.14916506197795, -6.630935668945303),
							new VELatLong(54.16364002133428, -6.6329956054687384),
							new VELatLong(54.17167947814423, -6.635055541992175),
							new VELatLong(54.176100513511145, -6.642608642578139),
							new VELatLong(54.185342969649504, -6.639175415039079)
                         ]);

  e_fane_3.SetTitle('River Little Fane');
  e_fane_3.SetDescription('Click on the river name to view the details.');
  e_fane_3.SetLineWidth (2);
  e_fane_3.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/fane.gif');
  e_fane_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_fane_3);
}

addESlaney = function ()
{
  e_slaney_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.48152570318334, -6.5650177001953205),
							new VELatLong(52.4961595310971, -6.568450927734381),
							new VELatLong(52.50953477032728, -6.562271118164073),
							new VELatLong(52.516638711004205, -6.545104980468741),
							new VELatLong(52.52457705042608, -6.532745361328125),
							new VELatLong(52.532513955470314, -6.529312133789065),
							new VELatLong(52.539614181069446, -6.542358398437494),
							new VELatLong(52.5571509927844, -6.560211181640637),
							new VELatLong(52.57134232736758, -6.573257446289065),
							new VELatLong(52.58678062186081, -6.5725708007812535),
							new VELatLong(52.599294167028276, -6.5808105468749964),
							new VELatLong(52.60680057882597, -6.593170166015612),
							new VELatLong(52.61805778461653, -6.603469848632825),
							new VELatLong(52.628478542909875, -6.624069213867183),
							new VELatLong(52.63639665997182, -6.621322631835935),
							new VELatLong(52.64514659600372, -6.637802124023423),
							new VELatLong(52.65222859561963, -6.647415161132823),
							new VELatLong(52.658892959325414, -6.648788452148447),
							new VELatLong(52.66638915420002, -6.654281616210943),
							new VELatLong(52.66597273265814, -6.6721343994140545),
							new VELatLong(52.672218639152796, -6.676254272460925),
							new VELatLong(52.683875276043096, -6.67076110839843),
							new VELatLong(52.700106122739086, -6.67762756347655),
							new VELatLong(52.70593110882332, -6.676940917968738)
                         ]);

  e_slaney_1.SetTitle('River Slaney');
  e_slaney_1.SetDescription('Click on the river name to view the details.');
  e_slaney_1.SetLineWidth (2);
  e_slaney_1.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/slaney.gif');
  e_slaney_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_slaney_1);

  e_slaney_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.706763186227434, -6.679000854492173),
							new VELatLong(52.722985524570674, -6.694793701171882),
							new VELatLong(52.739617554270886, -6.714019775390617),
							new VELatLong(52.755412106022746, -6.727066040039077),
							new VELatLong(52.765384662668346, -6.737365722656257),
							new VELatLong(52.77701642614788, -6.7414855957031285),
							new VELatLong(52.78656876423497, -6.739425659179693),
							new VELatLong(52.79362784046839, -6.746292114257812),
							new VELatLong(52.799440337362306, -6.733932495117197),
							new VELatLong(52.811063001001465, -6.746978759765624),
							new VELatLong(52.826416756006004, -6.762084960937488),
							new VELatLong(52.83927653705787, -6.769638061523452),
							new VELatLong(52.85088855106404, -6.757278442382803),
							new VELatLong(52.85420569896367, -6.742858886718753),
							new VELatLong(52.851303208414535, -6.734619140625009),
							new VELatLong(52.85752259337269, -6.721572875976548),
							new VELatLong(52.86166835492544, -6.706466674804686),
							new VELatLong(52.876175401572155, -6.710586547851557),
							new VELatLong(52.88239122226189, -6.693420410156258),
							new VELatLong(52.89896238858775, -6.68724060058595),
							new VELatLong(52.90558908140782, -6.676940917968738),
							new VELatLong(52.916355295772796, -6.681060791015608),
							new VELatLong(52.92629096477686, -6.693420410156258),
							new VELatLong(52.93581050828409, -6.703033447265626),
							new VELatLong(52.94615546362908, -6.7085266113281214),
							new VELatLong(52.95939339754386, -6.703033447265626),
							new VELatLong(52.9705597527724, -6.698226928710942),
							new VELatLong(52.98006955830559, -6.6755676269531134)
                         ]);

  e_slaney_2.SetTitle('River Slaney');
  e_slaney_2.SetDescription('Click on the river name to view the details.');
  e_slaney_2.SetLineWidth (2);
  e_slaney_2.SetCustomIcon ('/images/salmon-rivers/eastern/map-titles/slaney.gif');
  e_slaney_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(e_slaney_2);
}

addSHFeale = function ()
{
  sh_feale_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.46939684276204, -9.631576538085935),
							new VELatLong(52.46061178780973, -9.624023437500005),
							new VELatLong(52.445966133278844, -9.624023437500005),
							new VELatLong(52.43759500093111, -9.606857299804673),
							new VELatLong(52.428803600050124, -9.592437744140621),
							new VELatLong(52.42168546718758, -9.590377807617185),
							new VELatLong(52.42168546718758, -9.568405151367201),
							new VELatLong(52.42503531994297, -9.549865722656246),
							new VELatLong(52.43299020014245, -9.530639648437512),
							new VELatLong(52.434664728829794, -9.515533447265614),
							new VELatLong(52.44345496058315, -9.496994018554692),
							new VELatLong(52.44554761443697, -9.483947753906266),
							new VELatLong(52.43843218574212, -9.483947753906266),
							new VELatLong(52.44303641788338, -9.459915161132814),
							new VELatLong(52.44303641788338, -9.440002441406266),
							new VELatLong(52.43968793313463, -9.420776367187498),
							new VELatLong(52.436757800213826, -9.40429687500001),
							new VELatLong(52.428803600050124, -9.39674377441408),
							new VELatLong(52.42210421270189, -9.380264282226559),
							new VELatLong(52.41582261237878, -9.364471435546883)
                         ]);

  sh_feale_1.SetTitle('River Feale');
  sh_feale_1.SetDescription('Click on the river name to view the details.');
  sh_feale_1.SetLineWidth (2);
  sh_feale_1.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/feale.gif');
  sh_feale_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_feale_1);

  sh_feale_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.41540380720551, -9.362411499023448),
							new VELatLong(52.409540117146925, -9.358291625976576),
							new VELatLong(52.407026868468094, -9.345932006835926),
							new VELatLong(52.39990521956092, -9.333572387695314),
							new VELatLong(52.39822937039374, -9.323959350585946),
							new VELatLong(52.391944369141115, -9.312286376953141),
							new VELatLong(52.387334799335896, -9.301300048828118),
							new VELatLong(52.37601835975286, -9.310913085937485),
							new VELatLong(52.370149434359696, -9.324645996093757),
							new VELatLong(52.36847245528926, -9.337692260742184),
							new VELatLong(52.36050593525291, -9.343872070312491),
							new VELatLong(52.35379617257395, -9.33631896972656),
							new VELatLong(52.3445685853867, -9.315719604492201),
							new VELatLong(52.33408035260882, -9.300613403320305),
							new VELatLong(52.33114320164081, -9.282760620117194),
							new VELatLong(52.32442898129939, -9.266281127929675),
							new VELatLong(52.318133474214946, -9.242935180664067),
							new VELatLong(52.30386034195304, -9.227828979492205),
							new VELatLong(52.28832258600298, -9.212036132812494),
							new VELatLong(52.280341619966634, -9.187316894531266),
							new VELatLong(52.279921529300445, -9.157104492187505),
							new VELatLong(52.29588217518086, -9.131698608398428)
                         ]);

  sh_feale_2.SetTitle('River Feale');
  sh_feale_2.SetDescription('Click on the river name to view the details.');
  sh_feale_2.SetLineWidth (2);
  sh_feale_2.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/feale.gif');
  sh_feale_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_feale_2);
}

addSHMulcair = function ()
{
  sh_mulcair = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.67804734641935, -8.543243408203112),
							new VELatLong(52.6747167517771, -8.534317016601557),
							new VELatLong(52.66680557177391, -8.52470397949219),
							new VELatLong(52.65722696364053, -8.522644042968753),
							new VELatLong(52.64931261703425, -8.512344360351573),
							new VELatLong(52.64472997207246, -8.496551513671866),
							new VELatLong(52.638480136835, -8.48350524902344),
							new VELatLong(52.63472980703676, -8.468399047851575),
							new VELatLong(52.62972886718355, -8.454666137695303),
							new VELatLong(52.628895321637195, -8.440246582031251),
							new VELatLong(52.63139591064365, -8.422393798828141),
							new VELatLong(52.62306005822958, -8.40934753417968),
							new VELatLong(52.61680712689298, -8.403167724609371),
							new VELatLong(52.6063835896964, -8.40934753417968),
							new VELatLong(52.598042973325626, -8.392868041992194),
							new VELatLong(52.58761496938908, -8.388061523437508),
							new VELatLong(52.582191426524304, -8.372955322265612),
							new VELatLong(52.580522509085554, -8.341369628906264),
							new VELatLong(52.58010526979777, -8.328323364257803)
                         ]);

  sh_mulcair.SetTitle('River Mulcair');
  sh_mulcair.SetDescription('Click on the river name to view the details.');
  sh_mulcair.SetLineWidth (2);
  sh_mulcair.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/mulcair.gif');
  sh_mulcair.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_mulcair);
}

addSHShannon = function ()
{
  sh_shannon_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.6884538180927, -8.624954223632801),
							new VELatLong(52.683875276043096, -8.608474731445316),
							new VELatLong(52.6755494242435, -8.597488403320325),
							new VELatLong(52.67055315138107, -8.589248657226546),
							new VELatLong(52.67679840318568, -8.574142456054684),
							new VELatLong(52.67679840318568, -8.561096191406257),
							new VELatLong(52.68012883912435, -8.543930053710925),
							new VELatLong(52.693448043769095, -8.540496826171864),
							new VELatLong(52.70260264054547, -8.526077270507814),
							new VELatLong(52.70842729343814, -8.508911132812516),
							new VELatLong(52.719242443454185, -8.499984741210926),
							new VELatLong(52.728391630180795, -8.506164550781266),
							new VELatLong(52.740864700729404, -8.50685119628908),
							new VELatLong(52.75167180854816, -8.497924804687491),
							new VELatLong(52.75707435737538, -8.475265502929696)
                         ]);

  sh_shannon_1.SetTitle('River Shannon (Limerick)');
  sh_shannon_1.SetDescription('Click on the river name to view the details.');
  sh_shannon_1.SetLineWidth (2);
  sh_shannon_1.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/shannon.gif');
  sh_shannon_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_shannon_1);

  sh_shannon_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.080414910528624, -8.206100463867173),
							new VELatLong(53.093611719968244, -8.191680908203121),
							new VELatLong(53.10433114830042, -8.176574707031258),
							new VELatLong(53.11339934771826, -8.168334960937516),
							new VELatLong(53.124937927070185, -8.166275024414046),
							new VELatLong(53.13853299128652, -8.151168823242184),
							new VELatLong(53.14841760919747, -8.138122558593757),
							new VELatLong(53.15871166734232, -8.123016357421859),
							new VELatLong(53.16241692410577, -8.104476928710937),
							new VELatLong(53.17147287197633, -8.096237182617192),
							new VELatLong(53.16900325753322, -8.07838439941405),
							new VELatLong(53.17723475293361, -8.062591552734375),
							new VELatLong(53.19204746518192, -8.042678833007826),
							new VELatLong(53.19862925069219, -8.02688598632812),
							new VELatLong(53.19328162693693, -7.993927001953111),
							new VELatLong(53.20438748411786, -7.976074218750001),
							new VELatLong(53.22289085230567, -7.9671478271484455),
							new VELatLong(53.23850969567222, -7.978820800781248),
							new VELatLong(53.250014671414974, -8.001480102539075),
							new VELatLong(53.254944428477984, -8.022766113281246),
							new VELatLong(53.26849833145892, -8.039245605468767),
							new VELatLong(53.28122687305016, -8.05091857910157)
                         ]);

  sh_shannon_2.SetTitle('River Shannon (Meelick)');
  sh_shannon_2.SetDescription('Click on the river name to view the details.');
  sh_shannon_2.SetLineWidth (2);
  sh_shannon_2.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/shannon.gif');
  sh_shannon_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_shannon_2);

  sh_shannon_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.95770160268639, -8.10928344726562),
							new VELatLong(53.96578102161268, -8.09486389160157),
							new VELatLong(53.97466657389323, -8.08731079101564),
							new VELatLong(53.97628192530914, -8.0756378173828),
							new VELatLong(53.98718390935948, -8.068771362304682),
							new VELatLong(53.995661257790076, -8.07838439941405),
							new VELatLong(54.01301425342596, -8.082504272460953),
							new VELatLong(54.02834343748328, -8.086624145507825),
							new VELatLong(54.0408446407397, -8.085250854492203),
							new VELatLong(54.04810167901885, -8.0756378173828),
							new VELatLong(54.05777575896167, -8.059844970703125)
                         ]);

  sh_shannon_3.SetTitle('River Shannon (Upper Shannon)');
  sh_shannon_3.SetDescription('Click on the river name to view the details.');
  sh_shannon_3.SetLineWidth (2);
  sh_shannon_3.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/shannon.gif');
  sh_shannon_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_shannon_3);
}

addSHSuck = function ()
{
  sh_suck_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.273015344576784, -8.052291870117194),
							new VELatLong(53.27055157840244, -8.059844970703125),
							new VELatLong(53.273015344576784, -8.089370727539075),
							new VELatLong(53.27917413882756, -8.122329711914048),
							new VELatLong(53.27958469355967, -8.144302368164064),
							new VELatLong(53.28738448416438, -8.164901733398421),
							new VELatLong(53.29436203746641, -8.18000793457032),
							new VELatLong(53.30380044277939, -8.188934326171875),
							new VELatLong(53.314877648496854, -8.19099426269531),
							new VELatLong(53.32308113313478, -8.208847045898455),
							new VELatLong(53.33046292113121, -8.210220336914078),
							new VELatLong(53.3341533362037, -8.226699829101566),
							new VELatLong(53.341943164024386, -8.236999511718744),
							new VELatLong(53.35014144569699, -8.239746093749993),
							new VELatLong(53.35546948344971, -8.22807312011719),
							new VELatLong(53.36448464557602, -8.23905944824218),
							new VELatLong(53.37349790058685, -8.242492675781241),
							new VELatLong(53.38496655811502, -8.231506347656248),
							new VELatLong(53.39888863294424, -8.22807312011719),
							new VELatLong(53.41157832095128, -8.23837280273437),
							new VELatLong(53.411987602709075, -8.25485229492189),
							new VELatLong(53.43040120587383, -8.261032104492198),
							new VELatLong(53.43776441444167, -8.243179321289051),
							new VELatLong(53.44635321212874, -8.23905944824218),
							new VELatLong(53.452895892648655, -8.2555389404297),
							new VELatLong(53.46066401683641, -8.263778686523444),
							new VELatLong(53.467613239222935, -8.278198242187496)
                         ]);

  sh_suck_1.SetTitle('River Suck');
  sh_suck_1.SetDescription('Click on the river name to view the details.');
  sh_suck_1.SetLineWidth (2);
  sh_suck_1.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/suck.gif');
  sh_suck_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_suck_1);

  sh_suck_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.465569468370454, -8.274765014648435),
							new VELatLong(53.47333527412443, -8.283691406249991),
							new VELatLong(53.47823926148309, -8.269958496093753),
							new VELatLong(53.487636986538504, -8.278884887695307),
							new VELatLong(53.495807229228646, -8.277511596679684),
							new VELatLong(53.50560944286765, -8.287811279296862),
							new VELatLong(53.513776223070145, -8.290557861328112),
							new VELatLong(53.519492032888884, -8.27957153320312),
							new VELatLong(53.52683979828348, -8.282318115234368),
							new VELatLong(53.532553845804244, -8.289871215820298),
							new VELatLong(53.54193953598892, -8.292617797851548),
							new VELatLong(53.55336278552808, -8.297424316406264),
							new VELatLong(53.56192819942793, -8.304290771484383),
							new VELatLong(53.561520361897465, -8.28643798828124),
							new VELatLong(53.56763751199531, -8.288497924804676),
							new VELatLong(53.57497692436618, -8.305664062500007),
							new VELatLong(53.57783079627527, -8.33106994628905),
							new VELatLong(53.58231506292683, -8.33999633789064),
							new VELatLong(53.59168971976165, -8.346176147460946),
							new VELatLong(53.598617477458596, -8.35784912109375),
							new VELatLong(53.604321836755055, -8.382568359375014),
							new VELatLong(53.61857936489516, -8.383941650390637),
							new VELatLong(53.62876036627692, -8.400421142578125),
							new VELatLong(53.63975308945901, -8.388061523437508),
							new VELatLong(53.64382374157658, -8.361968994140623)
                         ]);

  sh_suck_2.SetTitle('River Suck');
  sh_suck_2.SetDescription('Click on the river name to view the details.');
  sh_suck_2.SetLineWidth (2);
  sh_suck_2.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/suck.gif');
  sh_suck_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_suck_2);

  sh_suck_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(53.648708005545856, -8.361968994140623),
							new VELatLong(53.65399865315215, -8.372268676757801),
							new VELatLong(53.660509308109724, -8.393554687500005),
							new VELatLong(53.666205306341766, -8.40934753417968),
							new VELatLong(53.672714075978654, -8.432693481445321),
							new VELatLong(53.68450865839825, -8.43955993652344),
							new VELatLong(53.695486852636556, -8.451919555664055),
							new VELatLong(53.6958933974518, -8.440246582031251),
							new VELatLong(53.70849433933769, -8.452606201171868),
							new VELatLong(53.71865364115011, -8.451919555664055),
							new VELatLong(53.72962293149973, -8.467025756835951),
							new VELatLong(53.739371009757036, -8.491744995117182),
							new VELatLong(53.74749268152056, -8.499984741210926),
							new VELatLong(53.75886038500171, -8.496551513671866),
							new VELatLong(53.772254086414236, -8.497238159179676),
							new VELatLong(53.777529219999806, -8.52470397949219),
							new VELatLong(53.77915220464788, -8.547363281249984),
							new VELatLong(53.78036940194484, -8.567962646484376)
                         ]);

  sh_suck_3.SetTitle('River Suck');
  sh_suck_3.SetDescription('Click on the river name to view the details.');
  sh_suck_3.SetLineWidth (2);
  sh_suck_3.SetCustomIcon ('/images/salmon-rivers/shannon/map-titles/suck.gif');
  sh_suck_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sh_suck_3);
}

addSBarrow = function ()
{
  s_barrow_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.42252295423905, -6.950912475585943),
							new VELatLong(52.42084796422747, -6.928253173828115),
							new VELatLong(52.43299020014245, -6.920013427734371),
							new VELatLong(52.45015110300571, -6.922073364257808),
							new VELatLong(52.464377026041284, -6.914520263671877),
							new VELatLong(52.467305322032686, -6.9309997558593634),
							new VELatLong(52.47734371515986, -6.920700073242183),
							new VELatLong(52.49239701180822, -6.935119628906235),
							new VELatLong(52.505355445221426, -6.937179565429704),
							new VELatLong(52.52624809700059, -6.934432983398423),
							new VELatLong(52.53418470008422, -6.959152221679687),
							new VELatLong(52.546713258534, -6.937179565429704),
							new VELatLong(52.560073113485664, -6.9152069091796875),
							new VELatLong(52.57676721252861, -6.920700073242183),
							new VELatLong(52.59095220066401, -6.933746337890611),
							new VELatLong(52.60263050886586, -6.961898803710935),
							new VELatLong(52.61430570425853, -6.977005004882797),
							new VELatLong(52.628478542909875, -6.9859313964843865),
							new VELatLong(52.647229656128175, -6.986618041992198),
							new VELatLong(52.668887600123746, -6.981811523437515)
                         ]);

  s_barrow_1.SetTitle('River Barrow');
  s_barrow_1.SetDescription('Click on the river name to view the details.');
  s_barrow_1.SetLineWidth (2);
  s_barrow_1.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/barrow.gif');
  s_barrow_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_barrow_1);

  s_barrow_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.670969529275744, -6.975631713867173),
							new VELatLong(52.683875276043096, -6.9687652587890545),
							new VELatLong(52.699690022554584, -6.979751586914079),
							new VELatLong(52.70260264054547, -6.953659057617191),
							new VELatLong(52.716746877574174, -6.964645385742182),
							new VELatLong(52.73795463681312, -6.972885131835926),
							new VELatLong(52.755827674807776, -6.958465576171875),
							new VELatLong(52.77493955345386, -6.951599121093755),
							new VELatLong(52.79030606491864, -6.944732666015636),
							new VELatLong(52.807742556974176, -6.950912475585943),
							new VELatLong(52.81977796002411, -6.941299438476575),
							new VELatLong(52.83471382471821, -6.9309997558593634),
							new VELatLong(52.84674175970579, -6.9309997558593634),
							new VELatLong(52.86332654865163, -6.933746337890611),
							new VELatLong(52.87824744079774, -6.939926147460953),
							new VELatLong(52.89357745439449, -6.939926147460953),
							new VELatLong(52.91428507775631, -6.937179565429704),
							new VELatLong(52.928774525801366, -6.944046020507824),
							new VELatLong(52.94574171290331, -6.955032348632815),
							new VELatLong(52.96270224793395, -6.96739196777343),
							new VELatLong(52.98172322390682, -6.9783782958984215)
                         ]);

  s_barrow_2.SetTitle('River Barrow');
  s_barrow_2.SetDescription('Click on the river name to view the details.');
  s_barrow_2.SetLineWidth (2);
  s_barrow_2.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/barrow.gif');
  s_barrow_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_barrow_2);

  s_barrow_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.98585711100672, -6.983184814453139),
							new VELatLong(53.00073582942252, -6.993484497070318),
							new VELatLong(53.013543951831245, -7.007217407226557),
							new VELatLong(53.02469631686729, -7.025070190429702),
							new VELatLong(53.0408001997556, -7.039489746093753),
							new VELatLong(53.045341233329125, -7.059402465820298),
							new VELatLong(53.058136118074316, -7.04910278320312),
							new VELatLong(53.07752756905206, -7.047042846679684),
							new VELatLong(53.09113762641937, -7.05253601074218),
							new VELatLong(53.1072166918934, -7.064208984375018),
							new VELatLong(53.12246563507001, -7.077941894531256),
							new VELatLong(53.1377091704424, -7.064208984375018),
							new VELatLong(53.15047661827521, -7.074508666992196),
							new VELatLong(53.15747651067802, -7.105407714843734),
							new VELatLong(53.15706478389239, -7.13768005371093),
							new VELatLong(53.15747651067802, -7.1692657470703125),
							new VELatLong(53.15665305315797, -7.195358276367201),
							new VELatLong(53.14388744169908, -7.222137451171868),
							new VELatLong(53.140180585580396, -7.244110107421884),
							new VELatLong(53.137297254095984, -7.278442382812515),
							new VELatLong(53.13111803493985, -7.318954467773454)
                         ]);

  s_barrow_3.SetTitle('River Barrow');
  s_barrow_3.SetDescription('Click on the river name to view the details.');
  s_barrow_3.SetLineWidth (2);
  s_barrow_3.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/barrow.gif');
  s_barrow_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_barrow_3);
}

addSColligan = function ()
{
  s_colligan = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.103974711040294, -7.640991210937498),
							new VELatLong(52.103974711040294, -7.6567840576171715),
							new VELatLong(52.11156571943226, -7.666397094726572),
							new VELatLong(52.1187338186051, -7.67257690429688),
							new VELatLong(52.118312197617946, -7.679443359374999),
							new VELatLong(52.125057654851226, -7.685623168945307),
							new VELatLong(52.13264507395748, -7.680130004882812),
							new VELatLong(52.13896693628084, -7.671203613281257),
							new VELatLong(52.14865871604898, -7.662277221679701),
							new VELatLong(52.15961210128131, -7.659530639648454),
							new VELatLong(52.173089491230925, -7.662277221679701),
							new VELatLong(52.18277384398685, -7.663650512695325),
							new VELatLong(52.194981544358754, -7.6643371582031365),
							new VELatLong(52.201715392564836, -7.673263549804693),
							new VELatLong(52.21391789218188, -7.680816650390624),
							new VELatLong(52.22569643615848, -7.67601013183594),
							new VELatLong(52.2441992657299, -7.660217285156265)
                         ]);

  s_colligan.SetTitle('River Colligan');
  s_colligan.SetDescription('Click on the river name to view the details.');
  s_colligan.SetLineWidth (2);
  s_colligan.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/colligan.gif');
  s_colligan.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_colligan);
}

addSMunsterBlackwater = function ()
{
  s_munster_blackwater_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(51.98234276429211, -7.857284545898431),
							new VELatLong(51.98953162190702, -7.878570556640636),
							new VELatLong(52.0005241134773, -7.8771972656250115),
							new VELatLong(52.00263774475871, -7.855911254882807),
							new VELatLong(52.01869808104434, -7.850418090820312),
							new VELatLong(52.02841601074974, -7.850418090820312),
							new VELatLong(52.04700094984325, -7.8497314453125),
							new VELatLong(52.05544609537056, -7.860031127929679),
							new VELatLong(52.070221259444864, -7.872390747070328),
							new VELatLong(52.08203787168061, -7.861404418945303),
							new VELatLong(52.100178722234695, -7.862777709960926),
							new VELatLong(52.11493908614797, -7.859344482421867),
							new VELatLong(52.12885152590712, -7.8476715087890625),
							new VELatLong(52.1469733406447, -7.853164672851558)
                         ]);

  s_munster_blackwater_1.SetTitle('Munster Blackwater');
  s_munster_blackwater_1.SetDescription('Click on the river name to view the details.');
  s_munster_blackwater_1.SetLineWidth (2);
  s_munster_blackwater_1.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/munster-blackwater.gif');
  s_munster_blackwater_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_munster_blackwater_1);

  s_munster_blackwater_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.14613062902013, -7.8476715087890625),
							new VELatLong(52.149080049932465, -7.870330810546891),
							new VELatLong(52.14275962303624, -7.878570556640636),
							new VELatLong(52.14191683166826, -7.90809631347655),
							new VELatLong(52.14191683166826, -7.9376220703124964),
							new VELatLong(52.14191683166826, -7.978134155273437),
							new VELatLong(52.14275962303624, -8.010406494140632),
							new VELatLong(52.14613062902013, -8.024139404296871),
							new VELatLong(52.144023780184014, -8.051605224609382),
							new VELatLong(52.14191683166826, -8.081130981445296),
							new VELatLong(52.14655198682596, -8.104476928710937),
							new VELatLong(52.14360239845529, -8.136749267578132),
							new VELatLong(52.14023120108505, -8.166275024414046),
							new VELatLong(52.14739469047636, -8.18000793457032),
							new VELatLong(52.14781603632094, -8.202667236328114),
							new VELatLong(52.15497830567234, -8.229446411132812),
							new VELatLong(52.149922705738426, -8.253479003906266),
							new VELatLong(52.13812407314122, -8.273391723632814),
							new VELatLong(52.13643829901316, -8.29879760742189),
							new VELatLong(52.13812407314122, -8.338623046875016),
							new VELatLong(52.13812407314122, -8.369522094726553),
							new VELatLong(52.13980978347098, -8.395614624023441),
							new VELatLong(52.144445157925546, -8.415527343749987),
							new VELatLong(52.14149543000338, -8.43612670898438)
                         ]);

  s_munster_blackwater_2.SetTitle('Munster Blackwater');
  s_munster_blackwater_2.SetDescription('Click on the river name to view the details.');
  s_munster_blackwater_2.SetLineWidth (2);
  s_munster_blackwater_2.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/munster-blackwater.gif');
  s_munster_blackwater_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_munster_blackwater_2);

  s_munster_blackwater_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.14275962303624, -8.432693481445321),
							new VELatLong(52.149080049932465, -8.446426391601559),
							new VELatLong(52.14318101273937, -8.473892211914071),
							new VELatLong(52.144445157925546, -8.489685058593746),
							new VELatLong(52.14823737817848, -8.524017333984378),
							new VELatLong(52.14613062902013, -8.570022583007812),
							new VELatLong(52.14233822934587, -8.594055175781264),
							new VELatLong(52.13180209119313, -8.621520996093743),
							new VELatLong(52.13390951819713, -8.644180297851571),
							new VELatLong(52.13180209119313, -8.666839599609366),
							new VELatLong(52.126322314426716, -8.689498901367194),
							new VELatLong(52.13095909247829, -8.707351684570303),
							new VELatLong(52.13053758713942, -8.728637695312508),
							new VELatLong(52.12885152590712, -8.756103515624987),
							new VELatLong(52.12294980913475, -8.7835693359375),
							new VELatLong(52.1322235845691, -8.80760192871095),
							new VELatLong(52.139388361869585, -8.8391876220703),
							new VELatLong(52.13980978347098, -8.87626647949218),
							new VELatLong(52.13685974852633, -8.903732299804691),
							new VELatLong(52.12294980913475, -8.928451538085923),
							new VELatLong(52.11662567378819, -8.953857421874998),
							new VELatLong(52.103974711040294, -8.992996215820314),
							new VELatLong(52.09342949993744, -9.016342163085953),
							new VELatLong(52.079927991751134, -9.045181274414055),
							new VELatLong(52.071909538409365, -9.076080322265626),
							new VELatLong(52.05375719395868, -9.06234741210939)
                         ]);

  s_munster_blackwater_3.SetTitle('Munster Blackwater');
  s_munster_blackwater_3.SetDescription('Click on the river name to view the details.');
  s_munster_blackwater_3.SetLineWidth (2);
  s_munster_blackwater_3.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/munster-blackwater.gif');
  s_munster_blackwater_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_munster_blackwater_3);
}

addSNore = function ()
{
  s_nore_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.42210421270189, -6.961898803710935),
							new VELatLong(52.42126671769611, -6.990051269531258),
							new VELatLong(52.43005962183451, -7.007217407226557),
							new VELatLong(52.45140651638898, -7.016830444335924),
							new VELatLong(52.453498792506735, -7.033996582031257),
							new VELatLong(52.46103016351591, -7.030563354492197),
							new VELatLong(52.471488264106505, -7.042922973632812),
							new VELatLong(52.48152570318334, -7.04910278320312),
							new VELatLong(52.48612543090344, -7.06283569335936),
							new VELatLong(52.497413632653576, -7.0662689208984535),
							new VELatLong(52.49950372242745, -7.0903015136718714),
							new VELatLong(52.49657756892364, -7.104721069335922),
							new VELatLong(52.50493749085376, -7.115707397460947),
							new VELatLong(52.52290594027806, -7.12738037109375),
							new VELatLong(52.51747439323025, -7.152099609375014),
							new VELatLong(52.52791908000258, -7.17887878417968),
							new VELatLong(52.53669069781574, -7.19467163085939),
							new VELatLong(52.55631606540655, -7.189865112304672),
							new VELatLong(52.57342890109033, -7.187118530273424),
							new VELatLong(52.59303784115742, -7.185058593749988),
							new VELatLong(52.615139527683084, -7.18917846679686),
							new VELatLong(52.63097915573266, -7.196731567382826),
							new VELatLong(52.64348007646559, -7.224884033203115),
							new VELatLong(52.658476466356674, -7.2544097900390625)
                         ]);

  s_nore_1.SetTitle('River Nore');
  s_nore_1.SetDescription('Click on the river name to view the details.');
  s_nore_1.SetLineWidth (2);
  s_nore_1.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/nore.gif');
  s_nore_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_nore_1);

  s_nore_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.65472785106219, -7.250976562500002),
							new VELatLong(52.672218639152796, -7.2605895996093714),
							new VELatLong(52.692199540905285, -7.281188964843764),
							new VELatLong(52.700106122739086, -7.300415039062498),
							new VELatLong(52.715499041092166, -7.325820922851573),
							new VELatLong(52.72922327925066, -7.337493896484376),
							new VELatLong(52.74335888658737, -7.3443603515624964),
							new VELatLong(52.75790545926437, -7.342300415039061),
							new VELatLong(52.77369338227129, -7.3429870605468714),
							new VELatLong(52.788645082025916, -7.343673706054685),
							new VELatLong(52.80525205752531, -7.3429870605468714),
							new VELatLong(52.81230810213061, -7.357406616210923),
							new VELatLong(52.830150633031316, -7.364959716796889),
							new VELatLong(52.840520829960816, -7.37594604492188)
                         ]);

  s_nore_2.SetTitle('River Nore');
  s_nore_2.SetDescription('Click on the river name to view the details.');
  s_nore_2.SetLineWidth (2);
  s_nore_2.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/nore.gif');
  s_nore_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_nore_2);

  s_nore_3 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.84881520489742, -7.380065917968752),
							new VELatLong(52.863741087182056, -7.398605346679674),
							new VELatLong(52.87658981733707, -7.418518066406254),
							new VELatLong(52.89813398072379, -7.424697875976563),
							new VELatLong(52.91014434483789, -7.441177368164049),
							new VELatLong(52.92629096477686, -7.46452331542969),
							new VELatLong(52.93581050828409, -7.500228881835945),
							new VELatLong(52.93539665862316, -7.551727294921875),
							new VELatLong(52.939948787227955, -7.613525390624985),
							new VELatLong(52.940362593356156, -7.64579772949218),
							new VELatLong(52.93332735095396, -7.681503295898436),
							new VELatLong(52.92711883428342, -7.724761962890623),
							new VELatLong(52.91594126008629, -7.761154174804688),
							new VELatLong(52.89357745439449, -7.790679931640637),
							new VELatLong(52.88239122226189, -7.817459106445304),
							new VELatLong(52.871202103513504, -7.861404418945303)
                         ]);

  s_nore_3.SetTitle('River Nore');
  s_nore_3.SetDescription('Click on the river name to view the details.');
  s_nore_3.SetLineWidth (2);
  s_nore_3.SetCustomIcon ('/images/salmon-rivers/southern/map-titles/nore.gif');
  s_nore_3.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(s_nore_3);
}

addSWBandon = function ()
{
  sw_bandon_1 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(51.69724635547481, -8.594741821289076),
							new VELatLong(51.711288790896184, -8.605041503906257),
							new VELatLong(51.72830408176859, -8.625640869140614),
							new VELatLong(51.73723454645786, -8.63319396972658),
							new VELatLong(51.74488782605038, -8.627014160156237),
							new VELatLong(51.755515230549584, -8.640747070312512),
							new VELatLong(51.76401535387307, -8.656539916992185),
							new VELatLong(51.7669900190017, -8.681945800781264),
							new VELatLong(51.7644403180351, -8.696365356445312),
							new VELatLong(51.75424007403353, -8.711471557617176),
							new VELatLong(51.74743863117571, -8.72520446777345),
							new VELatLong(51.744462677859595, -8.74305725097656),
							new VELatLong(51.741911704694274, -8.772583007812508),
							new VELatLong(51.74106134829762, -8.810348510742198)
                         ]);

  sw_bandon_1.SetTitle('River Bandon');
  sw_bandon_1.SetDescription('Click on the river name to view the details.');
  sw_bandon_1.SetLineWidth (2);
  sw_bandon_1.SetCustomIcon ('/images/salmon-rivers/south-western/map-titles/bandon.gif');
  sw_bandon_1.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sw_bandon_1);

  sw_bandon_2 = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(51.74148652849647, -8.802795410156267),
							new VELatLong(51.74021097589666, -8.825454711914062),
							new VELatLong(51.73425792096018, -8.84811401367189),
							new VELatLong(51.73638410203617, -8.882446289062487),
							new VELatLong(51.73468316517792, -8.909912109375),
							new VELatLong(51.73383267274114, -8.9366912841797),
							new VELatLong(51.73085582317015, -8.971023559570296),
							new VELatLong(51.72702815704775, -8.98818969726563),
							new VELatLong(51.72149873375865, -9.00878906249999),
							new VELatLong(51.715968634177535, -9.032135009765628),
							new VELatLong(51.71086332658574, -9.064407348632825),
							new VELatLong(51.71001238595861, -9.084320068359371),
							new VELatLong(51.715968634177535, -9.093246459960926),
							new VELatLong(51.7312810993987, -9.09805297851561),
							new VELatLong(51.74913908790853, -9.09805297851561),
							new VELatLong(51.756790351060346, -9.120025634765626),
							new VELatLong(51.75806543556619, -9.162597656250001),
							new VELatLong(51.761040492729535, -9.197616577148442)
                         ]);

  sw_bandon_2.SetTitle('River Bandon');
  sw_bandon_2.SetDescription('Click on the river name to view the details.');
  sw_bandon_2.SetLineWidth (2);
  sw_bandon_2.SetCustomIcon ('/images/salmon-rivers/south-western/map-titles/bandon.gif');
  sw_bandon_2.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sw_bandon_2);
}

addSWBrownFlesk = function ()
{
  sw_brown_flesk = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(52.1954024397613, -9.564285278320298),
							new VELatLong(52.18782571274125, -9.555358886718741),
							new VELatLong(52.18361586196996, -9.54780578613281),
							new VELatLong(52.18445786400997, -9.527206420898453),
							new VELatLong(52.18361586196996, -9.503860473632812),
							new VELatLong(52.17940561262086, -9.483947753906266),
							new VELatLong(52.175616047410195, -9.45854187011719),
							new VELatLong(52.16635130651441, -9.440002441406266),
							new VELatLong(52.16677247295651, -9.427642822265618),
							new VELatLong(52.17477387796152, -9.425582885742184),
							new VELatLong(52.17182615932842, -9.407043457031258),
							new VELatLong(52.171405040721865, -9.385070800781243),
							new VELatLong(52.18108976019081, -9.364471435546883),
							new VELatLong(52.19203516494969, -9.349365234374987),
							new VELatLong(52.201715392564836, -9.326019287109382),
							new VELatLong(52.215600732579105, -9.295806884765621)
                         ]);

  sw_brown_flesk.SetTitle('Brown Flesk');
  sw_brown_flesk.SetDescription('Click on the river name to view the details.');
  sw_brown_flesk.SetLineWidth (2);
  sw_brown_flesk.SetCustomIcon ('/images/salmon-rivers/south-western/map-titles/brown-flesk.gif');
  sw_brown_flesk.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sw_brown_flesk);
}

addSWRoughty = function ()
{
  sw_roughty = new VEShape(
                     VEShapeType.Polyline,
                         [
							new VELatLong(51.8815775618944, -9.55467224121093),
							new VELatLong(51.88708738637938, -9.536132812500007),
							new VELatLong(51.89174901806823, -9.51690673828124),
							new VELatLong(51.89556272072067, -9.48944091796876),
							new VELatLong(51.898528710127096, -9.475021362304676),
							new VELatLong(51.897681304561324, -9.464721679687496),
							new VELatLong(51.90107083092708, -9.444122314453137),
							new VELatLong(51.90234183738557, -9.427642822265618),
							new VELatLong(51.90657826586805, -9.409790039062507),
							new VELatLong(51.91123787572314, -9.39468383789061),
							new VELatLong(51.922673050361205, -9.380264282226559),
							new VELatLong(51.923519984478425, -9.361724853515637),
							new VELatLong(51.916744064103995, -9.348678588867176)
                         ]);

  sw_roughty.SetTitle('River Roughty');
  sw_roughty.SetDescription('Click on the river name to view the details.');
  sw_roughty.SetLineWidth (2);
  sw_roughty.SetCustomIcon ('/images/salmon-rivers/south-western/map-titles/roughty.gif');
  sw_roughty.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sw_roughty);
}

addSWSheen = function ()
{
  sw_sheen = new VEShape(
                     VEShapeType.Polyline,
                         [
                           new VELatLong(51.873947459165805,-9.560852050781238),
                           new VELatLong(51.872251704935074, -9.555358886718741),
                           new VELatLong(51.86758805107505, -9.549865722656246),
                           new VELatLong(51.865892057041194, -9.545745849609375),
                           new VELatLong(51.85995557431278, -9.545059204101564),
                           new VELatLong(51.85995557431278, -9.532012939453136),
                           new VELatLong(51.853594187742566, -9.523773193359359),
                           new VELatLong(51.849776924097846, -9.51690673828124),
                           new VELatLong(51.84086871639287, -9.513473510742179),
                           new VELatLong(51.83789892205579, -9.525146484375016),
                           new VELatLong(51.830685748817324, -9.523086547851547),
                           new VELatLong(51.820500478363115, -9.523086547851547),
                           new VELatLong(51.81370901858508, -9.530639648437512),
                           new VELatLong(51.80606740275157, -9.548492431640623),
                           new VELatLong(51.806491970954305, -9.562225341796863)
                         ]);

  sw_sheen.SetTitle('River Sheen');
  sw_sheen.SetDescription('Click on the river name to view the details.');
  sw_sheen.SetLineWidth (2);
  sw_sheen.SetCustomIcon ('/images/salmon-rivers/south-western/map-titles/sheen.gif');
  sw_sheen.SetLineColor(new VEColor(97,139,208,0));

  riverLayer.AddShape(sw_sheen);
}

var xmlHttpRequest;
var riverId;

createServerRequest = function ()
{
  try
  {
    xmlHttpRequest = new XMLHttpRequest();
  }
  catch (trymicrosoft)
  {
    try
    {
      xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (othermicrosoft)
    {
      try
      {
        xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch (failed)
      {
        xmlHttpRequest = false;
      }
    }
  }
}

logArticleComment = function ()
{
  var form = document.getElementById("logArticleComments");

  var articleId = form.articleId.value;
  var name = form.name.value;
  var comment = form.comment.value;
  var url;
  
  if (name == "")
  {
    alert ("Please enter your Name");
    form.name.focus();
    return false;
  }

  if (comment == "")
  {
    alert ("Please enter a Comment");
    form.comment.focus();
    return false;
  }

  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/salmon-fishing-articles/salmon-fishing-article-log-comment.jsp?articleId=" + escape(articleId) + "&name=" + escape(name) + "&comment=" + escape(comment);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayArticleCommentsList;
  xmlHttpRequest.send(null);

  form.name.value = "";
  form.comment.value = "";
}

logRiverCondition = function ()
{
  var form = document.getElementById("logRiverConditions");

  var riverId = form.riverId.value;
  var name = form.name.value;
  var message = form.message.value;
  var url;
  
  if (name == "")
  {
    alert ("Please enter your Name");
    form.name.focus();
    return false;
  }

  if (message == "")
  {
    alert ("Please enter a Message");
    form.message.focus();
    return false;
  }

  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/salmon-rivers/logRiverCondition.jsp?riverId=" + escape(riverId) + "&name=" + escape(name) + "&message=" + escape(message);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayRiverConditionList;
  xmlHttpRequest.send(null);
  
  form.name.value = "";
  form.message.value = "";
}

displayArticleCommentsList = function ()
{
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      document.getElementById("si_articleCommentsList").innerHTML = xmlHttpRequest.responseText;
    }
    else
    {
      alert ('Failed to get a response from the server: ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

displayRiverConditionList = function ()
{
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      document.getElementById("si_riverConditionsList").innerHTML = xmlHttpRequest.responseText;
    }
    else
    {
      alert ('Failed to get a response from the server: ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

submitRiverRating = function ()
{
  var riverIdElement = document.getElementById("ratingRiverId");
  var starsElement = document.getElementById("ratingStars");
  var nameElement = document.getElementById("ratingName");
  var summaryElement = document.getElementById("ratingSummary");
  var reviewElement = document.getElementById("ratingReview");
  var pageElement = document.getElementById("ratingPage");
  var url;
  
  riverId = riverIdElement.value;
  
  if (starsElement.value == 0)
  {
    alert ("The minimum stars is 1");
    starsElement.focus();
    return false;
  }

  if (nameElement.value == "")
  {
    alert ("Please enter your Name");
    nameElement.focus();
    return false;
  }

  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/salmon-rivers/submitRiverRating.jsp?riverId=" + escape(riverIdElement.value) + "&stars=" + escape(starsElement.value) + "&name=" + escape(nameElement.value) +
                                   "&summary=" + escape(summaryElement.value) + "&review=" + escape(reviewElement.value) + "&page=" + escape(pageElement.value);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayRiverRatingsList;
  xmlHttpRequest.send(null);
  
  starsElement.value = 0;
  nameElement.value = "";
  summaryElement.value = "";
  reviewElement.value = "";
}

riverRatings = function (pRiverId, pPage)
{
  riverId = pRiverId;
  
  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/salmon-rivers/riverRatings.jsp?riverId=" + escape(pRiverId) + "&page=" + escape(pPage);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayRiverRatingsList;
  xmlHttpRequest.send(null);
}

displayRiverRatingsList = function ()
{
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      document.getElementById("si_ratingsList").innerHTML = xmlHttpRequest.responseText;
      getRiverRatingSummary();
    }
    else
    {
      alert ('Failed to get a response from the server (LIST): ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

getRiverRatingSummary = function ()
{
  var url;
  
  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/salmon-rivers/riverRatingsSummary.jsp?riverId=" + escape(riverId);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayRiverRatingsSummary;
  xmlHttpRequest.send(null);
}

displayRiverRatingsSummary = function ()
{
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      document.getElementById("si_ratingsSummary").innerHTML = xmlHttpRequest.responseText;
    }
    else
    {
      alert ('Failed to get a response from the server (SUMMARY): ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

submitContactUs = function ()
{
  var emailAddressElement = document.getElementById("emailAddress");
  var subjectElement = document.getElementById("subject");
  var messageBodyElement = document.getElementById("messageBody");

  var url;

  // Validate the form.

  if (emailAddressElement.value == "")
  {
    alert ("Please enter your email address");
    emailAddressElement.focus();
    return false ;
  }

  with (emailAddressElement)
  {
    apos = value.indexOf("@");
    dotpos = value.lastIndexOf(".");
     
    if (apos < 1 || dotpos - apos < 2) 
    {
      alert ("Please enter a valid Email Address");
      emailAddressElement.focus();
      return false;
    }
  }

  if (subjectElement.value == "")
  {
    alert ("Please enter subject text");
    subjectElement.focus();
    return false ;
  }

  if (messageBodyElement.value == "")
  {
    alert ("Please enter body text");
    messageBodyElement.focus();
    return false ;
  }

  // Create and send the server request
  
  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/contacts/submitContactUsMessage.jsp?emailAddress=" + escape(emailAddressElement.value) + "&subject=" + escape(subjectElement.value) + "&body=" + escape(messageBodyElement.value);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayContactUsResult;
  xmlHttpRequest.send(null);
}

displayContactUsResult = function ()
{
  var serverResponse;
  var responseParts;
  var status;
  var message;
  var cssClass;
  var emailAddressElement = document.getElementById("emailAddress");
  var subjectElement = document.getElementById("subject");
  var messageBodyElement = document.getElementById("messageBody");
  
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      serverResponse = clean (xmlHttpRequest.responseText);
      
      responseParts = serverResponse.split (":");
      
      status = responseParts[0];
      message = responseParts[1];

      if (status == "Y")
      {
        emailAddressElement.value = "";
        subjectElement.value = "";
        messageBodyElement.value = "";
        
        cssClass = "si_successMessage";
      }
      else
      {
        cssClass = "si_errorMessage";
      }
      
      document.getElementById("si_contactUsResult").innerHTML = "<span class=\"" + cssClass + "\">" + message + "</span>";
    }
    else
    {
      alert ('Failed to get a response from the server: ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

blogSubscribe = function ()
{
  var emailAddressElement = document.getElementById("emailAddress");
  var firstNameElement = document.getElementById("firstName");

  var url;

  // Validate the form.

  if (emailAddressElement.value == "")
  {
    alert ("Please enter your email address");
    emailAddressElement.focus();
    return false ;
  }

  with (emailAddressElement)
  {
    apos = value.indexOf("@");
    dotpos = value.lastIndexOf(".");
     
    if (apos < 1 || dotpos - apos < 2) 
    {
      alert ("Please enter a valid Email Address");
      emailAddressElement.focus();
      return false;
    }
  }

  if (firstNameElement.value == "")
  {
    alert ("Please enter your First Name");
    firstNameElement.focus();
    return false ;
  }

  // Create and send the server request
  
  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/salmon-fishing-blog/salmon-fishing-blog-create-subscription.jsp?emailAddress=" + escape(emailAddressElement.value) + "&firstName=" + escape(firstNameElement.value);

  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayBlogSubscribeResult;
  xmlHttpRequest.send(null);
}

displayBlogSubscribeResult = function ()
{
  var serverResponse;
  var responseParts;
  var status;
  var message;
  var cssClass;
  var emailAddressElement = document.getElementById("emailAddress");
  var firstNameElement = document.getElementById("firstName");
  
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      serverResponse = clean (xmlHttpRequest.responseText);
      
      responseParts = serverResponse.split (":");
      
      status = responseParts[0];
      message = responseParts[1];

      if (status == "Y")
      {
        emailAddressElement.value = "";
        firstNameElement.value = "";
        
        cssClass = "si_successMessage";
      }
      else
      {
        cssClass = "si_errorMessage";
      }
      
      document.getElementById("si_blogSubscribeResult").innerHTML = "<span class=\"" + cssClass + "\">" + message + "</span>";
    }
    else
    {
      alert ('Failed to get a response from the server: ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

postClubNoticeBoardMessage = function ()
{
  var form = document.getElementById("postClubMessageForm");

  var clubId = form.clubId.value;
  var name = form.name.value;
  var password = form.password.value;
  var message = form.message.value;
  var url;
  
  if (name == "")
  {
    alert ("Please enter your Name");
    form.name.focus();
    return false;
  }

  if (password == "")
  {
    alert ("Please enter your Password");
    form.password.focus();
    return false;
  }

  if (message == "")
  {
    alert ("Please enter your Message");
    form.message.focus();
    return false;
  }

  document.getElementById("si_postClubMessageResult").innerHTML = "";

  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/irish-fishing-clubs/postClubMessage.jsp?clubId=" + escape(clubId) + "&name=" + escape(name) + "&password=" + escape(password) + "&message=" + escape(message);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayPostClubNoticeResult;
  xmlHttpRequest.send(null);
}

displayPostClubNoticeResult = function ()
{
  var serverResponse;
  var responseParts;
  var status;
  var message;
  var cssClass;
  var clubIdElement = document.getElementById("clubId");
  var nameElement = document.getElementById("name");
  var passwordElement = document.getElementById("password");
  var messageElement = document.getElementById("message");
  
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      serverResponse = clean (xmlHttpRequest.responseText);
      
      responseParts = serverResponse.split (":");
      
      status = responseParts[0];
      message = responseParts[1];

      if (status == "Y")
      {
        nameElement.value = "";
        passwordElement.value = "";
        messageElement.value = "";
        
        cssClass = "si_successMessage";
      }
      else
      {
        passwordElement.value = "";
        cssClass = "si_errorMessage";
      }
      
      document.getElementById("si_postClubMessageResult").innerHTML = "<span class=\"" + cssClass + "\">" + message + "</span>";
      
      refreshClubNotices (clubIdElement.value);
    }
    else
    {
      alert ('Failed to get a response from the server: ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

refreshClubNotices = function (pClubId)
{
  var url;
  
  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/irish-fishing-clubs/refreshClubNoticeBoard.jsp?clubId=" + escape(pClubId);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayClubNotices;
  xmlHttpRequest.send(null);
}

displayClubNotices = function ()
{
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      document.getElementById("si_clubNoticeBoardMessageList").innerHTML = xmlHttpRequest.responseText;
    }
    else
    {
      alert ('Failed to get a response from the server (LIST): ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

submitBlogEntry = function ()
{
  var blogHeadingElement = document.getElementById("blogHeading");
  var blogTextElement = document.getElementById("blogText");
  var blogImageElement = document.getElementById("blogImage");
  var url;
  
  if (blogHeadingElement.value == "")
  {
    alert ("Enter the heading");
    blogHeadingElement.focus();
    return false;
  }

  if (blogTextElement.value == "")
  {
    alert ("Enter the text");
    blogTextElement.focus();
    return false;
  }

  createServerRequest();
  
  if (!xmlHttpRequest)
  {
    alert ('Failed to create the server request. Please contact the system administrator');
    return;
  }
  
  url = "/fishing-blog/submitBlogPost.jsp?blogHeading=" + escape(blogHeadingElement.value) + "&blogText=" + escape(blogTextElement.value) + 
                                   "&blogImage=" + escape(blogImageElement.value);
  
  xmlHttpRequest.open("POST", url, true);
  xmlHttpRequest.onreadystatechange = displayBlogPostResult;
  xmlHttpRequest.send(null);
  
  blogHeadingElement.value = "";
  blogTextElement.value = "";
  blogImageElement.value = "";
}

displayBlogPostResult = function ()
{
  if (xmlHttpRequest.readyState == 4)
  {
    if (xmlHttpRequest.status == 200)
    {
      document.getElementById("si_blogPostResult").innerHTML = xmlHttpRequest.responseText;
    }
    else
    {
      alert ('Failed to get a response from the server: ' + xmlHttpRequest.status + '. Please contact the system administrator.');
    }
  }
}

clean = function (message)
{
  message = message.replace(/[\r]+/g, "");
  message = message.replace(/[\n]+/g, "");
  
  return message;
}
