


    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



    function HideShow(obj) 
    { 
        if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1) 
        {
            if (obj.style.display=="none") 
                 obj.style.display="";
            else
                 obj.style.display="none";
        }
    } 



    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



    function fJustHide(obj) 
    { 
        if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1) 
        {
            obj.style.display="none";
        }
    } 



    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



    function imgToggle(imgName,strOnExt,strOffExt) {
        if (document.images) {
            if (strOnExt.length > 0)  
            {
                document[imgName].src = eval(imgName + strOnExt + ".src"); 
            } 
            else 
            {
                document[imgName].src = eval(imgName + strOffExt + ".src"); 
            }
        }
    }



    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



    function imgSwap(oImg)
    {
        var strOver  = "_on"    // image to be used with mouse over
        var strOff = "_off"     // normal image
        var strImg = oImg.src
        if (strImg.indexOf(strOver) != -1) 
            oImg.src = strImg.replace(strOver,strOff)
        else
            oImg.src = strImg.replace(strOff,strOver)
    }



    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


var forcedRefresh = true;
var alreadyopen = new Array();
var newwin = new Array();

function openCenteredWindow(uri, name, features, width, height){

  var winl = parseInt((screen.width - width - 10) / 2),
      wint = parseInt((screen.height - height - 29) / 2);
  openWindow(uri, name, features + (features ? ',' : '') + 'height=' + height + ',width=' + width + ',top=' + wint + ',left=' + winl);
}

function openPopup(url) {
  openCenteredWindow(url,'Nutrition','toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no','650','775');


}
function openWindow(uri, name, features){

  if(!forcedRefresh && alreadyopen[name] && !newwin[name].closed){
    newwin[name].focus();
  }
  else{
    alreadyopen[name] = true;
    newwin[name] = window.open(uri, name, features);
    newwin[name].focus();
  }
}
