function changePage(){if(parent.top.location!=document.location){parent.location=document.location}}function formatCode(K){var M="";var C=1;var J=2;var F=C;while(K.length>0){var D,Q;if(F==J){var B=K.indexOf(">");var H=(K.substring(0,1)=="/");if(B!=-1){M+="&gt;";if(H&&D||Q){M+="<br>"}K=K.substring(B+1,K.length);F=C}else{M+=K+"";K=""}}else{var E=K.indexOf("<");var I=new Array("H1","H2","H3","H4","H5","H6","BLOCKQUOTE","TITLE","BODY","META","HEAD","SCRIPT","FORM","ALERT");var P=new Array("META","HTML","BODY","HEAD");if(E!=-1){var A;var N;var L=K.indexOf(">");var R=K.indexOf(" ");var G=K.indexOf("/");D=false;Q=false;if(G!=-1&&G==E+1){N=G+1}else{N=E+1}if(R!=-1&&R>E&&R<L){A=K.substring(N,R)}else{if(L!=-1){A=K.substring(N,L)}else{A=K.substring(N,K.length)}}for(var O=0;O<I.length;O++){if(I[O]==A){D=true;break}}for(var O=0;O<P.length;O++){if(P[O]==A){Q=true;break}}M+=K.substring(0,E)+"&lt;";K=K.substring(E+1,K.length);F=J}else{M+=K;K=""}}}return M}function BrowserCheck(){var A=navigator.appName;if(A=="Netscape"){this.b="ns"}else{if(A=="Microsoft Internet Explorer"){this.b="ie"}else{this.b=A}}this.v=parseInt(navigator.appVersion);this.ns=(this.b=="ns"&&this.v>=4);this.ns4=(this.b=="ns"&&this.v==4);this.ns6=(this.b=="ns"&&this.v==5);this.ns7=(this.b=="ns"&&this.v==6);this.ns8=(this.b=="ns"&&this.v==7);this.ie=(this.b=="ie"&&this.v>=4);this.ie4=(navigator.userAgent.indexOf("MSIE 4")>0);this.ie5=(navigator.userAgent.indexOf("MSIE 5")>0);this.ie6=(navigator.userAgent.indexOf("MSIE 6")>0);this.ie7=(navigator.userAgent.indexOf("MSIE 7")>0);if(this.ie5){this.v=5}var B=navigator.platform;this.mac=(navigator.appVersion.indexOf("Mac")!=-1);this.win=(navigator.appVersion.indexOf("Win")!=-1);this.otherOS=(!this.mac||!this.win);this.min=(this.ns||this.ie);this.ie5w=(this.ie5&&this.win)}is=new BrowserCheck();function setLayerText(objName,x,newText){if((obj=MM_findObj(objName))!=null){with(obj){if(is.ns4){document.write('<span class="bodyPlain">'+unescape(newText)+"</span>");document.close()}else{innerHTML=unescape(newText)}}}}function MM_findObj(E,D){var C,B,A;if(!D){D=document}if((C=E.indexOf("?"))>0&&parent.frames.length){D=parent.frames[E.substring(C+1)].document;E=E.substring(0,C)}if(!(A=D[E])&&D.all){A=D.all[E]}for(B=0;!A&&B<D.forms.length;B++){A=D.forms[B][E]}for(B=0;!A&&D.layers&&B<D.layers.length;B++){A=MM_findObj(E,D.layers[B].document)}if(!A&&document.getElementById){A=document.getElementById(E)}return A}function clearIngredient(A){A.value=""}function clearIngredient5(){document.form1.text1.value=""}function clearEmail(){document.email.emailAddress.value=""}function clearUser(){document.user.loginName.value=""}function clearAns(){document.registration.challengeAns.value=""}function clearAns2(){document.challenge.challengeans.value=""}function clearYear(){document.registration.dobYYYY.value=""}if(is.ns4){var origWidth=window.innerWidth;var origHeight=window.innerHeight}function restorePage(){if(is.ns4){if(origWidth!=window.innerWidth||origHeight!=window.innerHeight){history.go(0)}}}function KeywordSearch(){if(document.keywordSearch.u2.value==""){if(is.ns4){setLayerText("error","","Please enter a keyword or ingredient")}else{setLayerText("error","","Please enter a keyword or ingredient")}}else{document.keywordSearch.u2.value=formatCode(document.keywordSearch.u2.value);document.keywordSearch.submit()}}function ByTypeSearch(){valMain=document.frmRecipeByType.cboMain.value;valSecond=document.frmRecipeByType.cboSecond.value;if(valMain==null||valMain=="0"||valMain==""){if(is.ns4){setLayerText("errorSearch","","Please make a selection")}else{setLayerText("errorSearch","","Please make a selection")}}else{if(valMain==null||valMain=="0"){valMain=""}if(valSecond==null||valSecond=="0"){valSecond=""}document.location="http://www.kraftfoods.com/main.aspx?s=recipe&m=recipe/knet_recipe_grid&u1=bytype&u2="+valMain+"*"+valSecond}}function ByNutritionSearch(){valMain=document.frmRecipeByType.cboMain.value;valSecond=document.frmRecipeByType.cboSecond.value;if(valMain==null||valMain=="0"||valMain==""){if(is.ns4){setLayerText("errorSearch","","Please make a selection")}else{setLayerText("errorSearch","","Please make a selection")}}else{if(valMain==null||valMain=="0"){valMain=""}if(valSecond==null||valSecond=="0"){valSecond=""}strDropDown1=escape(document.frmRecipeByType.cboMain.options[document.frmRecipeByType.cboMain.selectedIndex].text);strDropDown2=escape(document.frmRecipeByType.cboSecond.options[document.frmRecipeByType.cboSecond.selectedIndex].text);if(strDropDown1==unescape("Select one")){strDropDown1=""}if(strDropDown2==unescape("Select one")){strDropDown2=""}document.location="http://www.kraftfoods.com/main.aspx?s=recipe&m=recipe/knet_recipe_grid&u1=bynutrition&u2="+valMain+"*"+valSecond+"**"+strDropDown1+"*"+strDropDown2+"*"}}function mmInitialize(J,D,B,H,F,A,C,G){var I;clearList(J.cboMain);addElement(J.cboMain,H,0);if(A=="true"){for(var E=0;E<mmMain.length;E++){if(mmMain[E]){I=mmMain[E].split("#");addElement(J.cboMain,I[0],I[1])}}}else{for(var E=0;E<mmMkU.length;E++){if(mmMkU[E]){I=mmMkU[E].split("#");addElement(J.cboMain,I[0],I[1])}}}if(D){setDefaultByText(J.cboMain,D);mmChangeMain(J,A,F);if(B){setDefaultByText(J.cboSecond,B)}}else{setDefaultByValue(document.frmRecipeByType.cboMain,C);mmChangeMain(J,A,F,G)}}function mmChangeMain(F,H,D,C){if(H=="true"){var B=mmSecond[F.cboMain.options[F.cboMain.selectedIndex].value]}else{var B=mmMdU[F.cboMain.options[F.cboMain.selectedIndex].value]}clearList(F.cboSecond);addElement(F.cboSecond,D,0);if(B){var A=B.split("|");for(var E=0;E<A.length;E++){if(A[E]){var G=A[E].split("#");addElement(F.cboSecond,G[0],G[1])}}F.cboSecond.disabled=false}else{F.cboSecond.disabled=true}setDefaultByValue(document.frmRecipeByType.cboSecond,C)}function clearList(B){var A=0;var C=B.options;for(A=C.length;A>=0;--A){C[A]=null}B.disabled=true}function addElement(D,B,A){var E=D.options;var C;if(E.length<0){C=0}else{C=E.length}E[C]=new Option(B,A);D.disabled=false}function setDefaultByText(list,text_in){with(list){for(var i=0;i<(options.length);i++){if(options[i].text==text_in){selectedIndex=i;return }}}}function setDefaultByValue(list,value_in){with(list){for(var i=0;i<(options.length);i++){if(options[i].value==value_in){selectedIndex=i;return }}}}function GetResults(){document.frmRecipeByType.submit()}function SearchGo(B,A){window.status="Searching for: "+B;document.frmSearch.action="http://www.kraftfoods.com/main.aspx?s=search&m=search/knet_search_main&u1=search&u2="+escape(formatCode(B));document.frmSearch.submit()}function SearchGoCat(C,A,B){window.status="Searching for: "+C;document.frmSearch.action="http://www.kraftfoods.com/main.aspx?s=search&m=search/knet_search_cat&u1=search&u2="+escape(formatCode(C))+"&u3="+escape(A);document.frmSearch.submit()}function DoSearchTop(C,B,A){if(is.ns4){document.captureEvents(Event.KEYPRESS)}if(is.ns4){if(e.which==13){if(A!=""){SearchGoCat(strKey,A,B)}else{SearchGo(C,B)}}}else{if(event.keyCode==13){if(A!=""){SearchGoCat(strKey,A,B)}else{SearchGo(C,B)}}}};