function handleError() {
	return true;
}

//show a larger version of an image
function showLarger(theID, theImage, theObj) {
	if (document.images) {
		document[theID].src = theImage;
		if (theObj.width > 600) document[theID].width = 600
		  else document[theID].width = theObj.width;

	}
}



//show a larger version of an image
function showLargePhotoandText(theID, theImage, theObj, textID, theText, titleID, theTitle, priceID, thePrice) {
	if (document.images) {
		document[theID].src = theImage;
		if (theObj.width > 600) document[theID].width = 600
		  else document[theID].width = theObj.width; 
	var ta = document.getElementById(textID).firstChild;
	ta.data = theText;
    var ti = document.getElementById(titleID).firstChild;
	ti.data = theTitle;
    var tp = document.getElementById(priceID).firstChild;
	tp.data = thePrice;	
	}
	
}

//show a larger version of an image and text with embedded HTML
function showLargePhotoandHTMLText(theID, theImage, theObj, textID, theText) {
	if (document.images) {
		document[theID].src = theImage;
		if (theObj.width > 600) document[theID].width = 600
		  else document[theID].width = theObj.width; 
	var ta = document.getElementById(textID);
	ta.innerHTML = theText;
	document.getElementById("hiddenarea").style.visibility = "visible";

	}
	
}

//show a medium version of an image and text with embedded HTML
function showMedPhotoandHTMLText(theID, theImage, theObj, textID, theText) {
	if (document.images) {
		document[theID].src = theImage;
		if (theObj.width > 500) document[theID].width = 500
		  else document[theID].width = theObj.width; 
	var ta = document.getElementById(textID);
	ta.innerHTML = theText;
	document.getElementById("hiddenarea").style.visibility = "visible";

	}
	
}

//ask user to confirm their age
function checkAge(yr, mo, da)  {
yrvalue = yr.options[yr.selectedIndex].text;
movalue = mo.options[mo.selectedIndex].text;
davalue = da.options[da.selectedIndex].text;
targetyear = today.year.value - 21;
alert ("targetyear = " + targetyear);
if (yrvalue > "1986")
   {alert ("you are not over 21.  Sorry");
    return false;
    }
 else  {
     alert ("values for date passed is:" + yrvalue +  ", " + movalue + ", " + davalue);
     var newurl = "http://nancynorland.com/drv/ourwines.html";
     //alert ("resetting location to " + newurl);
     window.location.href="http://nancynorland.com/drv/ourwines.html";
     return true;
     }
}


function validatesignup() {
//required fields = username,email,phone
var errlist = "";
if (mainform.username.value=='') errlist = errlist + "name, ";
if (mainform.email.value=='') errlist = errlist + "email, ";
if (mainform.phone.value=='') errlist = errlist + "phone, ";
if (errlist != "") {
alert('The following fields are required: ' + errlist + '. Please fill them and submit this form again.');
event.returnValue=false;
return false;
}
return true
}

function validatesignup2(form) {
//required fields = username,email,phone
var errlist = "";
if (form.username.value=='') errlist = errlist + "name, ";
if (form.email.value=='') errlist = errlist + "email, ";
if (form.phone.value=='') errlist = errlist + "phone, ";
if ((form.email.value != "") & (form.email.value.indexOf("@") == -1))
      {errlist = errlist + "email appears incorrectly formatted, "; }
if (errlist != "") {
alert('The following fields are required: ' + errlist + '. Please enter them and submit this form again.');
//event.returnValue=false;
return false;
}
return true
}


function validatewineorder() {
//required fields = wine, qty
var errlist = "";
var wine=mainform.wine;
var qty=mainform.qty;
winevalue = wine.options[wine.selectedIndex].text;
qtyvalue = qty.options[qty.selectedIndex].text;
if (winevalue =='select a wine') errlist = errlist + "wine, ";
if (qtyvalue =='0') errlist = errlist + "qty, ";
if (errlist != "") {
alert('The following fields are required: ' + errlist + '. Please fill them and submit this form again.');
event.returnValue=false;
return false;
}
//else  alert ("wine order passed validation: wine=" + winevalue + ", qty= " + qtyvalue);
return true
}


function openNewWindow(filename, high, wide)
{
  winref = window.open(filename, "newwin1", "fullscreen=no,toolbar=yes,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+wide+",height="+high+",left=50,top=50");
  winref.focus();
}

function openNewWindow2(filename, high, wide)
{
  winref = window.open(filename, "newwin1", "fullscreen=no,toolbar=yes,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+wide+",height="+high+",left=50,top=50");
  winref.focus();
  return false;
}

