$(document).ready(function() {
	$('.js #content').css('visibility','visible');
	$('#projectTeaser').teaser();
	$('#projectList').projectlist();
	$('#content div.csc-textpic div.gallery').pagegallery();
	$('#projectDetail div.gallery').projectgallery();
	$('.services.accordion').accordion();
	$('ul.content li').css('list-style','none').prepend("<span class='arrow'>→</span>");
	
	// deactivate rotation in ie
	if (!$.browser.msie) {
		var rotation = function (){
			$('#moodcubeTeaser img').rotate({
		      angle:0, 
		      animateTo:360, 
		      callback: rotation,
		      duration:2500
		   });
		};
		rotation();
	}
	
	
	// ie7 list gap hack
	if ($.browser.msie && parseInt($.browser.version, 10) <= 7) {
		$('#mask, .background, ul.mask').each(function(){
			var currentTop = 0;
			listContainer = $(this);
			listContainer.children('li').each(function() {
						if ($(this).css('position') != 'absolute') {
							$(this).css('position', 'absolute').css('top',currentTop + 'px');
							if ($(this).hasClass('line')) {
								if (listContainer.hasClass('mask')) {
									currentTop += 20;
								} else {
									currentTop += 1;
								}
							} else if ($(this).hasClass('block')) {
								currentTop += 20;
							}
						}
					});
			if ($(this).attr('id') == 'mask') {
				$(this).children('li').css('right', '0');
			}
		});
	};
});
