function addToList(c,b,a){document.getElementById("shoplist_linktype").value=a;document.getElementById("additemtowishlistwrapper").style.display="none";document.getElementById("additemtoreorderlistwrapper").style.display="none";document.getElementById("additemtoshoplistwrapper").style.display="none";document.getElementById(b).style.display="";document.getElementById("additem_tolist").style.display="";if(a==400&&!$("additemtowishlist")){$("addnew_list").style.display=""}if(a==402&&!$("additemtoreorderlist")){$("addnew_list").style.display=""}if(a==401&&!$("additemtoshoplist")){$("addnew_list").style.display=""}if(a==401){document.getElementById("additemtoshoplistmisc").style.display=""}else{document.getElementById("additemtoshoplistmisc").style.display="none"}}function submitAddToList(){var g=$("addtocartformid").IID.value;var a=$("shoplist_linktype").value;var j=$("shoplist_seq").value;var i=1;var c=$("shoplist_name").value;var d=$("shoplist_comment").value;var b="";var f=document.getElementsByName("breedrecommendation");for(var h=0;h<f.length;h++){var e=f[h];if(e&&e.checked){if(b.length>0){b+=","+e.value}else{b=e.value}}}ajaxShopListAddItem(g,a,j,i,c,d,b);document.getElementById("additem_tolist").style.display="none";document.getElementById("addnew_list").style.display="none";document.getElementById("additemtowishlistwrapper").style.display="";document.getElementById("additemtoreorderlistwrapper").style.display="";document.getElementById("additemtoshoplistwrapper").style.display=""}function cancelAddToList(){if(document.getElementById("shoplist_comment")){document.getElementById("shoplist_comment").value=""}document.getElementById("additem_tolist").style.display="none";document.getElementById("addnew_list").style.display="none";document.getElementById("additemtowishlistwrapper").style.display="";document.getElementById("additemtoreorderlistwrapper").style.display="";document.getElementById("additemtoshoplistwrapper").style.display=""}function showAddNewList(a){clearSelects();Effect.BlindDown(a,{duration:0.4})}function specifyOtherBreeds(a){document.getElementById("pbreed").options[0].selected=true;Effect.BlindDown(a,{duration:0.4})}function updateListFields(a){document.getElementById("shoplist_seq").value=a;$("shoplist_name").value=""}function clearSelects(){if($("additemtowishlist")){$("additemtowishlist").selectedIndex=0}if($("additemtoreorderlist")){$("additemtoreorderlist").selectedIndex=0}if($("additemtoshoplist")){$("additemtoshoplist").selectedIndex=0}}function selectBreed(c){if(c.selectedIndex>0){var f=c.options[c.selectedIndex].value;var a=c.options[c.selectedIndex].text;var h=document.getElementById("breed_recommendation_table");var i=document.createElement("tr");var b=document.createElement("td");var g=document.createElement("input");var d=document.createTextNode(" ");var e=document.createTextNode(a);i.id="remove_"+f;b.className="body";b.setAttribute("style","color:white;");g.type="checkbox";g.className="body";g.setAttribute("style","color:white;");g.name="breedrecommendation";g.value=f;g.setAttribute("checked","true");g.setAttribute("onClick","removeRow(this, '"+f+"');");i.appendChild(b);b.appendChild(g);b.appendChild(d);b.appendChild(e);h.appendChild(i);document.getElementById("pbreed").options[0].selected=true}}function removeRow(e,a){if(!e.checked){var d="remove_"+a;var c=document.getElementById("breed_recommendation_table");var b=document.getElementById(d);alert("Parent : "+c+" for "+d+" childToRemove : "+b);c.removeChild(b)}};