/**
* prescrolls a <select> list to a certain item and position in the viewport (to be called at page load)
*
* @param selectObject 'this' reference to the <select> object (i.e. selectOption(myselect, 10)
* @param targetOption numeric index of the desired target option (base 0)
*/
function preScrollSelectObject (selectObject, targetOption)
{
	var limit = selectObject.options.length; // total number of items
	var size = selectObject.size; // number of rows in scrollable view port
	var defaultPosition = 5; // number of rows down to place selected option in view port (after scrolling)
	var offset = size - defaultPosition;
//alert("limit=" + limit + ", size=" + size + ", offset=" + offset);
	if ((limit > size) && (defaultPosition < size)) // scrollable with valid offset?
	{
		if (targetOption > defaultPosition) // need to scroll?
		{
			var scrollTargetOption = Math.min(limit - 1, targetOption + offset - 1); // adjusted for zero-base
			myselect.options[scrollTargetOption].selected = true;
		}
	}
	myselect.options[targetOption].selected = true;	
}
/**
* launches a new page with a query string based the value selected in an optionlist
*
* @param selectObject 'this' reference to the <select> object (i.e. onchange="selectOption(this, thaturl)"
* @param url the full domain name for the site (to support testing on localhost, preview, and stage sites																		
*/
function selectOption(selectObject, url)
{
		var thisvalue = selectObject.options[selectObject.selectedIndex].value;
		document.location = url + "/products/" + thisvalue;
}
