var stitchArray=new Array();var colorOptionArray=new Array();var logoOptionArray=new Array();var mjShoeSku="";var teamType="";var mjShoeImage="";var shoeColors=4;var colorToText=new Array();function mjGetLeathers(){var A=new AJAX();A.callService(baseURL+"services/MyJoysAjax.asmx","GetLeathers","gbSku="+parentSku)
}function ajaxGetLeathers(A){colorToText=A.split(":")}function mjTeamSelect(B,C){document.getElementById("mjTeamSelected").innerHTML='<TABLE><TR><TD><img src="http://images.acushnetgolf.com/is/image/myjoys/'+C+'?fmt=gif&hei=65&wid=65" width=75 height=75 border=0 Title="'+B+'"></TD><TD><div class="showOptionsButton"><A href="javascript:mjTeamUnSelect();"><img src="/images/creative/myjoys/2007-07_ShoeDesigner/buttonShowOtherOptions.gif" border=0 /></A></div><div class="clearer"></div></TD></TR></TABLE>';
var A=new AJAX();A.callService(baseURL+"services/MyJoysAjax.asmx","TeamSelection","TeamName="+B,"GBSku="+parentSku)}function ajaxTeamSelection(B){mjGetLeathers();hide_div("mjTeamOptions");show_div("mjTeamSelected");show_div("headerSelectColors");show_div("mjTeamColorOptions");
show_div("headerLeftLogo");show_div("mjTeamLeftOptions");show_div("headerRightLogo");show_div("mjTeamRightOptions");document.getElementById("mjTeamColorOptions").innerHTML=xmlValue(B,"colorOptions");document.getElementById("mjTeamLeftOptions").innerHTML=xmlValue(B,"logoOptions").replace(/%%foot%%/g,"Left");
document.getElementById("mjTeamRightOptions").innerHTML=xmlValue(B,"logoOptions").replace(/%%foot%%/g,"Right");document.getElementById("mjTeamStitchLeft").innerHTML=xmlValue(B,"stitchOptions").replace(/%%foot%%/g,"Left");document.getElementById("mjTeamStitchRight").innerHTML=xmlValue(B,"stitchOptions").replace(/%%foot%%/g,"Right");
stitchArray=xmlValue(B,"stitchArray").split("|");colorOptionArray=xmlValue(B,"colorOptionArray").split(":");for(var A=0;A<colorOptionArray.length;A++){mjTeamThumbUpdate(colorOptionArray[A])}logoOptionArray=xmlValue(B,"logoOptionArray").split("|");mjTeamSelectColor(colorOptionArray[0].replace(/\-/g,"|"));
mjTeamSelectLogo(logoOptionArray[0],xmlValue(B,"preselectLogoName"),"Left");mjTeamSelectLogo(logoOptionArray[0],xmlValue(B,"preselectLogoName"),"Right");mjTeamSelectStitch(stitchArray[0],"Left",xmlValue(B,"preselectStitchRgb"),xmlValue(B,"preselectStitchName"));
mjTeamSelectStitch(stitchArray[0],"Right",xmlValue(B,"preselectStitchRgb"),xmlValue(B,"preselectStitchName"));mjTeamUpdateImages()}function mjTeamUnSelect(){show_div("mjTeamOptions");hide_div("headerSelectColors");hide_div("mjTeamColorOptions");hide_div("headerLeftLogo");
hide_div("mjTeamLeftPersonalization");hide_div("mjTeamLeftOptions");hide_div("headerRightLogo");hide_div("mjTeamRightPersonalization");hide_div("mjTeamRightOptions");hide_div("mjTeamSelected");mjTeamUpdateImages()}function mjTeamSelectColor(B){for(var A=0;
A<colorOptionArray.length;A++){document.getElementById(colorOptionArray[A]+"LI").className="null"}document.getElementById("mjSelectedColor").value=B;document.getElementById(B.replace(/\|/g,"-")+"LI").className="selectedShoe";mjTeamUpdateImages()}function mjTeamSelectLogo(C,A,D){for(var B=0;
B<logoOptionArray.length;B++){document.getElementById(D+logoOptionArray[B]).className="null"}document.getElementById(D+"Personalization").className="null";document.getElementById(D+C).className="selectedLogo";document.getElementById("mjSelected"+D).value=C+"|"+A;
if(C=="Personalization"){show_div("mjTeam"+D+"Personalization")}else{hide_div("mjTeam"+D+"Personalization")}mjTeamUpdateImages()}function mjTeamUnSelectStitch(B){for(var A=0;A<stitchArray.length;A++){document.getElementById(B+stitchArray[A]).className="null"
}}function mjTeamSelectStitch(A,D,C,B){mjTeamUnSelectStitch(D);document.getElementById(D+A).className="selectedStitch";document.getElementById("mjStitch"+D).value=A+" - "+B;document.getElementById("mjStitchRgb"+D).value=C;mjTeamUpdateImages()}function mjTeamUpdateImages(){var A=new Array();
var D="";var B="";var C=300;A=document.getElementById("mjSelectedColor").value.split("|");D="http://images.acushnetgolf.com/is/image/myjoys/"+mjShoeImage+"_template_pers?fmt=jpeg&wid="+C+"&$baseColor="+A[0]+"&$saddleColor="+A[1]+"&$laceColor="+A[2];B="http://images.acushnetgolf.com/is/image/myjoys/"+mjShoeImage+"_double_pers?wid="+C+"&$baseColor="+A[0]+"&$saddleColor="+A[1]+"&$laceColor="+A[2];
if(A.length>3){D+="&$accentColor="+A[3];B+="&$accentColor="+A[3]}D+="&$reflect=off";if(document.getElementById("mjSelectedLeft").value=="Personalization|"){B+="&$leftTextSmall="+document.getElementById("mjTeamLeftPersonalizationText").value+"&$threadColor="+document.getElementById("mjStitchRgbLeft").value
}else{if(document.getElementById("mjSelectedLeft").value.split("|")[0]!=""){B+="&$logoLeft="+document.getElementById("mjSelectedLeft").value.split("|")[0]}}if(document.getElementById("mjSelectedRight").value=="Personalization|"){B+="&$rightTextSmall="+document.getElementById("mjTeamRightPersonalizationText").value;
if(B.search("threadColor")==-1){B+="&$threadColor="+document.getElementById("mjStitchRgbRight").value}}else{if(document.getElementById("mjSelectedRight").value.split("|")[0]!=""){B+="&$logoRight="+document.getElementById("mjSelectedRight").value.split("|")[0]
}}document.getElementById("mjDynamicShoe").src=D;document.getElementById("mjDynamicShoeHeel").src=B;document.getElementById("imgText").value=D}function mjTeamThumbUpdate(D){var A=new Array();var C="";var B=70;A=D.split("-");if(A.length==3){C="http://images.acushnetgolf.com/is/image/myjoys/"+mjShoeImage+"_template_pers?bgc=0xA4A4A4&wid="+B+"&$baseColor="+A[0]+"&$saddleColor="+A[1]+"&$laceColor="+A[2]+"&$reflect=off"
}else{C="http://images.acushnetgolf.com/is/image/myjoys/"+mjShoeImage+"_template_pers?bgc=0xA4A4A4&wid="+B+"&$baseColor="+A[0]+"&$saddleColor="+A[1]+"&$laceColor="+A[2]+"&$accentColor="+A[3]+"&$reflect=off"}document.getElementById(D).src=C}var textBoxTest="";
function ValidateMyJoyText(B){var A=new AJAX();textBoxTest=B.id;A.callService(baseURL+"services/ProductAjax.asmx","ValidateMyJoyText","text="+B.value)}function ajaxValidateMyJoyText(A){if(A=="False"){document.getElementById(textBoxTest).value="";alert("We're sorry, but the monogram text you entered is not available to be embroidered. Please feel free to choose a different monogram.");
mjTeamUpdateImages()}}function mjAddToCart(A){redirect("/Cart.aspx?cartString="+document.getElementById("formQty").value+";"+A+";0;"+mjPersonalizationXml())}function mjPersonalizationXml(){colors=document.getElementById("mjSelectedColor").value.split("|");
var A="<MyJoyPersonalization>";A+="<Base_Color>"+getColor(colors[0])+"</Base_Color>";A+="<Saddle_Color>"+getColor(colors[1])+"</Saddle_Color>";if(colors.length>3){A+="<Accent_Color>"+getColor(colors[3])+"</Accent_Color>"}A+="<Lace_Color>"+getColor(colors[2])+"</Lace_Color>";
A+=mjPersonalizationPerShoe("Left");A+=mjPersonalizationPerShoe("Right");A+="</MyJoyPersonalization>";return A}function mjPersonalizationPerShoe(B){if(document.getElementById("mjSelected"+B).value=="Personalization|"){var A="<"+B+"_Shoe_Monogram>"+document.getElementById("mjTeam"+B+"PersonalizationText").value+"</"+B+"_Shoe_Monogram>";
A+="<"+B+"_Shoe_Monogram_Color>"+document.getElementById("mjStitch"+B).value+"</"+B+"_Shoe_Monogram_Color>";return A}else{return"<"+B+"_Shoe_Logo>"+document.getElementById("mjSelected"+B).value.split("|")[1]+"</"+B+"_Shoe_Logo>"}}function getColor(B){for(var A=0;
A<colorToText.length;A++){color=colorToText[A].split("|");if(color[0]==B){return color[1]}}return"Unknown color "+B}