//==========================================
// tynnu.js
// -----------------------------------------
// functions ar gyfer:
//.........dewislen tynnu-i-lawr
//.........ysgrifennu traed y tudalen
//.........ysgrifennu 2-colofn
//.........ysgrifennu bar dewislen
//.........rhoi gwreidd y safle
//==========================================

browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion);

if (browser_name == "Netscape" && browser_version >= 3.0) {roll = 'true';}
else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 3.0) {roll = 'true';}
else {roll = 'false';}
function msover(img) {if (roll == 'true') {document.images[img].src = 'bot_'+img+'_2.gif';} }
function msout(img) {if (roll == 'true') {document.images[img].src = 'bot_'+img+'_1.gif';} }

// tynnu.js 
function dewislencym(ffurflen){
var URL = document.ffurflen.tudalencym.options[document.ffurflen.tudalencym.selectedIndex].value;
window.location.href = URL;
}
function dewisleneng(ffurflen){
var URL = document.ffurflen.tudaleneng.options[document.ffurflen.tudaleneng.selectedIndex].value;
window.location.href = URL;
}
function dewislencymh(){
var URL = document.ffurflenc.tudalencym.options[document.ffurflenc.tudalencym.selectedIndex].value;
window.location.href = URL;
}
function dewislenengh(){
var URL = document.ffurflene.tudaleneng.options[document.ffurflene.tudaleneng.selectedIndex].value;
window.location.href = URL;
}

function ysg_tynnu_cym(lev){
var enw_ffurflen = "ffurflen";
var enw_dewis = "dewislencym";
if (lev == "root") {
var pfx = "";
}
else if (lev == "hafan") {
var pfx = "";
var enw_ffurflen = "ffurflenc";
var enw_dewis = "dewislencymh";
document.write('<form name="ffurflenc" class="tynnu">');
}
else if (lev == "1") {
var pfx = "../";
}
else if (lev == "2") {
var pfx = "../../";
}
else if (lev == "f2s") {
var pfx = "http://www.llangynfelyn.org/";
}
document.write('<select class="tynnucym" name="tudalencym" onChange="javascript:if (document.' + enw_ffurflen + '.tudalencym.selectedIndex != 0)' + enw_dewis + '()">');
document.write('<option selected value="">Llywio\'r safle: ewch i....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
document.write('<option value="' + pfx + 'chwilio.html">Chwilio&#39;r safle');
document.write('<option value="' + pfx + 'hafan.html">Tudalen Hafan');
document.write('<option value="' + pfx + 'map_y_safle.html">Map y safle');
document.write('<option value="' + pfx + 'hanes.html">Hanes a chofnodion');
document.write('<option value="' + pfx + 'dogfennau/chronology.html">--Mynegai yn nhrefn amser');
document.write('<option value="' + pfx + 'dogfennau/ysgol_mynegiad.html">--Addysg');
document.write('<option value="' + pfx + 'dogfennau/bedd_taliesin_mynegiad.html">--Bedd Taliesin');
document.write('<option value="' + pfx + 'dogfennau/mynwentydd_mynegiad.html">--Cerrig coffa');
document.write('<option value="' + pfx + 'dogfennau/cludiant_mynegiad.html">--Cludiant');
document.write('<option value="' + pfx + 'dogfennau/capeli_mynegiad.html">--Cofnodion y capeli');
document.write('<option value="' + pfx + 'dogfennau/etholwyr_mynegiad.html">--Cofrestrau etholwyr');
document.write('<option value="' + pfx + 'dogfennau/cofrestrau_mynegiad.html">--Cofrestrau&#39;r plwyf');
document.write('<option value="' + pfx + 'dogfennau/cyngor_mynegiad.html">--Cofnodion y Cynghorau');
document.write('<option value="' + pfx + 'dogfennau/degwm_mynegiad.html">--Cofnodion y Degwm');
document.write('<option value="' + pfx + 'dogfennau/crwydriaid_mynegiad.html">--Crwydriaid');
document.write('<option value="' + pfx + 'dogfennau/cyfrifiad_mynegiad.html">--Cyfrifiadau');
document.write('<option value="' + pfx + 'dogfennau/deddf_y_tlodion_mynegiad.html">--Deddf y Tlodion');
document.write('<option value="' + pfx + 'dogfennau/disgrifiadau_mynegiad.html">--Disgrifiadau a chyfeirlyfrau');
document.write('<option value="' + pfx + 'dogfennau/amrywiol_mynegiad.html">--Dogfennau amrywiol');
document.write('<option value="' + pfx + 'dogfennau/trethi_ar_eiddo_mynegiad.html">--Eiddo - trethi a phrisiadau');
document.write('<option value="' + pfx + 'dogfennau/enwogion_mynegiad.html">--Enwogion y plwyf');
document.write('<option value="' + pfx + 'dogfennau/hynafiaethau_mynegiad.html">--Hynafiaethau');
document.write('<option value="' + pfx + 'dogfennau/ewyllysiau_mynegiad.html">--Ewyllysiau a rhestrenni');
document.write('<option value="' + pfx + 'dogfennau/mapiau_mynegiad.html">--Mapiau');
document.write('<option value="' + pfx + 'dogfennau/mwyngloddiaeth_mynegiad.html">--Mwyngloddiaeth');
document.write('<option value="' + pfx + 'dogfennau/cyfnodolion_mynegiad.html">--Papurau Newydd/Cylchgronau');
document.write('<option value="' + pfx + 'dogfennau/prydlesau_mynegiad.html">--Prydlesau a.y.y.b.');
document.write('<option value="' + pfx + 'dogfennau/trosedd_mynegiad.html">--Trosedd a chosb');
document.write('<option value="' + pfx + 'dogfennau/ymchwil_mynegiad.html">--Ymchwil - erthyglau');
document.write('<option value="' + pfx + 'cgi-bin/oriel.pl">Oriel lluniau');
document.write('<option value="' + pfx + 'cadwynau.html">Cadwynau i safleoedd eraill');
document.write('<option value="' + pfx + 'ymwelwyr.html">Gwybodaeth i ymwelwyr');
document.write('<option value="' + pfx + 'nodiadau_technegol.html">Nodiadau technegol');
document.write('<option value="' + pfx + 'awduron.html">Cysylltwch &acirc;&#39;r awduron');
document.write('<option value="' + pfx + 'llyfr_ymwelwyr.php">Llyfr ymwelwyr');
document.write('<option value="' + pfx + 'newidiadau.html">Hanes newidiadau i\'r safle');
document.write('</select>');
if (lev == "hafan") {
document.write('</form>');
}
}
function ysg_tynnu_eng(lev){
var enw_ffurflen = "ffurflen";
var enw_dewis = "dewisleneng";
if (lev == "root") {
var pfx = "";
}
else if (lev == "hafan") {
var pfx = "";
var enw_ffurflen = "ffurflene";
var enw_dewis = "dewislenengh";
document.write('<form name="ffurflene" class="tynnu">');
}
else if (lev == "1") {
var pfx = "../";
}
else if (lev == "2") {
var pfx = "../../";
}
else if (lev == "f2s") {
var pfx = "http://www.llangynfelyn.org/";
}
document.write('<select class="tynnueng" name="tudaleneng" onChange="javascript:if (document.' + enw_ffurflen + '.tudaleneng.selectedIndex != 0) ' + enw_dewis + '()">');
document.write('<option value="">Site navigation: go to....');
document.write('<option value="' + pfx + 'chwilio.html">Search the site');
document.write('<option value="' + pfx + 'hafan.html">Home page');
document.write('<option value="' + pfx + 'map_y_safle.html">Site map');
document.write('<option value="' + pfx + 'hanes.html">History and records');
document.write('<option value="' + pfx + 'dogfennau/chronology.html">--Chronological index');
document.write('<option value="' + pfx + 'dogfennau/hynafiaethau_mynegiad.html">--Antiquities');
document.write('<option value="' + pfx + 'dogfennau/cyfrifiad_mynegiad.html">--Census returns');
document.write('<option value="' + pfx + 'dogfennau/capeli_mynegiad.html">--Chapel records');
document.write('<option value="' + pfx + 'dogfennau/cyngor_mynegiad.html">--Council minutes');
document.write('<option value="' + pfx + 'dogfennau/trosedd_mynegiad.html">--Crime and punishment');
document.write('<option value="' + pfx + 'dogfennau/disgrifiadau_mynegiad.html">--Descriptions and directories');
document.write('<option value="' + pfx + 'dogfennau/ysgol_mynegiad.html">--Education');
document.write('<option value="' + pfx + 'dogfennau/etholwyr_mynegiad.html">--Electoral lists');
document.write('<option value="' + pfx + 'dogfennau/prydlesau_mynegiad.html">--Leases and deeds');
document.write('<option value="' + pfx + 'dogfennau/mapiau_mynegiad.html">--Maps');
document.write('<option value="' + pfx + 'dogfennau/mynwentydd_mynegiad.html">--Memorial stones');
document.write('<option value="' + pfx + 'dogfennau/mwyngloddiaeth_mynegiad.html">--Mining');
document.write('<option value="' + pfx + 'dogfennau/amrywiol_mynegiad.html">--Miscellaneous documents');
document.write('<option value="' + pfx + 'dogfennau/cyfnodolion_mynegiad.html">--Newspapers and Periodicals');
document.write('<option value="' + pfx + 'dogfennau/enwogion_mynegiad.html">--Parish notables');
document.write('<option value="' + pfx + 'dogfennau/cofrestrau_mynegiad.html">--Parish registers');
document.write('<option value="' + pfx + 'dogfennau/deddf_y_tlodion_mynegiad.html">--Poor Law');
document.write('<option value="' + pfx + 'dogfennau/trethi_ar_eiddo_mynegiad.html">--Property taxes and valuations&nbsp;');
document.write('<option value="' + pfx + 'dogfennau/ymchwil_mynegiad.html">--Research papers');
document.write('<option value="' + pfx + 'dogfennau/crwydriaid_mynegiad.html">--Strays');
document.write('<option value="' + pfx + 'dogfennau/bedd_taliesin_mynegiad.html">--Taliesin&#39;s grave');
document.write('<option value="' + pfx + 'dogfennau/degwm_mynegiad.html">--Tithe records');
document.write('<option value="' + pfx + 'dogfennau/cludiant_mynegiad.html">--Transport');
document.write('<option value="' + pfx + 'dogfennau/ewyllysiau_mynegiad.html">--Wills and inventories');
document.write('<option value="' + pfx + 'cgi-bin/oriel.pl">Picture gallery');
document.write('<option value="' + pfx + 'cadwynau.html">Links to other sites');
document.write('<option value="' + pfx + 'ymwelwyr.html">Information for visitors');
document.write('<option value="' + pfx + 'nodiadau_technegol.html">Technical notes');
document.write('<option value="' + pfx + 'awduron.html">Contact the authors');
document.write('<option value="' + pfx + 'llyfr_ymwelwyr.php">Guestbook');
document.write('<option value="' + pfx + 'newidiadau.html">Site change history');
document.write('</select>');
if (lev == "hafan") {
document.write('</form>');
}
}

function ysg_tynnu(lev){
document.write('<form name="ffurflen" class="tynnu">');
ysg_tynnu_cym(lev);
document.write('<br>');
ysg_tynnu_eng(lev);
document.write('</form>');
}

// traed.js 

function traed(lev){

var llyfr_url = get_pref() + "llyfr_ymwelwyr.php";
var hawlfraint_url = get_pref() + "hawlfraint.html";

document.writeln("<hr width='95%' size='1' color='#B8850B' noshade><div align='center'><A href='#Brig' class='lastupdated'>[Brig y dudalen/Top of page]</A><A href='"+hawlfraint_url+"' class='lastupdated'>[Hawlfraint/Copyright]</A><table border='1' bordercolor='#ffcc00' CELLSPACING='2' CELLPADDING='2' align='center' class='navtab'><tr><td class='bar2'><span class='cym'>Cwestiynau? Sylwadau? Beth ydych chi'n meddwl am y tudalen hwn a gweddill y wefan? Dywedwch yn y <A href='" + llyfr_url + "'title='Beth ydych chi'n meddwl am y safle?'>llyfr ymwelwyr.</A></span><br><span class='eng'>Questions? Comments? What do you think about this page and the rest of the site? Tell us in the <A href='" + llyfr_url + "' title='What do you think of the site?' >guest book.</A></span></td></tr></table>");
document.writeln("<IMG SRC='http://www.llangynfelyn.org/cgi-bin/ax.pl?trans.gif' width=2 height=1>");
//document.write("<span class='lastupdated'><br>Diweddarwyd y tudalen hon ar/This page last changed on: <i>");

//moddyddiad  = new Date( document.lastModified);
//document.write (moddyddiad.getDate()+ "-" + (moddyddiad.getMonth()+ 1) + "-" + moddyddiad.getYear()+ " " + moddyddiad.getHours()+ ":" + moddyddiad.getMinutes());
document.write("</div>");

}

// ysgrifennu 2 colofn
function ysg_2(math,cym,saes) {
var mo = "<span>";
var me = "</span>";
if (math == "h1" || math == "h2" || math == "h3" || math == "h4" || math == "h5" || math == "h6") { mo = "<" + math + ">"; me = "</" + math + ">"; }
document.write("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH='100%' ALIGN='center'><TR><TD class='cym' WIDTH='48%' VALIGN='top'>" + mo + cym + me +"</TD><td width='4%'>&nbsp;</td><TD class='eng' WIDTH='48%' VALIGN='top'>" + mo + saes + me + "</TD></TR></TABLE>");

}

// get_pref

function get_pref() {
if (location.href.substr(0,27) == "http://www.llangynfelyn.org") return "/";
else if (location.href.substr(0,36) == "http://www.taliesin-arlein.net/llf2s") return "/";
else return "/ll/";
}

// bar_brig.js 

function bar_brig(lev,adran){
pref=get_pref();
if (lev == "f2s") pref = "http://www.llangynfelyn.org/";
document.writeln('<table class="barbrig" width="100%" height="90" border="0" cellspacing="0" cellpadding="0" background="'+pref+'header_bg3.jpg"><tr><td><img src="'+pref+'plwyftext.gif" width="319" height="41" border="0" alt=""><br><table border="0" cellspacing="0" cellpadding="1" align="left"><tr>');

bar_entry("hafan");
bar_entry("chwilio");

for (i=0; i<adran.length; i++) {
	if (adran[i] != "dim") {
		bar_entry(adran[i]);
	}
}
document.writeln('</tr></table></td><td align="right"><br>');
ysg_tynnu(lev);
document.writeln('</td></tr></table>');
}

function bar_entry(adran) {

pref=get_pref();
var ar = [
["hafan","hafan.html","Tudalen Hafan","Hafan","Home page","Home","",""],
["chwilio","chwilio.html","Chwilio'r safle","Chwilio","Search the site","Search","",""],
["addysg","dogfennau/ysgol_mynegiad.html","Adran addysg","Addysg","Education section","Education","Addysg","Education"],
["amrywiol","dogfennau/amrywiol_mynegiad.html","Adran amrywiol","Dogfennau Amrywiol","Miscellaneous section","Miscellaneous documents","Dogfennau Amrywiol","Miscellaneous documents"],
["bedd","dogfennau/bedd_taliesin_mynegiad.html","Bedd Taliesin","Bedd Taliesin","Taliesin's Grave","Taliesin's Grave","Bedd Taliesin","Taliesin's Grave"],
["capeli","dogfennau/capeli_mynegiad.html","Adran Cofnodion y Capeli","Cofnodion y Capeli","Chapel records section","Chapel Records","Cofnodion y Capeli","Chapel Records"],
["cludiant","dogfennau/cludiant_mynegiad.html","Adran Cludiant","Mynegai i Gludiant","Transport section","Transport Index","Cludiant","Transport"],
["cofrestrau","dogfennau/cofrestrau_mynegiad.html","Adran cofrestrau'r plwyf","Mynegai i'r gofrestrau","Parish registers section","Registers Index","Cofrestrau'r plwyf","Parish registers"],
["crwydriaid","dogfennau/crwydriaid_mynegiad.html","Adran Crwydriaid","Mynegai i Crwydriaid","Strays section","Index to Strays","Crwydriaid","Strays"],
["cyfnodolion","dogfennau/cyfnodolion_mynegiad.html","Adran cyfnodolion","Cyfnodolion","Periodicals section","Periodicals","Cyfnodolion","Periodicals"],
["cyfrifiadau","dogfennau/cyfrifiad_mynegiad.html","Adran y cyfrifiadau","Mynegai i'r cyfrifiadau","Census section","Censuses Index","Cyfrifiadau","Censuses"],
["cyngor","dogfennau/cyngor_mynegiad.html","Adran cofnodion y Cynghorau","Cofnodion Cyngor","Council Minutes section","Council Minutes","Cofnodion y Cynghorau","Council Minutes"],
["degwm","dogfennau/degwm_mynegiad.html","Adran cofnodion y Degwm","Degwm Mynegai","Tithe records section","Tithe Records","Cofnodion y Degwm","Tithe records"],
["degwmmap","dogfennau/mapiau_degwm.html","Adran mapiau'r Degwm","Mapiau'r Degwm","Tithe maps section","Tithe maps","Mapiau'r Degwm","Tithe Maps"],
["disgrifiadau","dogfennau/disgrifiadau_mynegiad.html","Adran disgrifiadau a chyfeirlyfrau","Disgrifiadau a chyfeirlyfrau","Descriptions and Directories section","Descriptions and directories","Disgrifiadau a chyfeirlyfrau","Descriptions and Directories"],
["eiddo","dogfennau/trethi_ar_eiddo_mynegiad.html","Adran prisiadau a threthi tir ac eiddo","Prisiadau a threthi tir","Land and property taxes and valuations section","Property taxes and valuations","Prisiadau a threthi tir","Property taxes and valuations"],
["enwogion","dogfennau/enwogion_mynegiad.html","Adran Enwogion y Plwyf","Enwogion y Plwyf","Parish Notables section","Parish Notables","Enwogion y Plwyf","Parish Notables"],
["etholwyr","dogfennau/etholwyr_mynegiad.html","Adran rhestrau etholwyr","Rhestrau Etholwyr","Electoral Rolls section","Electoral Rolls","Rhestrau Etholwyr","Electoral Rolls"],
["ewyllysiau","dogfennau/ewyllysiau_mynegiad.html","Adran Ewyllysiau","Ewyllysiau Mynegai","Wills section","Wills Index","Ewyllysiau","Wills"],
["hynafiaethau","dogfennau/hynafiaethau_mynegiad.html","Adran hynafiaethau","Hynafiaethau","Antiquities section","Antiquities","Hynafiaethau","Antiquities"],
["hanes","hanes.html","Hanes a dogfennau","Hanes a dogfennau","History and records", "History &amp; records","",""],
["mapiau","dogfennau/mapiau_mynegiad.html","Adran mapiau","Mapiau","Maps section","Maps","Mapiau","Maps"],
["mwyngloddiaeth","dogfennau/mwyngloddiaeth_mynegiad.html","Adran mwyngloddiaeth","Mwyngloddiaeth","Mining section","Mining","Mwyngloddiaeth","Mining"],
["mynwentydd","dogfennau/mynwentydd_mynegiad.html","Adran y Mynwentydd","Mynwentydd Mynegai","Cemeteries section","Cemeteries index","Mynwentydd","Cemeteries"],
["oriel","cgi-bin/oriel.pl?swydd=prif","Prif fynegiad yr Oriel","Mynegai i luniau","Main index to the Gallery","Pictures index","Oriel","Picture Gallery"],
["prydlesau","dogfennau/prydlesau_mynegiad.html","Adran prydlesau a gweithredoedd","Prydlesau a gweithredoedd ayyb","Leases and deeds section","Leases and deeds etc.","Prydlesau a gweithredoedd ayyb","Leases and deeds, etc."],
["tlodion","dogfennau/deddf_y_tlodion_mynegiad.html","Adran Deddf y Tlodion","Cofnodion Deddf y Tlodion","Poor Law records section","Poor Law records","Deddf y Tlodion","Poor Law"],
["trosedd","dogfennau/trosedd_mynegiad.html","Adran trosedd a chosb","Trosedd a chosb","Crime and punishment section","Crime and punishment","Trosedd a chosb","Crime and punishment"],
["ymchwil","dogfennau/ymchwil_mynegiad.html","Adran erthyglau ymchwil","Erthyglau ymchwil","Research papers section","Research papers","Papurau ymchwil","Research papers"]
];
 
for (j=0; j<ar.length; j++) {
if (ar[j][0] == adran ) {
//if (adran == "oriel" ) pref = "";
if (adran != "hafan") {document.writeln('<td class="bar">&nbsp;|&nbsp;<br>&nbsp;|&nbsp;</td>');}
else {document.writeln('<td class="bar">&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;</td>');}
document.writeln('<td class="bar"><A HREF="'+pref+ar[j][1]+'" title="'+ar[j][2]+'" class="cyml">'+ar[j][3]+'</a><br><A HREF="'+pref+ar[j][1]+'" title="'+ar[j][4]+'" class="engl" >'+ar[j][5]+'</a></td>');
break;
}
}
}

function contact_us(lang) {
if (lang == 'ad') {
document.write(String.fromCharCode(60,97,32,104,114,101,102,61,39,109,97,105,108,116,111,58,112,108,119,121,102,50,64,116,97,108,105,101,115,105,110,46,99,111,46,117,107,39,62,112,108,119,121,102,50,64,116,97,108,105,101,115,105,110,46,99,111,46,117,107,60,47,97,62,32)); }
 else if (lang == 'cy') {
document.write(String.fromCharCode(60,97,32,104,114,101,102,61,39,109,97,105,108,116,111,58,112,108,119,121,102,50,64,116,97,108,105,101,115,105,110,46,99,111,46,117,107,39,62,99,121,115,121,108,108,116,119,99,104,32,38,97,99,105,114,99,59,32,110,105,60,47,97,62,32)); } 
else { document.write(String.fromCharCode(60,97,32,104,114,101,102,61,39,109,97,105,108,116,111,58,112,108,119,121,102,50,64,116,97,108,105,101,115,105,110,46,99,111,46,117,107,39,62,99,111,110,116,97,99,116,32,117,115,60,47,97,62,32));
}
 }

