function adaptToSize() {
	var myWidth = 800, myHeight = 600;
	if( typeof( window.innerWidth ) == 'number' ) {
//		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	base = (myHeight/6)-2;
//	alert(myWidth+'\n'+myHeight+'\n\n'+base+'\n'+(myWidth-base-20));
	document.getElementById("navigation").style.width = base +"px";
	document.getElementById("pagebody").style.width = (myWidth-(base*2+20))+"px";
}

function replaceImg(what){
	allimages=document.getElementById("viewerlinks");
	image=allimages.getElementsByTagName("img");
	//reset all images to original size
	for(i=0;i<image.length;i++){
		image[i].className="smallImage";
	}
	//enlarge the clicked image
	what.className="bigImage";
}

function showImg(what){
	document.getElementById("viewerImg").src=what.src;	
}

function setText(what,text){
	try { 
		container=document.getElementById(what.id).parentNode.parentNode;
		(text=='high')?container.getElementsByTagName("span")[0].className="linkemphasised":container.getElementsByTagName("span")[0].className="linkcomment";
	} 
	catch(er) {
		if(er.name='TypeError') return //it's normal, there is no container for the object
	} 
}
