var myimages = new Array()
function preloadimages()
{
  for (i=0;i<preloadimages.arguments.length;i++)
  {
    myimages[i] = new Image()
    myimages[i].src = preloadimages.arguments[i]
  }
}
preloadimages(
	"/ie-en/images/leftnav/about-on_txt.gif",
	"/ie-en/images/leftnav/quiz-on_txt.gif",
	"/ie-en/images/leftnav/ecard-on_txt.gif",
	"/ie-en/images/leftnav/location-on_txt.gif",
	"/ie-en/images/leftnav/contact-on_txt.gif",
	"/ie-en/images/leftnav/flavours-on_txt.gif",
	"/ie-en/images/leftnav/nutrition-on_txt.gif",
	"/ie-en/images/leftnav/team-on_txt.gif",
	"/ie-en/images/leftnav/pleasure-on_txt.gif",
	"/ie-en/images/leftnav/heartbrand-on_txt.gif",	
	"/be-fr/images/leftnav/about-on_txt.gif",
	"/be-fr/images/leftnav/quiz-on_txt.gif",
	"/be-fr/images/leftnav/ecard-on_txt.gif",
	"/be-fr/images/leftnav/location-on_txt.gif",
	"/be-fr/images/leftnav/contact-on_txt.gif",
	"/be-fr/images/leftnav/flavours-on_txt.gif",
	"/be-fr/images/leftnav/nutrition-on_txt.gif",
	"/be-fr/images/leftnav/team-on_txt.gif",
	"/be-fr/images/leftnav/pleasure-on_txt.gif",
	"/be-fr/images/leftnav/heartbrand-on_txt.gif",
	"/be-fl/images/leftnav/about-on_txt.gif",
	"/be-fl/images/leftnav/quiz-on_txt.gif",
	"/be-fl/images/leftnav/ecard-on_txt.gif",
	"/be-fl/images/leftnav/location-on_txt.gif",
	"/be-fl/images/leftnav/contact-on_txt.gif",
	"/be-fl/images/leftnav/flavours-on_txt.gif",
	"/be-fl/images/leftnav/nutrition-on_txt.gif",
	"/be-fl/images/leftnav/team-on_txt.gif",
	"/be-fl/images/leftnav/pleasure-on_txt.gif",
	"/be-fl/images/leftnav/heartbrand-on_txt.gif");



////////////////////////////////////////
// Image Rollovers
function imgRollover(objLink , state)
{
if (document.getElementById)
{
	var strImgSrc = objLink.getElementsByTagName("img")[0].src
    strImgSrc = strImgSrc.substring (0 , strImgSrc.lastIndexOf("-"))
    
    if (state == "on")
    {
    objLink.getElementsByTagName("img")[0].src = (strImgSrc + "-on_txt.gif")
    }
    else
    {
    objLink.getElementsByTagName("img")[0].src = (strImgSrc + "-off_txt.gif")
    }
}
}


function changeHpnImage(button, hpnClass)
  {
    var btn = button.parentNode.parentNode;
    btn.className = hpnClass;
  }
  
function changeToutImage(button, btnClass)
  {
    button.parentNode.className = btnClass
  }
  
  function changeHpnSubPageImage(button, hpnClass)
  {
		var btn = button.parentNode.parentNode;
		btn.className = hpnClass;
	}
			
function changeNavigationImage(button, btnClass)
  {
		button.parentNode.className = btnClass
	}		
	
function changeHpnHomeImage(button, hpnClass)
  {
    var btn = button.parentNode;
    btn.className = hpnClass;
  }	

function openPopup(href, width, height) {
	window.open (href, "popup","menubar=0,scrollbars=0,resizable=0,width="+width+",height="+height);
}

function openAsPopup(href, width, height) {
	window.open (href, "popup","menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
}

// opens and External Popup of fixed dimentsions
// obj - anchor object
// name - name for the popup
function openExternalPopup(obj , name) {
  
  var href = obj.href
	window.open (href, name,"menubar=0,scrollbars=1,resizable=1,width=520,height=450");
}
