
// Bookmark English


function setBookmark(url,str){
if(str=='')str=url;
if (document.all)window.external.AddFavorite(url,str);
else alert('Please press CTRL and D to add a bookmark to:\n"'+url+'".');
} 



// Bookmark  Welsh


function setBookmarkW(url,str){
if(str=='')str=url;
if (document.all)window.external.AddFavorite(url,str);
else alert('Pwyswch CTRL a D i ychwanegu nod tudalen i:\n"'+url+'".');
} 



// Language Swap to Welsh



    function switchURL(){

    var endPart = "";
    var url = location.href;
    if (url.indexOf('#') > -1){
    endPart = url.substr(url.indexOf('#'),url.length);
    url = url.substr(0,url.indexOf('#'));

    }


    if (url.substr(url.length-1,1) == '/'){
            location.href = url + 'index-w.shtml' + endPart;
            return 0;
    }

    if (url.substr(url.length-13,13) == 'index-w.shtml'){

            location.href = url.replace('index-w.shtml','') + endPart ;
            return 0;
    }


    if (url.indexOf('-w.') == -1){
            location.href = url.replace('.shtml','-w.shtml') + endPart;
            return 0;
    }else{
            location.href = url.replace('-w.shtml','.shtml') + endPart;
            return 0;

    }

    }




// Language Swap to English


function switchURLW(){

var url = location.href;

if (url.indexOf('-w.') == -1){
	url = url.replace('.shtml','-w.shtml');
}else{
	url = url.replace('-w.shtml','.shtml');

}
location.href = url;
}






/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=1

//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=5000

function initializeScroller(){
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.top="5px"
setTimeout("getdataheight()", initialdelay)
}

function getdataheight(){
thelength=dataobj.offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
scrollDiv()
}

function scrollDiv(){
dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top="5px"
setTimeout("scrollDiv()",40)
}

if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller

