// b3rtLinkChecker 1.2
// Copyright 2010, H. poort
// This software may not be used without a valid license

function b3rtLinkChecker(d,e){this.reLinkCheck=d;this.callbackFunction=function(a,b,c){};if((typeof e)=='function')this.callbackFunction=e;this.nodeList=[];this.initialize()};b3rtLinkChecker.prototype.initialize=function(a){if((typeof document.getElementsByTagName)=='undefined')return;if(!document.body){var b=this;window.setTimeout(function(){if(b){b.initialize(true);b=null}},25);return}if((typeof document.body.getAttribute)=='undefined')return;this.gatherNodes();this.checkLinks();this.cleanup()};b3rtLinkChecker.prototype.gatherNodes=function(){var a=document.getElementsByTagName('a');if(a&&(a.length>0)){for(var i=0;i<a.length;i++)this.nodeList[this.nodeList.length]=a[i]}var b=document.getElementsByTagName('img');if(b&&(b.length>0)){for(var i=0;i<b.length;i++)this.nodeList[this.nodeList.length]=b[i]}};b3rtLinkChecker.prototype.checkLinks=function(){for(var i=0;i<this.nodeList.length;i++){var a=this.nodeList[i];var b=a.nodeName.toLowerCase();var c='';if((b=='a')&&((typeof a.getAttribute('href'))=='string'))c=a.getAttribute('href');if((b=='img')&&((typeof a.getAttribute('src'))=='string'))c=a.getAttribute('src');if(c!=''){var d=new RegExp(this.reLinkCheck);if(d.test(c))this.callbackFunction(a,c,b)}}};b3rtLinkChecker.prototype.cleanup=function(){for(var i=0;i<this.nodeList.length;i++){this.nodeList[i]=null}this.nodeList=null};
