window.onload = function ()
{
	setShopButtons();
}

function setShopButtons() 
{
	// loop over all shoplinks and set the shopping buttons with their properties
	//
	var shopItemArray = document.getElementsByName('shopitem');
	for (var i = 0; i < shopItemArray.length; i++){
		var currButton = getObj(shopItemArray[i].id);
		if(typeof(currButton) == 'object'){
			layoutShopButton(currButton);
		}
	}
}

function layoutShopButton(currButton)
{
	currButton.style.visibility = 'visible';
	currButton.style.width = '49px';
	currButton.style.height = '40px';
	currButton.style.align = 'right';
	currButton.style.valign = 'bottom';
	currButton.border = '0';
	currButton.innerHTML = '<img border="0" src="http://www.nafra.be/images/shop-button.gif">';
	currButton.href = 'http://www.aftersun.be/clientdata/nafra/shoppingcart/index.cfm?item='+currButton.id;
	currButton.target = 'shoppingbasket';



	//alert.window.();
}

// === helper functions ===

function getObj(name) 
{
	// browser compatible object getter
	//
	if (document.getElementById)
	{
		obj = document.getElementById(name);
	}
	else if (document.all)
	{
		obj = document.all[name];
	}
	else if (document.layers)
	{
	 	obj = document.layers[name];
	}
	return obj;
}

