function load(e,Link )
{
	var doDebug = false;
	var vetrina = document.getElementById("vetrina");
	if ( vetrina != null){
		vetrina.src = Link.href; 
		document.getElementById("vetrinaLabel").innerHTML = Link.title;
		vetrina.title = Link.title;
		vetrina.alt = Link.title;
	}

	if(!e) e = window.event;

	var srcElement = null;
	
	if( typeof( e["srcElement"] )!= "undefined"  )	srcElement = e["srcElement"];
	else 	srcElement = e["target"];

	if(doDebug){
		var a = 0 , str = "";
		for(var i in srcElement) 
		{
			if( srcElement[i] != null && srcElement[i] != "" && srcElement[i] != "none" ){
				str += "srcElement["+i+"]=" + srcElement[i] + "\n";
				a++;
			}

			if (a == 10 ){
				alert( str );
				a = 0; str = "";
			}
		}
		if (a > 0 )alert( str );
	}
	var offset = srcElement["offsetTop"]; // = srcElement["offsetHeight"]; // = srcElement["scrollHeight"];
	srcElement = document.getElementById("scroller");
	var margin = (srcElement.offsetHeight*36)/100;
	if( offset > -1)srcElement.scrollTop = offset-margin;
}

function init(){
	
	window.focus();

	var winW = 630, winH = 460 ;
	var marginTopBotttom  = 70 , marginLeftRight = 60;
	// var scrollerWidth = document.getElementById("scroller").offsetWidth;
	
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = get_win_h(); // winH = document.body.offsetHeight;
	 }
	}
	
	if(false){
		var altezza = window.screen.height;
		var larghezza = window.screen.width;
		alert( "altezza= "+altezza+ "\n" + "larghezza= "+larghezza + "\n Window width = "+winW + "\n" + "Window height = "+winH );
	}

	document.getElementById("galleriaTab").style.height = ( winH - marginTopBotttom) + "px";
	document.getElementById("galleriaTab").style.width = ( winW - marginLeftRight) + "px";
	//alert( "( winH - marginTopBotttom ): "+ ( winH - marginTopBotttom ) + "\ndocument.getElementById(vetrina).offsetHeight :"  + document.getElementById("vetrina").offsetHeight  +"\n"+ ( ( winH - marginTopBotttom ) > document.getElementById("vetrina").offsetHeight )  );
	//if( ( winH - marginTopBotttom ) > document.getElementById("vetrina").offsetHeight)
	document.getElementById("scroller").style.height = ( winH - marginTopBotttom ) + "px";
}

function iecompatest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
function get_win_h(){
	return window.innerHeight? window.innerheight : iecompatest().clientHeight? iecompatest().clientHeight : 0;
}

window.onresize=init;

