function css() {

	h = $('html').height();
	$('html').css('min-height',h-3+'px');
	$('body').css('min-height',h-6+'px');
			
	/* go on for IE in generall */
	if($.browser.msie){
		
		/* take care IE 6 only */
		if($.browser.version <= 7) 			
			$('body').css('min-height',h-3+'px');
			
			
		if($.browser.version <= 6) {
			$('body').css('height',h-3+'px');
			$('ul li:first-child').addClass('first-child');
			
				$('li').hover(function(){
					$(this).addClass('hover');
				}, function(){
					$(this).removeClass('hover');
				});
				
				
				$('#logo img, .img-mod img').fixPNG();
			
	
		} // ie6
		


		$('ul li:last-child').addClass('last-child');
		
	} // ie
	
	if((h*0.75)<600)
		$('.bd-home .author-img img').attr('height',(h*0.75));

	$('.bd-info #content .sub-page .d').hide();
	$('.bd-info #content .sub-page .title').after('<div class="aftertitle"></div>');
	$('.aftertitle').unbind().bind('click',function(){
		$('.bd-info #content .sub-page .d').toggle();
		$(this).prev().toggleClass('title-open');
		$.getScript('/wp-content/themes/opa/js/sifr-config.js');
	});
	
	
	if($("*").index( $('.mod-menu')[0]) != -1){
		$('.mod-menu').jScrollPane({
			showArrows: true
		});
		
		
		$mod = $('.mod-menu');
		$item = $mod.find('li');
		
		$item.each(function(i){			
			if($(this).is('.act'))
				j = i;
				
			i++;
		});
		
		c = $mod.offset().top;
		d = $item.offset().top;
		e = j*22;
		
		$mod[0].scrollTo(parseInt(e));
		
		
	}
	
	/* navigation */
	$('#nav li').each(function(n){
		$(this).addClass('item-'+n);
		$(this).children('a').wrap('<span></span>');
	});

	$('.coop-list a').attr('target','_blank');

	$('#content .ngg-gallery-thumbnail-box').each(function(n){
		
		$(this).children().children('a').attr('title','0'+n);
		$(this).children().children('a').children().attr('alt','0'+n);
		o = $('#content .ngg-gallery-thumbnail-box').size()-1;
		if(n == o)
			$(this).addClass('ngg-gallery-thumbnail-box-last');
	});


	$('a.fb').fancybox({
		'padding': 0,
		'imageScale': true,
		'zoomOpacity' : true,
		'zoomSpeedIn' : 500,
		'zoomSpeedOut' : 500,
		'centerOnScroll': false
	});

	
}

$(document).ready(css);

jQuery.fn.fiximage = function() {

	return this.each(function(i){	
		
		fi_src = $(this).attr('src');
		fi_src = fi_src.replace('.png','.gif');
		$(this).attr('src',fi_src);
	}); // each
};

jQuery.fn.fixPNG = function() {


	return this.each(function(i){			
		image = $(this).attr('src');
		if (image){
			if (image.match(/\.png/i)){
				m = '<div></div>';
				$(this).hide().after(m, 
					$(m).css({
						'zoom' : '1',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+image+"', sizingMethod='image')"
					})
				);
			}
		}
	}); // each		
};
