/**
* Opens a popup window containing a newsletter
**/
function openNewsletterPopup(newsletter_id)
{
	if(newsletter_id != null)
	{
		window.open('tpl.newsletter.popup.php?id='+newsletter_id, '', 'width=780, height=560, scrollbars=1');
	}
}

function openCurrencyPopup()
{
	window.open('tpl.popup.currency.php', '', 'width=300,height=150');
}

function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function executeProductSelect()
{
	var url = "?contentType=";
	var product_select;
	product_select = document.getElementById('product_select');
	if(product_select != null)
	{
		var selected_option;
		selected_option = product_select.options[product_select.selectedIndex];
		if(selected_option != null)
		{
			var entity_id;
			entity_id = selected_option.value;
			if(entity_id != null)
			{
				var group_attribute;
				group_attribute = selected_option.attributes.group;
				if (group_attribute != null)
				{
					var group_attribute_id;
					group_attribute_id = group_attribute.value;
					if(group_attribute_id != null)
					{
						url = url+"PRODUCT&id="+entity_id+"&PRODUCT_CATEGORY_ID="+group_attribute_id;
					}
				}
				else
				{
					url = url+"PRODUCT_CATEGORY&PRODUCT_CATEGORY_ID="+entity_id;			
				}
				window.location.href = url;
			}

		}
	}
}

function showAccessoriesDiv()
{
	hideCustomizeDiv();
	showDiv('accessories');
}
function hideAccessoriesDiv()
{
	hideDiv('accessories');
}

function showCustomizeDiv()
{
	hideAccessoriesDiv();
	showDiv('customiseme');
}
function hideCustomizeDiv()
{
	hideDiv('customiseme');
}
function showDiv(id)
{
	customize_div = document.getElementById(id);
	customize_div.style.display = 'inline';
}
function hideDiv(id)
{
	customize_div = document.getElementById(id);
	customize_div.style.display = 'none';
}