function openWin(url, width, height, imgsource)
{
  bName=navigator.appName;
  var new_url="";

  if(bName=="Microsoft Internet Explorer")
  {
    for(var i=0; i<url.length; i++)
    {
      var c=url.charAt(i);
      if(c=='%')
      {
        i=i+1;  var d=url.charAt(i);  new_url=new_url+"%25"+d;
      }
      else
        new_url=new_url+c;
    }
  }
  else
  new_url=url;
  
  new_url=new_url+"?img="+imgsource;

  if (!width)
    width = 400;

  if (!height)
    height = 400;
	
  if (height > width)
    { height=screen.availHeight-35;
	  width=height/1.41; }
  else	  
    { width=screen.availWidth-10;
	  height=width/1.41; }

  width=640;
  height=480;

  varn=open(new_url,"newWindow","resizable=no,toolbar=0,left=0,top=0,Scrollbars=no,dependent=1,directories=0,status=0,menubar=0,width="+width+",height="+height);
  varn.focus();
  return varn;
}


function closeWin()
{
window.close();
}