// fix
var ie = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;




// RUN
(function ($) {$(document).ready(function()
{ 
	// VERTICAL ALIGN
	$.fn.vAlign = function() {
		return this.each(function(i){
			var windowHeight = $(window).height();
			var divHeight = $(this).height();
			var delta = windowHeight - divHeight;
			
			// se il delta � troppo piccolo, forzo + x. In questo modo forzo comunque che lo spostamento sia di almeno delta/2.
			if(delta < 50) windowHeight+=50;
			
			if(divHeight < windowHeight)
			{
				var top = (Math.floor((windowHeight - divHeight) / 2) + $(window).scrollTop());
				$(this).css('top',top);
			}
		});
	};

	// DIMENSIONI SITO
	// al cambio di risoluzione, la distanza del box centrale cambia, da zero in su
	$('#doc920').vAlign();
	$(window).bind('resize',function(){
		$('#doc920').vAlign();
	});

/*
	// PROFILER
	// run splashscreen
	if($('a[rel=#codeigniter_profiler]').length > 0)
	{
		var splashscreen = $('a[rel=#codeigniter_profiler]').overlay({
			effect: 'apple',
			mask: '#fff'
		});
	}

	// run debugger
	if($('a[rel=#codeigniter_debugger]').length > 0)
	{
		var splashscreen = $('a[rel=#codeigniter_debugger]').overlay({
			effect: 'apple'
		});
		$("#codeigniter_debugger").draggable();
		$("#codeigniter_debugger").resizable();
	}
*/




});})(jQuery);
