	function openwindow(theURL,winname,features){
	  if(arguments.length<3){
	    features="width=600,height=400,scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes";
	    if(arguments.length<2){
	      winname=""
	    }
	  }
	  var mywin=window.open(theURL,winname,features);
	  if(mywin!=null){mywin.focus();}
	}
  
function popimgdoc(imgsrc,auction,description){

  var features="width=600,height=600,scrollbars=yes,resizable=yes,menubar=no,toolbar=no";
  //Build the page title from url of the image file (named for lot number),
  //and the passed auction number.
  var start=imgsrc.lastIndexOf("/")+1;
	var end=imgsrc.lastIndexOf(".");
	var lotnum="";
  if((arguments.length<3 || (description==""))){
		lotnum=imgsrc.substring(start,end); //gets '001' from '../images/001.jpg'
	}else{
		lotnum=description;
	}
	var title="Auction "+auction+" - Lot "+lotnum; 

	//WebTV can't open a new window, so in that case, display the image in the 'text' frame.
	//Opera on Mac can't do either.
  var canPopWindow=true;
  var bVersion=parseInt(navigator.appVersion);
  //alert("version= "+bVersion);
  if( (navigator.appName.indexOf("WebTV") >= 0)  
    || ( (bVersion < 7) && (navigator.appName.indexOf("Opera") >= 0) && (navigator.platform.indexOf("Mac") >= 0) ) ){
     canPopWindow=false;
  	}

  if(canPopWindow){
		//Internet Explorer is very slow to open a named window, but 
		//named windows are nice because you get only one window per lot.
		//So un-named window for IE, named window for others.
		if (navigator.appName.indexOf("Microsoft")!=-1){
			var winname="";
		}else{
			var winname=title.replace(/\s/g,"");
		}
  
    var mywin=window.open("",winname,features);
	
		if(mywin!=null){
			mywin.focus();

			var doc = mywin.document;

			doc.write('<html><title>'+title+'</title><head></head><body bgcolor="black">');
			doc.write('<table align="center" bgcolor="black"><tr><td align="center" style="font-weight:bold;font-size:18pt;color:white">');
			doc.write(title+'</td></tr>');
			doc.write('<tr><td align="center"><img src="'+imgsrc+'"></td></tr>');
			doc.write('</table></body></html>');
		
			doc.close();
		}else{
			alert("To see image enlargements, be sure 'popups' is enabled in your browser");
		}
  }else{
  	if(navigator.appName.indexOf("WebTV") >= 0) {
		//For WebTV, just write to the current document.
		document.write('<html><title>'+title+'</title><head></head><body bgcolor="ivory">');
		document.write('<table align="center" bgcolor="black"><tr><td align="center" style="font-weight:bold;font-size:18pt;color:white">');
		document.write(title+'</td></tr>');
		document.write('<tr><td align="center"><img src="' + imgsrc + '"></td></tr>');
		document.write('</table></body></html>');
		document.close();
	}else{
		alert("Sorry, Macintosh Opera versions earlier than 7.0 can't display the enlargement.");	
	}  
  }
  return;
}

