function clickButton(e, buttonid){ 

  var evt = e ? e : window.event;
  var bt = document.getElementById(buttonid);

  if (bt){ 
      if (evt.keyCode == 13){ 
         bt.click(); 
        return false; 
      } 
  } 
}

function ShowAlternativeImage(imageName, clientID)    {
    
    document.getElementById(clientID).src = '/images/ecommerce/standard/' + imageName;
    //document['mainImage'].src = '/images/ecommerce/mini/' + imageName;
}

function addToFavorites(urlName, pageName) { 
    window.external.AddFavorite(urlName,pageName);
    return false;
}

function zoomProductImage(productImage) {
    
	if (productImage) {
		window.open('/Ecommerce/zoom.aspx?image=' + productImage,'ZOOM','width=700,height=700,scrollbars=no,resize=no');
    }
    
    //[RK] 21/12/06 - triggered from ImageButton so MUST return false
    return false;
}

function fitPic() {
	if (window.innerWidth){
		iWidth = window.innerWidth;
		iHeight = window.innerHeight;
	}else{
		iWidth = document.body.clientWidth;
		iHeight = document.body.clientHeight;
	}
	
	iWidth = document.images[0].width - iWidth;
	iHeight = document.images[0].height - iHeight;

	window.resizeBy(iWidth, iHeight);
}

function zoomHostPhotoGalleryImage(productImage) {
    
	if (productImage) {
		window.open('/PhotoGalleryZoom.aspx?image=' + productImage,'ZOOM','width=500,height=450,scrollbars=no,resize=yes');
    }
    
    //[RK] 21/12/06 - triggered from ImageButton so MUST return false
    return false;
}

function hideAllMenus() {
    for (i=1;i<=10;i++)
    {
        var menu = document.getElementById('hoverMenu' + i)
        
        if (menu) {
            document.getElementById('hoverMenu' + i).style.display = "none";
        }
        
    }

}
function showMenu(menuNo) {
    
    hideAllMenus()
    
    document.getElementById('hoverMenu' + menuNo).style.display = "block";
}