//- DirtyTool -// function DirtyTool(cTool) { var oTool = document.getElementById('Tool' + cTool); if (oTool != null) { oTool.IsDirty = true; var c = new String(oTool.onerror); oTool.src = c.match(/.*\"(.*)\".*/)[1]; oTool.onmouseover = null; oTool.onmouseout = null; } } //- CopyBillingToShipping -// function CopyBillingToShipping(oForm) { oForm['ShippingName'].value = oForm.BillingName.value; oForm['ShippingAttention'].value = oForm.BillingAttention.value; oForm['ShippingStreet'].value = oForm.BillingStreet.value; oForm['ShippingStreet2'].value = oForm.BillingStreet2.value; oForm['ShippingCity'].value = oForm.BillingCity.value; var cState = oForm.BillingState.value; var o = oForm['ShippingState']; for (var h = 0; h < o.options.length; h++) { if (o.options[h].value == cState) { oForm['ShippingState'].selectedIndex = h; } } oForm['ShippingZip'].value = oForm.BillingZip.value; // oForm['ShippingPhone'].value = null; } //- CopyShippingToBilling -// function CopyShippingToBilling(oForm) { oForm['BillingStreet'].value = oForm.Street.value; oForm['BillingStreet2'].value = oForm.Street2.value; oForm['BillingCity'].value = oForm.City.value; var cState = oForm.State.value; var o = oForm['BillingState']; for (var h = 0; h < o.options.length; h++) { if (o.options[h].value == cState) { oForm['BillingState'].selectedIndex = h; } } oForm['BillingZip'].value = ExportZip(oForm.Zip.value); oForm['BillingEmail'].value = oForm.Email.value; oForm['BillingPhone'].value = ExportFon(oForm.Phone.value); } //- IfEnterAction -// function IfEnterAction(oEvent, oForm, cAction, cSelId){ if ((EventKeyCode(oEvent) == 13) || (EventKeyCode(oEvent) == 3)) { oForm.Action.value = cAction; oForm.SelId.value = cSelId; oForm.submit(); return false; } return true; } //- IfEnterScript -// function IfEnterScript(oEvent, cScript) { if ((EventKeyCode(oEvent) == 13) || (EventKeyCode(oEvent) == 3)) { eval(cScript); return false; } return true; } //- EventKeyCode -// function EventKeyCode(oEvent) { return ((oEvent != null) && (oEvent.which != null) ? oEvent.which : event.keyCode); } //- ExportZip -// function ExportZip(cStream) { var cZip = cStream.replace(/\?/g, ''); return cZip; } //- ExportFon -// function ExportFon(cStream) { var cFon = ''; if (cStream.length >= 10) { cFon = cStream.substr(0, 3) + '-' + cStream.substr(3, 3) + '-' + cStream.substr(6, 4) if ((cStream.length == 15) && (cStream.substr(10, 5) != '?????')) { cFon += ' x' + cStream.substr(10, 5).replace('?', '') } } return cFon; } //- Console_AddRemove -// function Console_AddRemove(oFromSet, oToSet, bIsAll) { //+ unselect for (var hOption = 0; hOption < oToSet.length; hOption++) { oToSet.options[hOption].selected = false; } //+ move for (hOption = oFromSet.length; hOption != 0; hOption--) { if ((bIsAll == true) || (oFromSet.options[hOption - 1].selected == true)) { oToSet.options[oToSet.length] = new Option(oFromSet.options[hOption - 1].text, oFromSet.options[hOption - 1].value, false, true); oFromSet.options[hOption - 1] = null; } } } //- Console_Pack -// function Console_Pack(oSet, oField) { var cPack = ''; for (var hOption = 0; hOption < oSet.length; hOption++) { cPack += ',' + oSet.options[hOption].value; } oField.value = cPack.substring(1); } //- PrintThis -// function PrintThis() { var ua = navigator.userAgent.toLowerCase(); var is_mac = ua.indexOf('mac') > 0; if (is_mac) { alert('To print:\n\nUse Command + P. on your keyboard\n') } else { print(); } } //- ShowItem -// function ShowItem(cKey, cTypeId, nMax) { var cRowStyleType = 'table-row'; if (navigator.appName == 'Microsoft Internet Explorer') { cRowStyleType = 'block'; } var nCount = 0; if ((document.getElementById(cKey).value != null) && (document.getElementById(cKey).value != '')) { nCount = document.getElementById(cKey).value; } for (i=1; i <= nMax; i++) { if (i <= nCount) { document.getElementById(cTypeId + i).style.display = cRowStyleType; } else { document.getElementById(cTypeId + i).style.display = 'none'; if (cTypeId == 'Guest') { if (document.getElementById('Guest_FirstName' + i) != null) { document.getElementById('Guest_FirstName' + i).value = ''; } if (document.getElementById('Guest_LastName' + i).value != null) { document.getElementById('Guest_LastName' + i).value = ''; } if (document.getElementById('BadgeName_Guest' + i).value != null) { document.getElementById('BadgeName_Guest' + i).value = ''; } } if (cTypeId == 'Children') { if (document.getElementById('Children_FirstName' + i).value != null) { document.getElementById('Children_FirstName' + i).value = ''; } if (document.getElementById('Children_LastName' + i).value != null) { document.getElementById('Children_LastName' + i).value = ''; } if (document.getElementById('Children_Age' + i).value != null) { document.getElementById('Children_Age' + i).value = ''; } if (document.getElementById('BadgeName_Children' + i).value != null) { document.getElementById('BadgeName_Children' + i).value = ''; } } } } } //- ShowItemField -// function ShowItemField(cKey, bIsShow) { var cRowStyleType = 'table-row'; if (navigator.appName == 'Microsoft Internet Explorer') { cRowStyleType = 'block'; } if (bIsShow == true) { document.getElementById(cKey).style.display = cRowStyleType; } else { document.getElementById(cKey).style.display = 'none'; } } //- ShowDogwoodItemField -// function ShowDogwoodItemField(cKey, bIsShow, cFieldName) { var cRowStyleType = 'table-row'; if (navigator.appName == 'Microsoft Internet Explorer') { cRowStyleType = 'block'; } if ((bIsShow == true) && (document.getElementById(cFieldName).value == 'True')) { document.getElementById(cKey).style.display = cRowStyleType; } else { document.getElementById(cKey).style.display = 'none'; } } //- ShowGolfItemField -// function ShowGolfItemField(cKey, bIsShow, cFieldName) { var cRowStyleType = 'table-row'; if (navigator.appName == 'Microsoft Internet Explorer') { cRowStyleType = 'block'; } if ((bIsShow == true) && (document.getElementById(cFieldName).value == 'True')) { document.getElementById(cKey).style.display = cRowStyleType; if ((cKey == 'Day3ClubRental_Member') || (cKey == 'Day3ClubRental_Guest1') || (cKey == 'Day3ClubRental_Guest2')) { document.getElementById('Day3ClubRental_Label').style.display = cRowStyleType; } if ((cKey == 'Day3IsRide_Member') || (cKey == 'Day3IsRide_Guest1') || (cKey == 'Day3IsRide_Guest2')) { document.getElementById('Day3IsRide_Label').style.display = cRowStyleType; } if (document.getElementById('Day3GolferName_Member').value == 'True') { document.getElementById('Day3Member_FoursomeName').style.display = cRowStyleType; } } else { document.getElementById(cKey).style.display = 'none'; if (document.getElementById('Day3GolferName_Member').value == 'False') { document.getElementById('Day3Member_FoursomeName').style.display = 'none'; } } }