$(document).ready(function(){
	$i = 1;
	$("a[target='thePicture']").each(function(){
		var windowTarget = '_showPic_' + $i++;
		var windowParams = '';
		var windowDomain = '';
		var windowSource = $(this).attr('href');
		
		var onClick = $(this).attr('onClick');
		// make string from function (required in IE)
			onClick = onClick.toString();
		windowDomain = 'http://' + onClick.split('index.php').shift().split('http://').pop();
		windowParams = 'width=' + onClick.split('width=').pop().split('status=').shift() + 'status=0,menubar=0';
		
		// modify targets to make sure that all images are opened in separate windows
		$(this).attr('target', windowTarget);
		
		// modify onClick javascript
		$(this).removeAttr('onClick')
			.removeAttr('onclick')
			.removeAttr('href')
			.css('cursor', 'pointer')
			.click(function() {
				openPic(windowDomain + windowSource, windowTarget, windowParams);
				return false;
			});
		
		// apply colorbox: get's trouble with the given styles...
		// $(this).removeAttr('onClick').colorbox();
	});
});

function HideLinks() {
	$('.isHomepage .isHomepage .subcolumns .defWrap').hide();
}
function ShowLinks() {
	$('.isHomepage .isHomepage .subcolumns .defWrap').show();
}
