$(document).ready(function() {
	if (jQuery.browser.msie) {
		//trig_bind();
	}
	/**
	 * Fancybox Funktionalität hinzufügen
	 */
	$("a.fancybox-window,a.fancybox-window-group").append('<div class="lupencontainer"></div>');
	$("a.fancybox-window").fancybox();
	/**
	 * Fancybox mit IFRAME Funktionalität (HTML, pdf)
	 */
	$("a.fancybox-window-iframe").fancybox({
		'type'			:	'iframe',
		'width'			:	'80%',
		'height'		:	'80%'
	});

	/**
	 * Fancybox für mehere, als Gruppe
	 */
	$("a.fancybox-window-group").attr('rel','fb-group');
	$("a.fancybox-window-group").fancybox();	
});



/*
 * IE waits until another event to send the 'change' events on radios and checkboxes
 * This bind a trigger for those events on click.
 * [http://www.opensourcery.com/blog/chad-granum/ie-onchange-events]
 */


function trig_bind() {
	// unbind old events
	$("input[type='checkbox']").unbind('click')
	$("input[type='radio']").unbind('click')
	// bind the events
	$("input[type='checkbox']").bind('click', function() {
		$(this).trigger('change')
	});
	$("input[type='radio']").bind('click', function() {
		$(this).trigger('change')
	});
}
