var gIndex=undefined;var gEvent=undefined;var gSavedShoesForm="savedShoesForm";var gKitbagId="kitbagId";function imageTagOver(D){var A=document.getElementById(D).src;var C=A.substring(A.lastIndexOf("."),A.length);var B=A.substring(0,A.lastIndexOf("."))+"_over"+C;document.getElementById(D).src=B}function imageTagOut(D){var A=document.getElementById(D).src;var C=A.substring(A.lastIndexOf("."),A.length);if(A.substring(0,A.lastIndexOf("_")).length>0){var B=A.substring(0,A.lastIndexOf("_"))+C;document.getElementById(D).src=B}}var channelId="";function validatePrint(A,C){if(navigator.cookieEnabled){channelId=C;var B=new Ajax.Request(bnm_context_root+"/PrintAction.action?validatePrint=&kitbagId="+A+"&time="+new Date()+"",{onComplete:populateOverlay})}else{wm_Panel.show("ov_error_cookie")}}function populateOverlay(D){var A=D.responseXML;var B=A.getElementsByTagName("overlayOrId")[0].childNodes[0].nodeValue;var E=A.getElementsByTagName("message")[0].childNodes[0].nodeValue;var C=A.getElementsByTagName("exception")[0].childNodes[0].nodeValue;if(C=="SessionTimeOut"){window.location.href=E;return false}if(C!="KitbagNotExistException"&&C!="ModelNotExistException"){window.open(bnm_context_root+"/PrintAction.action?channelId="+channelId+"&srcPage=savedDesigns","","top=0,left=0,height="+(screen.height-80)+",width="+(screen.width-10)+",toolbar=no,status=yes,scrollbars=yes,resizable=yes")}if(B=="ov_prompt_option"){window.scrollTo(0,0);document.getElementById("ov_prompt_option_msg").innerHTML="";showMessageForChecksOnAccount(E);wm_Panel.show(B)}}function showMessageForChecksOnAccount(C){var A=bnm_context_root+"/SendToFriend.action";var B="showMessageForChecks=&conflictMessageKey="+C+"&closeFunctions="+escape("window.location.reload(true);");new Ajax.Updater("ov_prompt_option_msg",A,{method:"post",parameters:B})}function fnConfirmRemove(B,A){setGlobal(B,A);var C=new Ajax.Request(bnm_context_root+"/RemoveFromKitbag.action?deleteKitbag&time="+new Date()+"",{onComplete:showDeleteOverlay})}function showDeleteOverlay(C){var B=C.responseXML;if((B!=null)&&(B.getElementsByTagName("response").length!=0)){var A=B.getElementsByTagName("result")[0].childNodes[0].nodeValue;if(A=="sessionTimeOut"){var D=B.getElementsByTagName("data")[0].childNodes[0].nodeValue;window.location.href=D}else{wm_Panel.show("ov_confirmDelete")}}}function setGlobal(B,A){gIndex=A;gEvent=B}function unsetGlobal(){gIndex=undefined;gEvent=undefined}function fnRemoveItem(){if(navigator.cookieEnabled){var C=getGlobalUrl();var A=getElementValueFromForm(gIndex,gKitbagId);C=C+"&kitbagId="+A;var D=gSavedShoesForm+"["+gIndex+"]";var B=document.forms[D];B.action=C;unsetGlobal();B.submit()}else{wm_Panel.hide("ov_confirmDelete");wm_Panel.show("ov_error_cookie")}}function getGlobalUrl(){if(gEvent){var C=gSavedShoesForm+"["+gIndex+"]";var A=document.forms[C];var B=A.action;B+="?"+gEvent}return B}function getElementValueFromForm(B,F){var E;var C;if(B==-1){B=gIndex}var D=gSavedShoesForm+"["+B+"]";var A=document.forms[D];for(i=0;i<A.length;i++){C=A.elements[i].name.toUpperCase();if(C.match(F.toUpperCase())!=null){E=A.elements[i].value;break}}return E};
