var visiblelist = "";
var mouseovermenu = "No";
var timerid = 0;

function mapbox(fullcat, leftoffset, topoffset)
{
  cnt=1;
  do
  {
    thiscat = items(fullcat,cnt,":");
    if (thiscat == "") break;
    name = thiscat;
    cnt++;
  } while (1==1);

  document.write('      <table cellpadding="0" cellspacing="0" border="0" class="catsidebox" id="'+fullcat+'" style="margin-left : '+leftoffset+'px; margin-top : '+topoffset+'px;" onMouseOver="mouseovermenu = \'Yes\'" onMouseOut="mouseovermenu = \'No\'">\n');
  document.write('<tr><td class="menucell l-two" style="padding : 3px;"> Jobs </td></tr>\n');
  document.write('      <tr><td><img src="images/ukmap.jpg" border="0" usemap="#ukmap">');
  document.write('      </table>');
  document.write('      <map name="ukmap">');
  document.write('      <area shape="poly" coords= "141, 31, 217, 26, 216, 41, 197, 67, 241, 71, 247, 79, 223, 139, 239, 154, 212, 192, 165, 205, 129, 155, 107, 91, 118, 43" href="jobs.php?area=Scotland">');
  document.write('      <area shape="poly" coords= "240, 153, 271, 210, 236, 214, 221, 181" href="jobs.php?area=North East England">');
  document.write('      <area shape="poly" coords= "273, 209, 295, 249, 276, 247, 259, 263, 250, 262, 226, 228, 235, 213" href="jobs.php?area=Yorkshire">');
  document.write('      <area shape="poly" coords= "222, 182, 235, 213, 226, 228, 241, 253, 241, 268, 221, 279, 207, 261, 211, 237, 195, 209" href="jobs.php?area=North West and Lake District">');
  document.write('      <area shape="poly" coords= "110, 182, 133, 173, 157, 210, 141, 230, 116, 215, 108, 225, 86, 211" href="jobs.php?area=Northern Ireland">');
  document.write('      <area shape="poly" coords= "134, 230, 145, 277, 135, 310, 41, 343, 19, 312, 55, 269, 32, 255, 36, 216, 71, 215, 71, 201, 81, 179, 108, 172, 117, 177, 87, 213, 109, 225, 115, 214" href="jobs.php?area=Republic of Ireland">');
  document.write('      <area shape="poly" coords= "286, 247, 310, 274, 327, 276, 341, 290, 337, 317, 315, 343, 294, 333, 299, 327, 281, 305, 283, 297, 272, 281, 268, 253" href="jobs.php?area=East of England">');
  document.write('      <area shape="poly" coords= "268, 253, 273, 281, 284, 301, 266, 320, 269, 344, 244, 343, 244, 337, 222, 336, 221, 328, 210, 322, 207, 302, 213, 289, 209, 284, 239, 268, 243, 253, 258, 263" href="jobs.php?area=Heart of England">');
  document.write('      <area shape="poly" coords= "206, 261, 217, 276, 210, 283, 213, 291, 206, 301, 210, 307, 210, 323, 224, 336, 206, 348, 197, 348, 176, 334, 156, 338, 148, 323, 182, 307, 183, 281, 165, 286, 177, 273, 170, 258" href="jobs.php?area=Wales">');
  document.write('      <area shape="poly" coords= "281, 307, 299, 328, 295, 336, 334, 347, 334, 358, 300, 377, 287, 373, 259, 384, 230, 360, 233, 339, 245, 337, 245, 343, 271, 343, 265, 330, 266, 319" href="jobs.php?area=Southern England and London">');
  document.write('      <area shape="poly" coords= "225, 335, 232, 340, 231, 361, 247, 378, 239, 385, 203, 383, 191, 402, 175, 393, 148, 410, 133, 404, 179, 355, 205, 355" href="jobs.php?area=South West and West Country">');
  document.write('      </map>  ');
}

function gifversion_mapbox(fullcat, leftoffset, topoffset)
{
  cnt=1;
  do
  {
    thiscat = items(fullcat,cnt,":");
    if (thiscat == "") break;
    name = thiscat;
    cnt++;
  } while (1==1);

  document.write('      <table cellpadding="3" cellspacing="2" border="0" class="catsidebox" id="'+fullcat+'" style="margin-left : '+leftoffset+'px; margin-top : '+topoffset+'px;" onMouseOver="mouseovermenu = \'Yes\'" onMouseOut="mouseovermenu = \'No\'">\n');
  document.write('      <tr><td><img src="images/ukmap.gif" border="0" usemap="#ukmap">');
  document.write('      </table>');
  document.write('      <map name="ukmap">');
  document.write('      <area shape="poly" coords= "79, 14, 104, 0, 159, 0, 158, 10, 144, 30, 185, 36, 166, 95, 180, 104, 157, 135, 118, 147, 65, 60" href="jobs.php?area=Scotland">');
  document.write('      <area shape="poly" coords= "179, 104, 206, 150, 175, 153, 164, 127" href="jobs.php?area=North East England">');
  document.write('      <area shape="poly" coords= "174, 154, 206, 151, 226, 183, 209, 182, 193, 197, 167, 165" href="jobs.php?area=Yorkshire">');
  document.write('      <area shape="poly" coords= "165, 128, 168, 166, 180, 187, 169, 209, 155, 198, 144, 150" href="jobs.php?area=North West and Lake District">');
  document.write('      <area shape="poly" coords= "71, 129, 94, 123, 110, 152, 96, 168, 75, 156, 71, 165, 50, 152" href="jobs.php?area=Northern Ireland">');
  document.write('      <area shape="poly" coords= "93, 167, 93, 234, 18, 265, 0, 236, 26, 199, 8, 187, 10, 157, 68, 118, 53, 153, 70, 164, 77, 155" href="jobs.php?area=Republic of Ireland">');
  document.write('      <area shape="poly" coords= "212, 181, 266, 220, 242, 262, 213, 232, 203, 189" href="jobs.php?area=East of England">');
  document.write('      <area shape="poly" coords= "203, 189, 216, 227, 204, 243, 204, 264, 164, 257, 153, 244, 153, 210, 178, 198, 180, 186, 196, 196" href="jobs.php?area=Heart of England">');
  document.write('      <area shape="poly" coords= "154, 196, 162, 209, 153, 210, 153, 245, 165, 258, 147, 267, 103, 253, 131, 232, 131, 211, 117, 213, 124, 191" href="jobs.php?area=Wales">');
  document.write('      <area shape="poly" coords= "213, 231, 239, 262, 258, 264, 253, 275, 196, 298, 171, 260, 202, 261, 201, 243" href="jobs.php?area=Southern England and London">');
  document.write('      <area shape="poly" coords= "166, 256, 186, 292, 103, 317, 87, 314, 129, 271, 150, 272" href="jobs.php?area=South West and West Country">');
  document.write('      </map>  ');
}

function boxhead(fullcat, leftoffset, topoffset)
{
  cnt=1;
  do
  {
    thiscat = items(fullcat,cnt,":");
    if (thiscat == "") break;
    name = thiscat;
    cnt++;
  } while (1==1);

  document.write('      <table cellpadding="3" cellspacing="2" border="0" class="catsidebox" id="'+fullcat+'" style="margin-left : '+leftoffset+'px; margin-top : '+topoffset+'px;" onMouseOver="mouseovermenu = \'Yes\'" onMouseOut="mouseovermenu = \'No\'">\n');
}

function boxfoot()
{
  document.write('        </table>\n');
}

function createlinks(list, prefix, phpfile, style)
{
  cnt = 1;
  do
  {
    listitem = items(list, cnt, "|");
    if (listitem == "") break;
    cat = prefix+":"+listitem;
    document.write('<tr><td class="menucell" '+style+'> <a href="'+phpfile+'?cat='+cat+'" class="l-two">'+listitem+'</a> </td></tr>\n');
    cnt++;
  } while (1==1);
}

function drawmenus()
{
  boxhead("visitors", 0, 30);
  document.write('<tr><td class="menucell"> <a href="gala_evenings.php" class="l-two">Gala Evenings</a> </td></tr>\n');
  document.write('<tr><td class="menucell"> <a href="food_and_drink.php" class="l-two">Food and Drink</a> </td></tr>\n');
  document.write('<tr><td class="menucell"> <a href="accomodation.php" class="l-two">Accomodation</a> </td></tr>\n');
  document.write('<tr><td class="menucell"> <a href="directions.php" class="l-two">Directions</a> </td></tr>\n');
  boxfoot();



}

function showmenu(which, x, y, parenttable)
{
  if (parenttable != "")
  {
    x = (x*1) + (items(document.getElementById(parenttable).style.marginLeft, 1 ,"px")*1);
    y = (y*1) + (items(document.getElementById(parenttable).style.marginTop, 1, "px")*1);
  }
  var subcat = items(which,2,":");
  if (subcat == "") hideallmenus();
  hideallmenus();
  document.getElementById(which).style.visibility = "visible";
  document.getElementById(which).style.marginLeft = x+"px";
  document.getElementById(which).style.marginTop = y+"px";

  visiblelist = visiblelist+which+"|";
  if (timerid != 0) clearTimeout(timerid);
  timerid = setTimeout("checkhide()", 5000);

}

function hideallmenus()
{
  // hide all the menus
  var cnt = 1;
  do
  {
    nextitem = items(visiblelist,cnt,"|");
    if (nextitem == "") break;
    document.getElementById(nextitem).style.visibility = "hidden";
    cnt++;
  } while (1 == 1)

  visiblelist = "";
}

function hidesubmenus()
{
  // hide all menus with a : in their ids
  cnt = 1;
  do
  {
    nextitem = items(visiblelist,cnt,"|");
    if (nextitem == "") break;
    if (nextitem.indexOf(":") > -1)
    {
      visiblelist.replace(nextitem+"|","");
      document.getElementById(nextitem).style.visibility = "hidden";
    } 
    cnt++;
  } while (1 == 1)

}

function checkhide()
{
return;
  if (mouseovermenu == "Yes")
  {
    timerid = setTimeout("checkhide()", 5000);
  } else
  {
    hideallmenus();
  }
}


function copyright()
{
  document.write('<p style="text-align : center; color : #888888;"><strong>&copy; 2009 Horse Seekers</strong> - Advertising for <a style="color : #888888;" href="results.php?cat=All Horses">Horses for Sale in the UK</a><br><a style="color : #888888;" href="index.html">Home</a> – <a style="color : #888888;" href="news.php">Equestrian News</a> - <a style="color : #888888;" href="eqdiary.php">Equestrian Diary</a> – <a style="color : #888888;" href="shop.php?which=Horse:Supplements">Horse Supplements</a> <br> <a style="color : #888888;" href="results.php?cat=Horseboxes">HorseBoxes</a> and <a style="color : #888888;" href="results.php?cat=Trailers">Trailers</a> for Sale – <a style="color : #888888;" href="advertise.html?type=Business">Advertise Your Equestrian Business</a></p>');
}


