jQuery(document).ready(function(){
	var autoclose = 0;
	var regexS = "[\\?&]autoclose=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( location.search );
	if( results != null )
		autoclose = parseFloat(results[1]);
	if(autoclose && window.parent.jQuery.prettyPhoto){
		setTimeout(function() {
			window.parent.jQuery.prettyPhoto.close();
		}, autoclose);
	}
	$('.closemodal.interrupt').click(function(){
		if(window.parent.jQuery.prettyPhoto){
			window.parent.jQuery.prettyPhoto.close();
			return false;
		}
	});
	$('.closemodal.interrupt').removeClass('interrupt');
});

