function validateOptions(form) {
	var returnVal = true;
	
	for(i=0; i<form.elements.length; i++) {
        if (form.elements[i].selectedIndex == 0) {
			// If please is anywhere in the value for the first option, 
                        // assume they did not choose an option.
            if (form.elements[i].value.toLowerCase().indexOf('please') >= 0) {        
               	returnVal = false;
                alert('Please select a ' + form.elements[i].name.toLowerCase() + '.');
                break;
            }
		}
	}
	return returnVal;
}


function changeImage(img) {
 var imageName;
 for (i = 1; i <= 9; i++) {
  imageName = "image" + i; 
  if (document.getElementById(imageName)) {
   document.getElementById(imageName).style.display='none';
  }
 }
 document.getElementById(img).style.display='block';
}

function ResizeToFit(dlg, picHeight, picWidth) {
 var imgWidth;
 var imgHeight;
 imgWidth = picWidth + 60; 
 imgHeight = picHeight + 110;
 dlg.resizeTo(imgWidth, imgHeight);
}
function mssDisplayImages(img, name, width, height){
 features = 
    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
    "scrollbars=no,resizable=no,width=" + width + ",height=" + height;
 dlg = window.open ("","Details",features);
 dlg.document.write("<html><head><title>" + name + " Zoom</title></head>");
 dlg.document.write("<body bgcolor=white onLoad=\"javascript:opener.ResizeToFit(self,  picImg.height, picImg.width);\"><center>");
 dlg.document.write("<table width=100% height=100%>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<img name=\"picImg\" src=" + img + ">");
 dlg.document.write("</td></tr>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<a href=# onClick=window.close();>");
 dlg.document.write("<font size=1 face=Arial>Click to close</font></a>");
 dlg.document.write("</td></tr>");
 dlg.document.write("</table></body></html>");
 dlg.document.close();
}
// end popup image functions
NewWindow = null;
Inventory = null;
function InventoryWindow(InvUrl,Param)
{

	if (window.Inventory) {
		if (!Inventory.closed){
					Inventory.close();
					Inventory = null;
		}
	}
	Inventory = window.open(InvUrl,"InvWin",Param);
	return false;
}

function ImageWindow(WinPic,WinParam)
{

	if (window.NewWindow) {
		if (!NewWindow.closed){
					NewWindow.close();
					NewWindow = null;
		}
	}
	
	NewWindow=window.open("","NewOne",WinParam);
	NewWindow.document.write ("<HTML><HEAD><TITLE>");
	NewWindow.document.write ("Image Zoom");
	NewWindow.document.write ("</TITLE></HEAD>");
	NewWindow.document.write ("<body border=0 TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0  BGCOLOR=#c8c8c8 TEXT='#000000' LINK=#0000cc VLINK=#663399>");
	NewWindow.document.write ("<TABLE border=0 cellpadding=0 width='100%'><tr bgcolor='#ffffff'><td bgcolor='#ffffff'>");
	NewWindow.document.write ("<P ALIGN=CENTER>");
	NewWindow.document.write ("<A HREF='JavaScript:this.close()'><IMG BORDER=0 HSPACE=0 VSPACE=0 SRC='");
	NewWindow.document.write (WinPic);
	NewWindow.document.write ("'></A>");
	NewWindow.document.write ("</P>");
	NewWindow.document.write ("</td></tr><tr><td bgcolor=#000000>");
	NewWindow.document.write ("<P ALIGN=CENTER>");
	NewWindow.document.write ("<B><FONT SIZE='2' COLOR=#FFFFFF face=arial>");
	NewWindow.document.write ("Click the image to close this window");
	NewWindow.document.write ("<br><img src='/lib/herrington-catalog/popuplogo.gif' align=center></FONT></P><br><br><br>");
	NewWindow.document.write ("</td></tr></table>");
	NewWindow.document.write ("</BODY></HTML>");
	NewWindow.document.close();
	return false;
}

function aolwin(aolurl){
	if (navigator.appVersion.indexOf('AOL') != -1){window.location=aolurl;}
}



