
/// -----------------------------------------------------------------------------
/// <procedure>externallinks</procedure>
/// <summary>
/// 	Opens external links in a new window and changes the class. In this case
///		it will add a background image, add padding to the left and change the 
///		background-color on hover whilst conforming xhtml strict standards.
///		External links are determined by the href attribute starting with http://
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// 	[Gavin Bruce] 16/08/2007 Created
/// </history>
/// -----------------------------------------------------------------------------
function externallinks() {
    var c = document.getElementById('container');
    if(c) {
        var ls = c.getElementsByTagName('a');
        for(var i=0; i<ls.length; i++) {
			href = ls[i].getAttribute('href',2);
            if(href.toLowerCase().substring(0, 7) == 'http://') {
				imgs = ls[i].getElementsByTagName('img');
				if (imgs.length == 0) {
					ls[i].className = 'extlink';
				}
                ls[i].onclick=function() {					
					window.open(this.href);
					return false;
				}
            }
        }
    }
}

window.onload=function(){
    if(!document.getElementById && !document.createTextNode){return;}
    externallinks();
    
}

