
docheight=0;
docwidth=0;
if(document.documentElement)
	{
	if(document.documentElement.clientHeight) docheight=document.documentElement.clientHeight-23;
	if(document.documentElement.clientWidth) docwidth=document.documentElement.clientWidth;
	}
//alert('docheight  ' + docheight + '  docwidth  ' + docwidth);	

//alert('docwidth ' + docwidth);
if(docwidth)
	{
	sidebarwidth=(docwidth-630)/2;
	
	available_height=docheight-160;	// 160 is approx text height
	sidebarimgheight=parseInt(available_height/3);
	//alert('sidebarimgheight : ' + sidebarimgheight);	
	
	sidebarimgwidth=sidebarwidth;
	
	ratioimgheight=parseInt(sidebarimgwidth*0.75);
	
	if(sidebarimgheight<ratioimgheight)
		{
		//alert('image too big\n\n' + sidebarimgheight + '\n\n' + ratioimgheight)
		sidebarimgwidth=parseInt(sidebarimgwidth*(sidebarimgheight/ratioimgheight));
		}
	
	
	
	sidebarheight=docheight-3;
	}