function addItemToCart(formId,e,itemId){var form=document.getElementById(formId);if(form){form.IID.value=itemId;}form.submit();}var lastDisplayedDiv=0;function setShipMethod(e){document.getElementById("shipmethod_"+getIndex(e)).checked="true";}function getIndex(e){var arrTmp=e.id.split("_");if(arrTmp.length<2){return false;}return arrTmp[1];}function GetAnswerDiv(objQuestionDiv){var strFaqId=getIndex(objQuestionDiv);var strAnswerId="answer_"+strFaqId;var objAnswer=document.getElementById(strAnswerId);if(!objAnswer){return false;}return objAnswer;}function ToggleAnswer(objDiv){var objAnswerDiv=GetAnswerDiv(objDiv);if(!objAnswerDiv){return false;}if(objAnswerDiv.style.display=="none"){if(lastDisplayedDiv){lastDisplayedDiv.style.display="none";}objAnswerDiv.style.display="block";lastDisplayedDiv=objAnswerDiv;}else{objAnswerDiv.style.display="none";}}function win_Pop(URL,winName,features){var wp=/width=\d+/g;var hp=/height=\d+/g;var np=/\d+/g;var heightchunk=features.match(hp);var widthchunk=features.match(wp);var height="";var width="";if(heightchunk!=null&&heightchunk[0]!=null){height=heightchunk[0].match(np);if(height!=null&&height[0]!=null){height=height[0];}else{height="";}}if(widthchunk!=null&&widthchunk[0]!=null){width=widthchunk[0].match(np);if(width!=null&&width[0]!=null){width=width[0];}else{width="";}}var win=window.open(URL,winName,features);if(height.length>0&&width.length>0){win.resizeTo(width,height);}win.focus();}function popUp(url){sealWin=window.open(url,"win","toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450");self.name="mainWin";}function verifyEmailNoForm(elementID){var isEmailValid=true;var emailEl=document.getElementById(elementID);if(!emailEl){emailEl=document.getElementById("emailAddress");}if(!emailEl){emailEl=document.getElementById("email");}if(emailEl){isEmailValid=checkEmail(emailEl.value);if(!isEmailValid){alert("You have entered an invalid email address. Please try again.");emailEl.select();}}return(isEmailValid);}function verifyEmail(form,submitForm){var isEmailValid=true;var email=form.emailAddress;if(!email&&form.email){email=form.email;}if(email){isEmailValid=checkEmail(email.value);if(!isEmailValid){alert("You have entered an invalid email address. Please try again.");email.select();}else{if(submitForm){form.submit();}}}return isEmailValid;}function checkEmail(email){if((email.indexOf(" ")>-1)||(email.indexOf("@")<0)||((email.charAt(email.length-5)!=".")&&(email.charAt(email.length-4)!=".")&&(email.charAt(email.length-3)!="."))){return false;}else{return true;}}
