	// Open links in nieuw venster script
	// Wietse Sluimer en Henri Kaper, Seneca B.V.

// pad en bestandsnaam van icon.
var nwicon = '/Javascripts/jquery-newwindow-icon.gif';

var $nw=jQuery.noConflict();

function newwindow(){

	$nw("a").removeAttr("target");

	// titles aan links zelf geven
	$nw("a[href^=http]").attr("title","Pagina opent in huidig venster");
	$nw("a[href$=.pdf]").attr("title","PDF bestand opent in huidig venster");
	$nw("a[href$=.jpg]").attr("title","Afbeelding opent in huidig venster");
	$nw("a[href$=.gif]").attr("title","Afbeelding opent in huidig venster");
	$nw("a[href$=.png]").attr("title","Afbeelding opent in huidig venster");
	$nw("a.externelink").attr("title","Pagina opent in huidig venster");
	$nw("a.pdf").attr("title","PDF bestand opent in huidig venster");
	$nw("a.afbeelding").attr("title","Afbeelding opent in huidig venster");

	// icon met class achter links plaatsen
	$nw("a[href^=http]").append($nw(' <img src="' + nwicon + '" class="nwhttp" alt="" width="15" height="12" /> '));
	$nw("a[href$=.pdf]").append($nw(' <img src="' + nwicon + '" class="nwpdf" alt="" width="15" height="12" /> '));
	$nw("a[href$=.jpg]").append($nw(' <img src="' + nwicon + '" class="nwimg" alt="" width="15" height="12" /> '));
	$nw("a[href$=.gif]").append($nw(' <img src="' + nwicon + '" class="nwimg" alt="" width="15" height="12" /> '));
	$nw("a[href$=.png]").append($nw(' <img src="' + nwicon + '" class="nwimg" alt="" width="15" height="12" /> '));
	$nw("a.externelink").append($nw(' <img src="' + nwicon + '" class="nwhttp" alt="" width="15" height="12" /> '));
	$nw("a.pdf").append($nw(' <img src="' + nwicon + '" class="nwpdf" alt="" width="15" height="12" /> '));
	$nw("a.afbeelding").append($nw(' <img src="' + nwicon + '" class="nwimg" alt="" width="15" height="12" /> '));

	// icons met class title geven
	$nw("img.nwhttp").attr("title","Open pagina in nieuw venster");
	$nw("img.nwpdf").attr("title","Open PDF bestand in nieuw venster");
	$nw("img.nwimg").attr("title","Open afbeelding in nieuw venster");

	// indien op icon geklikt window.open aan image geven met link van parent a
	$nw("img.nwhttp").click(function(){
		window.open($nw(this).parent("a").attr("href"));
		return false;
	});
	$nw("img.nwpdf").click(function(){
		window.open($nw(this).parent("a").attr("href"));
		return false;
	});
	$nw("img.nwimg").click(function(){
		window.open($nw(this).parent("a").attr("href"));
		return false;
	});

	// button-links met class button in nieuw venster openen en title geven
	$nw("a.button").click(function(){
		window.open(this.href);
		return false;
	});
	$nw("a.button").attr("title","Open pagina in nieuw venster");

	// Uitzonderingen en fixes
	$nw("a#mijnloket").attr("target","_blank");
	$nw("a#mijnloket").attr("title","Open pagina in nieuw venster");
	$nw("a#mijnloket img").remove();
	$nw(".geennieuwvenster").removeAttr("title");
	$nw(".geennieuwvenster img.nwhttp").remove();
	$nw(".geennieuwvenster img.nwpdf").remove();
	$nw(".geennieuwvenster img.nwimg").remove();
	$nw(".button img.nwhttp").remove();
	$nw(".button img.nwpdf").remove();
	$nw(".button img.nwimg").remove();

	$nw("a[href$=.pdf] img.nwhttp").remove();
	$nw("a[href$=.jpg] img.nwhttp").remove();
	$nw("a[href$=.gif] img.nwhttp").remove();
	$nw("a[href$=.png] img.nwhttp").remove();
	$nw("a.pdf img.nwhttp").remove();
	$nw("a.afbeelding img.nwhttp").remove();
	
}

// Na het laden van de pagina, de volgende code uitvoeren
$nw(document).ready(function() {
							 
	newwindow();

	});
