function findAnchors()	{
	var anchors=document.getElementsByTagName('a');
	for (var i=0;
	i<anchors.length;
	i++)   {
		if(anchors[i].rel=='pop')        {
			anchors[i].onclick = function()	{
				link_popup(this);
				return false;
			}
		}
	}
	
	
	// Window opener that augments a standard link with popup code when function is called
	var _POPUP_FEATURES = 'toolbar=no,width=1024,height=680,left=10,top=20,status=no,scrollbars=yes,resizable=yes';

	function isUndefined(v) {
	    var undef;
	    return v===undef;
	}

	function raw_popup(url, target, features) {
	    // pops up a window containing url optionally named target, optionally having features
	    if (isUndefined(features)) features = _POPUP_FEATURES;
	    if (isUndefined(target)) target   = '_blank';
	    var theWindow = window.open(url, target, features);
	    theWindow.focus();

	    return theWindow;
		
	}

	function link_popup(src, features) {
	    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
	    // pops up a window grabbing the url from the event source's href
	    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features) ;
	}
}


//Table row highlight on mouseover for table with class of 'ruler'
//Finds all tables and adds the behaviour to table rows within a tbody tag - not to table headers or footers
//Adjust the table highlight appearance by amending the relevant CSS values

function tableruler()   {
	if (document.getElementById && document.createTextNode) {
		var tables=document.getElementsByTagName('table');
		for (var i=0; i<tables.length; i++)   {
			if(tables[i].className=='ruler')        {
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0; j<trs.length; j++)    {
					if(trs[j].parentNode.nodeName=='TBODY' && trs[j].parentNode.nodeName!='TFOOT')  {
						if(trs[j].className=='')        {
							trs[j].onmouseover=function()   {
								this.className='ruled';
								return false;
							}
							trs[j].onmouseout=function()    {
								this.className='';
								return false;
							}
						}
					}
				}
			}
		}
	}
}


