
// This function opens a popup window to display awards for a product.
// Parameters:
//		controller		- URL to the HTTP controller.
//		stateId			- State id of the current page.
//		prodId			- Id of the product whose awards are to be displayed.
//		wLft			- Window position: left offset.
//		wTop			- Window position: top offset.
//		bCkCk			- A boolean value indicating whether to check cookie.
//		hideMore		- A boolean value indicating whether to display the "See more awards" link.
//		pageYear		- Year of the awards to be displayed. If this variable is an empty string (''), all award years will be displayed.

function awardsPopUp(controller, stateId, prodId, wLft, wTop, bCkCk, hideMore, pageYear) 
{
	var hideMoreValue;
	if (hideMore)
	{
		hideMoreValue = 'true';
	}
	else
	{
		hideMoreValue = 'false';
	}
	
	var url;
	url = controller + '?st=' + stateId + '&e=prodAwards&hideMore=' + hideMoreValue + '&pid=' + prodId;
	if (pageYear.Length > 0)
	{
		url += '&pageYear=' + pageYear;
	}
	
	if (!bCkCk || document.cookie.indexOf("FPProdAwdPup"+prodId) == -1)
		window.open(url, 'prodAwards', 'left=' + wLft +',top=' + wTop + ',resizable=yes,scrollbars=yes,toolbar=no,width=367,height=183');
}


function seeMoreAwards(controller, iAwardYear, stateId) {
	if (!stateId){
		stateId = "2101"
	}
	window.open(controller + '?st=' + stateId + '&e=awards&pcat=awards_' + iAwardYear + '&psubcats=true', 'awardwinners','left=10,top=10,width=800,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes');	
	window.close();
}
