function imageLoader (itemnumber, sectionsize) {
			
			listid = '#'+itemnumber+' .img_wrapper .main_img img'; // jquery pfad
			textid = '#'+itemnumber+' .img_wrapper .img_txt';
			attrvalue = $(listid).attr('name'); //name auslesen
			$(listid).attr('src', attrvalue);
			$(textid).removeClass('loading');
			//image resize
			img_item_percent = Math.round((sectionsize / $(listid).height()) * 100);			   
			img_item_size = $(listid).width();
			$(listid).attr('height', sectionsize);
			new_width = Math.round((img_item_size/100)*img_item_percent);
			$(listid).attr('width', new_width);
};

function pageResize () {
var  window_width =  window.innerWidth ||  (window.document.documentElement.clientWidth || window.document.body.clientWidth);
var window_height = window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight);
sections_height = (window_height /100) * 67;
sections_width = window_width ;
sections_marginTop = (window_height - 175 - sections_height)/2;
$('#sections').height(sections_height).css();
$('#sections').width(sections_width).css();
$('#sections').css({marginTop:sections_marginTop});
//automatische bild-größe
$('.img_wrapper').width(sections_width);
//margin links für die bildzentrierung - hoch und quer
img_item_q_percent = sections_height / $('.img_item_q').height() * 100;
img_item_q_width = $('.img_item_q').width();
imagenewsize = (img_item_q_width/100)*img_item_q_percent;
$('.img_item_q').width(imagenewsize);
$('.img_item_q').height(sections_height);
wrapper_margin_auto = ((sections_width - (imagenewsize))/2);
$('.item_q').css({marginLeft:wrapper_margin_auto});
//margin links für die bildzentrierung - info
$('.img_txt').css({marginLeft:10});
$('.img_txt').addClass('loading');
//margin top für die bildinfos
img_txt_height = $('.img_txt').height();
img_txt_margin_auto = (sections_height - img_txt_height);
$('.img_txt').css({marginTop:img_txt_margin_auto});
//next/prev positionierung von oben
arrow_top = (window_height /100) * 59;
$('#screen .next').css({top:arrow_top});
$('#screen .prev').css({top:arrow_top});
//nav in die mitte
nav_margin_auto = ((window_width - 804)/2);
$('#nav-container').css({marginLeft:nav_margin_auto});
//carousel in die mitte
slideshow_width = $('#screen2').width();
carousel_margin_auto = ((window_width - slideshow_width)/2);
$('#screen2').css({marginLeft:carousel_margin_auto});
};

// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/

jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){
	pageResize();
for (var i = 1; i <= 10; i++){
	number = "item"+i;
imageLoader(number,sections_height);
if(i==10) {loaded();}
};
	
});

function loaded() {
	$('#fader').fadeOut(800);
	return false;
	};
