// ****************************************************************** IShow Part

	
	var cw=0;
	var ch=0;
	var w=0;
	var h=0;
	var ph=0;
	var pw=0;
	var div_max_w=0;
	var link_to_full=0;
	
	var div = document.createElement('div');
	var div_u = document.createElement('div');
	var img = document.createElement('img');
	var buffer = document.createElement('img');
	var fader = document.createElement('div');
	
	div.style.cursor='pointer';
	div.id='popup_image';
	div.style.position='absolute';
	div.style.display='block';
	
function fade()
{
	var parent = document.getElementsByTagName('BODY')[0];
	fader.id='fader';
	fader.style.backgroundColor='white';
	fader.style.position='fixed';
	fader.style.display='block';
	fader.style.left='0px';
	fader.style.top='0px';
	fader.style.width='100%';
	fader.style.height='100%';
	fader.style.opacity = 0;
	fader.style.filter = 'alpha(opacity=' + 0 + ')'
	parent.appendChild(fader);
}

function expand()
{
	var parent = document.getElementsByTagName('BODY')[0];
	div.style.width=cw+'px';
	if (cw>=div_max_w)
	{
		div.style.width=div_max_w+'px';
		div.appendChild(div_u);
		div.appendChild(img);
		img.height=h;
		img.width=w;
		div_u.innerHTML='Click on the image to return';
//		if (link_to_full==1) 
//			div_u.innerHTML='Click on the image to close. Size of the image is reduced, to view fullsize <a style="color:black;text-decoration:underline" href="'+img.src+'" target="blank">click here</a>';
		
		div.onclick=function() 
		{
		//	parent.removeChild(fader);
			document.getElementById('content').style.display='';
			parent.removeChild(div);
			div.removeChild(img);
			div.removeChild(div_u);
			img.src='./despics/loader.gif';
			img.height=50+"px";
			img.width=50+"px";

//			document.getElementById('footer').style.display='block';
//			parent.style.height='auto';
		}
	}
	else 
	{
		cw+=div_max_w/25;
		setTimeout("expand()",10);
	}
}

function show_image(iurl,win,hin)
{
	link_to_full=0;
	var parent = document.getElementsByTagName('BODY')[0];
	//document.getElementById('content').style.display='none';
	img.onload=function() {};
	div.onclick=function() 	{};
	img.src=iurl;
	parent.appendChild(div);
	cw=0;
	ch=0;
	w=win;
	h=hin;
	var phei=parent.offsetHeight;
	var pwid=parent.offsetWidth;
	
	if (h>Math.round(phei*0.75))
	{
		var k1 = h/w;
		h=Math.round(phei*0.75);
		w=Math.round(h/k1);
		link_to_full=1;
	}
	
	if (w>(pwid-300))
	{
		var k2 = h/w;
		w=(pwid-300);
		h=Math.round(w*k2);
		link_to_full=1;
	}
	
	ph=Math.round(parent.offsetHeight/2);
	pw=Math.round(parent.offsetWidth/2);
	div_max_w=(pwid-250);
	
	div.style.height="80%";
	expand();
}