function adjustvertical(){
	if($defined($('artdescr'))){
		var descrvals = $('artdescr').getCoordinates();
		if(descrvals.height < 330){
			var descrspace = 330 - descrvals.height;
			var dnr = Math.floor(descrspace/18)+5;
			$('artdescr').style.paddingTop = ""+((dnr*18)+12)+"px";	
		}
	}
	
	if($defined($('nojsdisp')) && $defined($('display'))){
		var dispvals = $('nojsdisp').getCoordinates();
		if(dispvals.height < 427){
			var space = 427 - dispvals.height;
			var nr = Math.floor(space/18)+2;
			$('display').style.paddingTop = ""+nr*18+"px";
		}
		else{/*
			var dispscroll = new Fx.Scroll($('display'));
			$('display').style.overflow="hidden";
			//MOUSEWHEEL-Events
			Element.Events.extend({
				'wheelup': {
					type: Element.Events.mousewheel.type,
					map: function(event){
						event = new Event(event);
						if (event.wheel >= 0) this.fireEvent('wheelup', event)
					}
				},
			 
				'wheeldown': {
					type: Element.Events.mousewheel.type,
					map: function(event){
						event = new Event(event);
						if (event.wheel <= 0) this.fireEvent('wheeldown', event)
					}
				}
			});
			$('display').addEvents({
				'wheelup': function(e) {
					e = new Event(e).stop();
			 		var scrnow = $('display').getSize().scroll.y;
					dispscroll.scrollTo(0,scrnow-180);
				},
			 
				'wheeldown': function(e) {
					e = new Event(e).stop();
			 		var scrnow = $('display').getSize().scroll.y;
					dispscroll.scrollTo(0,scrnow+180);
				}
			});
			
			var scrolldown = new Element('span',{
   			'events':{
	   			'click': function(){
		   			var scrnow = $('display').getSize().scroll.y;
					dispscroll.scrollTo(0,scrnow+144);
	   			},
	  			'mouseover': function(){
					this.setStyle('cursor', 'pointer');
					this.setStyle('background-position', '0 -18px');
					
	   			},
				'mouseout': function(){
					this.setStyle('background-position', '0 0');
	   			}
	   		},
	  		'id': 'scrolldown'
	  		});
			var scrollup = new Element('span',{
   			'events':{
	   			'click': function(){
		   			var scrnow = $('display').getSize().scroll.y;
					dispscroll.scrollTo(0,scrnow-144);
	   			},
	  			'mouseover': function(){
					this.setStyle('cursor', 'pointer');
					this.setStyle('background-position', '0 -18px');
					
	   			},
				'mouseout': function(){
					this.setStyle('background-position', '0 0');
	   			}
	   		},
	  		'id': 'scrollup'
	  		});
			var scrollbar = new Element('div',{
	  		'id': 'scrollbar'
	  		});
			
			$('scroller').appendChild(scrollup);
			$('scroller').appendChild(scrolldown);
			*/
		}
	}
}

function valignSite(){
	var vsh = window.getHeight();
	if(vsh > 547){
		var rest = Math.floor((vsh-547)/2);
		$('wrap').style.marginTop = ""+rest+"px";
	}
	else{
		$('wrap').style.marginTop = "25px";	
	}
}

window.addEvent('domready', function() {
	valignSite();
	adjustvertical();
});


