function openWindow(url) {
	adviceWin = window.open(url,'advice','status=no,width=420,height=400,menubar=no,scrollbars=yes');
	adviceWin.focus(true);
	}

function zoom (url) {
	z = window.open('','zoom_popUp','status=0,directories=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,location=0');
	z.document.write('<html>\n<head>\n<title>Picture Zoom</title>\n</head>\n<body>\n<div align="center">\n<img src="' + url + '"><br>\n<form><input type="button" value="Close Window" onClick="self.close(true)"></form>\n</div>\n</body>\n</html>\n');
	z.document.close();
	z.focus(true);
	}


function openSizedWindow(url,w,h) {
	adviceWin = window.open(url,'advice','status=no,width='+w+',height='+h+',menubar=no,scrollbars=yes');
	adviceWin.focus(true);
	}





// executed when one of the warranty radio buttons is selected.
// sets the quantity: attribute for all warranties to 0 except for the 'productid' passed in (set to 1)
// set 'productid' to blank for the 'no warranty' radio button.

function setSelectedWarranty(productid)	{
//	console.log('BEGIN setSelectedWarranty');
//	console.log(' -> productid = '+productid);
	var L = warrantiesArray.length;
	for(var i = 0; i < L; i += 1)	{
		$('#quantity-'+warrantiesArray[i]).val('0');
		}
	if(productid)
		$('#quantity-'+productid).val(1);
	
//	console.log('END setSelectedWarranty');
	}

