//mapdis.js
function ffenest_newydd(URL_newydd,enw_newydd,rhestr_newydd,prif_ffenest)
{
var ffenest2 = open (URL_newydd,enw_newydd,rhestr_newydd);
if (ffenest2.opener == null)
   ffenest2.opener = window;
ffenest2.opener.name = prif_ffenest;
return ffenest2;
}

function agor_ffenest()
{
ffenest_extra = ffenest_newydd("","ffenest_extra","toolbar=0,scrollbars=1,height=400,width=600","prif")
}

function dangos(enw_map,mapx,mapy)
{
if (document.location.href.search(/mesh/i)) {
	mainpath = "mesh/ll/";
}
else 	mainpath = "www.llangynfelyn.dabsol.co.uk/";

x_URL = enw_map + ".gif" 
mapx1 = mapx - 8;
mapy1 = mapy - 8;
agor_ffenest();
ffenest_extra.document.open();
ffenest_extra.document.write(
"<IMG SRC='http://"+mainpath+"dogfennau/mapiau/" + x_URL + "' BORDER='0' ALT='Map'>"
)
NS4 =  (document.layers) ? 1 : 0
IE4 =  (document.all) ? 1 : 0
zindex = " "
if (NS4)
{mapx1 = mapx1 + "px";
mapy1 = mapy1 + "px";
  zindex = "; z-index:1; visibility:show";
ffenest_extra.document.write(
"<DIV ID='circ' STYLE='position : absolute; left : " + mapx1 + "; top : " + mapy1 + zindex + "'>"
)
ffenest_extra.document.write(
"<IMG SRC='http://"+mainpath+"dogfennau/mapiau/red_circ_40.gif'></DIV>"
)
}
if (IE4)
{
ffenest_extra.document.write(
"<IMG SRC='http://"+mainpath+"dogfennau/mapiau/red_circ_40.gif' STYLE='position : absolute; left : " + mapx1 + "; top : " + mapy1 + zindex + "'>"
)
}

ffenest_extra.document.close();
scrollx = mapx - 300; scrolly = mapy - 200;
if (NS4){ ffenest_extra.scroll(scrollx,scrolly);
ffenest_extra.focus()}
if (IE4) {ffenest_extra.window.scrollTo(scrollx,scrolly);ffenest_extra.window.focus()}
}

