// JavaScript Document function showPopup(btnObj,divName,index) { var pos=findPos(btnObj); var divObj=document.getElementById(divName); divObj.style.top=pos[1]-400; divObj.style.left=pos[0]-320; divObj.style.display='block'; var iframe = document.getElementById('if_'+divName); if(iframe != null) { var layer = document.getElementById(divName); iframe.style.display = 'block'; iframe.style.width = layer.offsetWidth; iframe.style.height = layer.offsetHeight; iframe.style.left = divObj.style.left; iframe.style.top = divObj.style.top; } if(userBrowser=='ie') { var ua = navigator.userAgent; var MSIEOffset = ua.indexOf("MSIE "); if (MSIEOffset != -1) { var browserVersion = parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset))); if (browserVersion < 6.5) { var selectObjArry=document.getElementsByTagName('select'); for(i=0;i' //formObj.getElementsByTagName('select')[1].disabled=true; if(colorDisplay == true || colorDisplay == 'true'){ document.getElementById('threadColorHeader').style.display = ''; document.getElementById('theradColorSelect').style.display = ''; document.getElementById('theradColorHide'+whchFrm).style.display = ''; }else{ document.getElementById('theradColorHide'+whchFrm).style.display = 'none'; document.getElementById('threadColorHeader').style.display = 'none'; document.getElementById('theradColorSelect').style.display = 'none'; document.getElementById('critterthreadcolor'+whchFrm).selectedIndex = 0; } } function changeType(whchProd,whchFrm,whchSelect) { var selectObj = document.getElementById(whchSelect+whchFrm); selectObj.options.selectedIndex = whchProd+1; } function rtrim(stringToTrim) { return stringToTrim.replace(/\s+$/,""); } function setmonoStyleFont(strdiamond,strclassic) { var monType=document.getElementById('monogramtype0'); if(monType.selectedIndex!=0){ if(monType.options[monType.selectedIndex].value=='CLASSIC_BLOCK'){ document.getElementById('monogramfontsize0').value = strclassic; }else if(monType.options[monType.selectedIndex].value=='DIAMOND_INSIGNIA'){ document.getElementById('monogramfontsize0').value = strdiamond; } } } function validFormMong(formNum){ var errorMsg=''; var formValid=true; if(document.getElementById('monoLocation'+formNum) && document.getElementById('monoLocation'+formNum) != null){ if(document.getElementById('monoLocation'+formNum).selectedIndex==0){ errorMsg+='Please choose a location.
'; formValid=false; } } var monType=document.getElementById('monogramtype'+formNum); var intFirst=document.getElementById('init_first'+formNum); var intMddl=document.getElementById('init_mid'+formNum); var intLast=document.getElementById('init_last'+formNum); if(monType.selectedIndex==0){ errorMsg+='Please choose a monogram style.
'; formValid=false; if(intMddl && intMddl != null){ if(rtrim(intFirst.value) == '' && rtrim(intMddl.value) == '' && rtrim(intLast.value) == ''){ errorMsg+='Please enter at least one initial.
'; formValid=false; } }else{//free text condition if(rtrim(intFirst.value) == ''){ errorMsg+='Please enter monogram text.
'; formValid=false; } } }else{ //in case of free text if (intMddl!=null && intLast !=null){ if(monType[monType.selectedIndex].value=='CLASSIC_BLOCK'&&intFirst.selectedIndex==0&&intMddl.selectedIndex==0&&intLast.selectedIndex==0){ errorMsg+='Please choose at least one initial.
'; formValid=false; }else if(monType[monType.selectedIndex].value=='DIAMOND_INSIGNIA'&&(intFirst.selectedIndex==0||intMddl.selectedIndex==0||intLast.selectedIndex==0)){ errorMsg+='Please choose 3 initials for diamond insignia monogramming.
'; formValid=false; } }else { if(monType[monType.selectedIndex].value=='CLASSIC_BLOCK' && intFirst.value.length<=0){ errorMsg+='Please enter at least one initial.
'; formValid=false; }else if(monType[monType.selectedIndex].value=='DIAMOND_INSIGNIA' && intFirst.value.length != 3){ errorMsg+='Please enter 3 characters for diamond insignia monogramming.
'; formValid=false; } } } if(document.getElementById('threadcolor'+formNum).selectedIndex==0){ errorMsg+='Please choose a thread color.
'; formValid=false; } document.getElementById('monoErrorMsg'+formNum).innerHTML=errorMsg; document.getElementById('monoErrorMsg'+formNum).style.display='block'; document.location="#monoError"+formNum; return formValid; }//end of method validFormMong() function validFormCrit(formNum){ var errorMsg=''; var formValid=true; if(document.getElementById('crittertype'+formNum)){ if(document.getElementById('crittertype'+formNum).selectedIndex==0){ errorMsg+='Please choose a critter
';formValid=false } } if(document.getElementById('critterthreadcolor'+formNum)){ if(document.getElementById('theradColorHide'+formNum).style.display != 'none' && document.getElementById('critterthreadcolor'+formNum).selectedIndex==0){ errorMsg+='Please choose a critter color.
';formValid=false } } document.getElementById('critterErrorMsg'+formNum).innerHTML=errorMsg; document.getElementById('critterErrorMsg'+formNum).style.display='block'; document.location="#critError"+formNum; return formValid; } function openInfo(obj, index){ var newY = findPos(obj); var prodInfoDiv=document.getElementById('personalizationInfo'); var iframe = document.getElementById('personalizationInfoIF'); prodInfoDiv.style.left=newY[0]-144; prodInfoDiv.style.top=newY[1]-185; prodInfoDiv.style.display='block'; iframe.style.display = 'block'; iframe.style.left = prodInfoDiv.style.left; iframe.style.top = prodInfoDiv.style.top; iframe.style.height = prodInfoDiv.offsetHeight; iframe.style.width = prodInfoDiv.offsetWidth; } function closeInfoPopUp(divName, iframeName) { var divObj=document.getElementById(divName); var iframe=document.getElementById(iframeName); divObj.style.display='none'; iframe.style.display='none'; } function changeCritterThreadColor(imageName,whchProd,whchFrm){ if(whchProd>0){ var code_isthread_array = imageName.split("|"); changeCritterType(code_isthread_array[0],whchProd,whchFrm,code_isthread_array[1]); } } function toggleDesc(toggle, index) { var descDiv = document.getElementById('descDiv' + index); var descTD = document.getElementById('descTD' + index); var descTable = document.getElementById('descTable' + index); var descIF = document.getElementById('descIF' + index); descTable.style.width = descTD.offsetWidth; var newY = findPos(descTD); if (toggle == 'open') { descDiv.style.display='block'; var adjustLeft = 0; if(userBrowser=='ie') { adjustLeft = 2; } descDiv.style.left = newY[0] - adjustLeft; descDiv.style.top = newY[1]; descIF.style.display = 'block'; descIF.style.left = descDiv.style.left; descIF.style.top = descDiv.style.top; descIF.style.height = descDiv.offsetHeight; descIF.style.width = descDiv.offsetWidth; } if (toggle == 'close') { descDiv.style.display='none'; descIF.style.display='none'; } }