<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewPage(page,img){
  foto1= new Image();
  foto1.src=(img);
	w=305;
	h=foto1.height+290;
  stringa="width="+w+",height="+h;
  finestra=window.open(page,"",stringa);
}

function showMenuItem (itemID) {
		for (var i = 1; i <= maxID; i++) {
			hideLayer(i);
		}
		showLayer(itemID);

//		alert(document.getElementById("menuTableTD").height);
//		document.getElementById("contentTableTD").height = "100%";		
//		document.getElementById("menuTable").style.removeProperty("height");
//		document.getElementById("menuTable").style.setProperty("height", "100%");
//		document.getElementById("menuBlankSpace").style.height = "100%";
}


function resizeInnerToFit(slika) {
	
	var NS = (navigator.appName=="Netscape")?true:false; 
	
  iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
  iHeight = (NS)?window.innerHeight:document.body.clientHeight;

	var w = document.getElementById(slika).width;
	var h = document.getElementById(slika).height;
	//alert("Inner: "+iWidth+"x"+iHeight+"\nScreen: "+screen.width*0.9+"x"+screen.height*0.9);
	//if (iWidth > screen.width*0.90)
	//{
	//	alert("Too wide!");
	//}
	//if (iHeight > screen.height*0.90)
	//{
	//	alert("Too high!");
	//}
	
	var rate;
	var wrate=screen.width*0.6;
	var hrate=screen.height*0.6;

	if (( w > wrate ) || ( h > hrate ))
	{
		if ( w / wrate > h / hrate )
		{
			rate = w / wrate;
		} else
		{
			rate = h / hrate;
		}
		w = w / rate;
		h = h / rate;
	}
	document.getElementById(slika).width = w;
	document.getElementById(slika).height = h;

	//h = h + 180;
	h = document.getElementById('vse').offsetHeight;
	w = w + 45;

	if ( w < 325 ) {
		w = 325;	
	}

	diff = h - screen.height*0.85;
	if ( diff > 0 )
	{
		//document.getElementById('textdiv').style.height = document.getElementById('textdiv').height - diff;
		h = h - diff;
		document.getElementById('textdiv').style.height = h - document.getElementById(slika).height - 49;
	}

	document.getElementById('vse').style.width = w;
	document.getElementById('vse').style.height = h;
	
	iWidth = w - iWidth; 
	iHeight = h - iHeight;

	window.resizeBy(iWidth,iHeight);
}

function hideLayer (id)
{
	document.getElementById(id).style.display="none";
}

function showLayer (id)
{
	document.getElementById(id).style.display="";
}
//  End -->

