/**
 * This function redirects the page based on the inputs when user changes the item count per page
 * Calling routine must know whether or not there are other parameters in the query string
 * In the architecture at the time this was written, the difference occurs between
 * whether the user is navigating through products (no parameters except pagecount) 
 * or using search (everything is a parameter)
 * @param {String} queryStr the base string plus existing parameters (if any)
 * @param {Number} newItemsCount number of items per page
 * @param {Boolean} isFirstParam true if there are no parameters yet in the queryStr
 * @author Mike Smith
 */
function changePageItemsCount(queryStr, newItemsCount, isFirstParam)
{
	var separator = "&";
	if (isFirstParam)
		separator = "?";
	document.location = queryStr + separator + "pageItemsCount=" + newItemsCount;
}

/**
 * loads unobtrusive javascript events after the page loads (so that objects are instantiated first)
 * @author Mike Smith
 * @author Angus Turnbull (rough idea from blog post somewhere)
 * include this in the head of the document
 */
var saveForSearchResultEvt = window.onload; 
window.onload = function() 
{
	if (saveForSearchResultEvt != undefined) 
	{
		setTimeout("saveForSearchResultEvt()",10); 
	}
	setImgRollover('openHouseSmallTab','openHouseSmallTab', '/static/template_imgs/_framework/open_house_smalltab.gif', '/static/template_imgs/_framework/open_house_smalltab_over.gif');

	if(document.getElementById('openHouseSmallTab')!=null){
	  document.getElementById('openHouseSmallTab').onclick = function() { scrollWindowTo('pageOpenHouse'); };
	}
};