$(document).ready(function() {
	
	
	
		simplefader.intervall = 10000;
		simplefader.fadeintervall = 1000;
		simplefader.screenchooser = false;
		simplefader.playresume = true;
		simplefader.init();
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	$('.menu_item').click(function() {
		$('#pen').remove();
		if (($(this).text().length > 4)){
			margine=($(this).text().length)*8;
		}
		else{
			margine=40;
		}
		$(this).parent().append('<div id="pen" style="margin-left:'+ margine +'px"></div>');
		$('#pen')
		//  .spStop(true)
		.sprite({fps: 24, no_of_frames: 9, rows:1, lastRowCount:9, play_frames:9})
		//.spRandom({top: 50, bottom: 200, left: 300, right: 320})
		//.activeOnClick()
		//.active();
		.spStart();
	});
	$('#pen')
	.sprite({fps: 24, no_of_frames: 9, rows:1, lastRowCount:9, play_frames:9})
	//.spRandom({top: 50, bottom: 200, left: 300, right: 320})
	//.activeOnClick()
	//.active();
	.spStart();

	if(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) ||
			navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ||
			navigator.userAgent.match(/iPad/i) ) {
			$('footer').css({
				position:'static',
				width:'1039px',
				height:'109px',
				margin:'-109px auto 0px auto',
				padding:'0px 0px 0px 0px',
				overflow:'hidden',
				background:'url(null)'
			});

			$('#footer_info').css({
				position:'absolute',

				margin:'0px 0 0  auto',
				overflow:'hidden'

			});

			$('.spacer').css({
				height:'50px'
			});
			/*
			if (!!('ontouchstart' in window)) {
				$('nav').touchScroll();
			}*/
	}

});

