

        function IsNumericKey(e,elem){
            var currentText = elem.value;
            if(window.event) // MSIE
            {
                keynum = e.keyCode;
            }else if(e.which) // Netscape/Firefox/Opera
            {
                keynum = e.which;
            }
            if((keynum >= 48 && keynum <= 57)      // allow numeric keys
                || (keynum == 45 && currentText == '') // allow '-' only if it's the first char
                || (keynum == 8) || (keynum == 127)){  // allow enter and delete and backspace keys
                   return true;  
            }
            return false;
        }
        
        function IsNumericKeyWithoutEnter(e,elem){
            var currentText = elem.value;
            if(window.event) // MSIE
            {
                keynum = e.keyCode;
            }else if(e.which) // Netscape/Firefox/Opera
            {
                keynum = e.which;
            }
            if((keynum >= 48 && keynum <= 57)      // allow numeric keys
                || (keynum == 45 && currentText == '') // allow '-' only if it's the first char
                || (keynum == 127)){  // allow delete and backspace keys
                return true;  
            }
            return false;
        }
        
        function RunSearchOnEnterPressed(btnSearchId){
            var keyCode = event.which ? event.which : event.keyCode;
            
            if (keyCode == 13) {
                // disable the default button focus on the login OK button
                document.forms[0].onkeypress = function() {};
                // run the search
                document.getElementById(btnSearchId).click();
                return false;
            }
            return true;
        }

        var dontSwap = false;
       
        function MM_preloadImages() { //v3.0
          var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
            var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
        }
        function bbodyonload()
        {
MM_preloadImages("images/nav/Home_38ON.jpg",
"images/nav/Home_40ON.jpg",
"images/nav/Home_42ON.jpg",
"images/nav/Home_44On.jpg",
"images/nav/Home_48ON.jpg",
"images/nav/Home_25On.jpg",
"images/nav/Home_27On-.jpg",
"images/nav/Home_29On.jpg",
"images/nav/Home_54ON.jpg",
"images/nav/Home_52ON.jpg",
"images/nav/Home_50ON.jpg",
"images/nav/Home_46ON.jpg",
"images/nav/Home_31On.jpg",
"images/nav/inter01_off_on.jpg",
"images/nav/bt_productsOn.jpg",
"images/nav/inter02_on_off.jpg",
"images/nav/inter02_off_on.jpg",
"images/nav/bt_recipesOn.jpg",
"images/nav/inter03_on_off.jpg",
"images/nav/inter03_off_on.jpg",
"images/nav/bt_insightsOn.jpg",
"images/nav/inter04_on_off.jpg",
"images/nav/inter04_off_on.jpg",
"images/nav/bt_discoveryOn.jpg",
"images/nav/inter05_on_off.jpg",
"images/nav/inter05_off_on.jpg",
"images/nav/bt_bizsolutionOn.jpg",
"images/nav/inter06_off_on.jpg",
"images/nav/bt_pressOn.jpg",
"images/nav/inter07_on_off.jpg",
"images/nav tab/tabnav_productOn.jpg",
"images/nav tab/tabnav_preparationOn.jpg",
"images/nav tab/tabnav_nutritionOn.jpg",
"images/nav tab/tabnav_casepackOn.jpg",
"images/nav tab/tabnav_ingredientsOn.jpg",
"images/nav/bt_homeOn.jpg",
"images/nav/inter01_on_off.jpg");
        }
        
        //v3.0
        function MM_swapImgRestore() { 
          var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
        }
        //v4.01
        function MM_findObj(n, d) { 
          var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
            d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
          if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
          for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
          if(!x && d.getElementById) x=d.getElementById(n); return x;
        }
        //v3.0
        function MM_swapImage() { 
          var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
           if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
        }
        //v3.0
        function MM_goToURL() { 
          var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
          for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
        }
        
        function myImageSwap(htmlElement)
        {
            var a;
            if (dontSwap)
            { 
                dontSwap=false;
                return;
            }
            a = htmlElement.src.replace("On.jp", "Off.jp");
            if (htmlElement.src == a)
                a = htmlElement.src.replace("Off.jp", "On.jp");
            htmlElement.src = a;        
        }
        
        function ShowOneChild(ParentID, ChildID, ImgButton)//of id-ed grandchildren of ParentID, ChildrenID is the only one displayed the rest are hidden
        {
            var targetElement;
            var idOfHeaderButton;
            /*
			if (document.getElementById('Protein')) document.getElementById('Protein').src = document.getElementById('Protein').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Ethnic')) document.getElementById('Ethnic').src = document.getElementById('Ethnic').src.replace("On.jp", "Off.jp");
			if (document.getElementById('DayTime')) document.getElementById('DayTime').src = document.getElementById('DayTime').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Dietary')) document.getElementById('Dietary').src = document.getElementById('Dietary').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Equipment')) document.getElementById('Equipment').src = document.getElementById('Equipment').src.replace("On.jp", "Off.jp");
			
			if (document.getElementById('product')) document.getElementById('product').src = document.getElementById('product').src.replace("On.jp", "Off.jp");
			if (document.getElementById('preparation')) document.getElementById('preparation').src = document.getElementById('preparation').src.replace("On.jp", "Off.jp");
			if (document.getElementById('nutrition')) document.getElementById('nutrition').src = document.getElementById('nutrition').src.replace("On.jp", "Off.jp");
			if (document.getElementById('casepack')) document.getElementById('casepack').src = document.getElementById('casepack').src.replace("On.jp", "Off.jp");
			if (document.getElementById('ingredients')) document.getElementById('ingredients').src = document.getElementById('ingredients').src.replace("On.jp", "Off.jp");
			
			if (document.getElementById('Category')) document.getElementById('Category').src = document.getElementById('Category').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Segment')) document.getElementById('Segment').src = document.getElementById('Segment').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Brand')) document.getElementById('Brand').src = document.getElementById('Brand').src.replace("On.jp", "Off.jp");
			*/
			/*Julie ADD*/
			if (document.getElementById('Daypart')) document.getElementById('Daypart').src = document.getElementById('Daypart').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Mealpart')) document.getElementById('Mealpart').src = document.getElementById('Mealpart').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Tips')) document.getElementById('Tips').src = document.getElementById('Tips').src.replace("On.jp", "Off.jp");
			if (document.getElementById('Brands')) document.getElementById('Brands').src = document.getElementById('Brands').src.replace("On.jp", "Off.jp");
			
            for (i=0; i<5;i++)
            {
				if (document.getElementById('dCat_' + i)) {
					document.getElementById('dCat_' + i).style.display = "none"; 
				}
			}
			//alert(ImgButton);
            document.getElementById(ChildID).style.display = "block";
            ImgButton.src = ImgButton.src.replace("Off.jp", "On.jp");
        }


function DisplaySpan(pSpanId){

    if(document.getElementById(pSpanId) != null){
        if(document.getElementById(pSpanId).style.display == 'none'){
            document.getElementById(pSpanId).style.display = 'block';
        }else{
            document.getElementById(pSpanId).style.display = 'none'
        }
    }
}
