
	var db=document.body;
	var img = document.getElementById('michela');
//var width = obj.offsetWidth;
//var height = obj.offsetHeight;
	//var img=$('#michela');
	//document.getElementById('holder').getElementsByTagName('img')[0];
	//alert(img.src);

	var dbsize={}; //needed to store body size
	var imgsrc = $('#michela').attr('src'); //needed to store images src
	var keyStop=function(e){
		var e=window.event||e||{};
		var tag=e.target.tagName.toLowerCase();
		if(tag!='textarea'&&!(tag=='input'&&(e.target.type=='text'||e.target.type=='password'))){ //are the user not writing?
			if(e.keyCode==32||e.keyCode==39||e.keyCode==40){ //Did he press any of the "scrolling-keys"? (down, right, and space key)
				if(e.preventDefault)e.preventDefault();
				else e.returnValue=false;
			}
		}
	}

	if(this.addEventListener)window.addEventListener('keydown',keyStop,false);
	else window.attachEvent('onkeydown',keyStop);

	setInterval("avvia();",300);
	
	function avvia(){
		window.scrollTo(0,0);
		//if(img.complete){ //check if image has loaded
			if(db.clientWidth!=dbsize.w||db.clientHeight!=dbsize.h|| $('#michela').attr('src') != imgsrc){ //check if size or img size has changed
				imgsrc=$('#michela').attr('src'); //store current src
				dbsize.w=db.clientWidth; //store current body width
				dbsize.h=db.clientHeight; //store current body height

				var newwidth=Math.round(dbsize.h*(img.offsetWidth/img.offsetHeight)); //calculate new width based on height

				//img.style.width=(dbsize.w>newwidth?dbsize.w:newwidth)+'px'; //use the largest value of body-width and newwidht
				$('#michela').css('width',(dbsize.w>newwidth?dbsize.w:newwidth));
				//and this is the real trick: if there's no specified height, the height is automaticly calculated relative to the with
				//alert(img.style.width);
			}
		//}
	}

avvia();
$('#michela').resize();
