1var i4w_cportal_array_countries = new Array(); 2i4w_cportal_array_countries [0] = {ccode: "US", cname: "United States", cstates: true, czip: "GRP-US"}; 3i4w_cportal_array_countries [1] = {ccode: "CA", cname: "Canada", cstates: true, czip: "GRP-CA"}; 4i4w_cportal_array_countries [2] = {ccode: "AU", cname: "Australia", cstates: true, czip: "none"}; 5i4w_cportal_array_countries [3] = {ccode: "AF", cname: "Afghanistan", cstates: false, czip: "none"}; 6i4w_cportal_array_countries [4] = {ccode: "AL", cname: "Albania", cstates: false, czip: "GRP-4"}; 7i4w_cportal_array_countries [5] = {ccode: "DZ", cname: "Algeria", cstates: false, czip: "GRP-5"}; 8i4w_cportal_array_countries [6] = {ccode: "AS", cname: "American Samoa", cstates: false, czip: "GRP-US"}; 9i4w_cportal_array_countries [7] = {ccode: "AD", cname: "Andorra", cstates: false, czip: "none"}; 10i4w_cportal_array_countries [8] = {ccode: "AO", cname: "Angola", cstates: false, czip: "none"}; 11i4w_cportal_array_countries [9] = {ccode: "AI", cname: "Anguilla", cstates: false, czip: "none"}; 12i4w_cportal_array_countries [10] = {ccode: "AQ", cname: "Antarctica", cstates: false, czip: "none"}; 13i4w_cportal_array_countries [11] = {ccode: "AG", cname: "Antigua and Barbuda", cstates: false, czip: "none"}; 14i4w_cportal_array_countries [12] = {ccode: "AR", cname: "Argentina", cstates: false, czip: "none"}; 15i4w_cportal_array_countries [13] = {ccode: "AM", cname: "Armenia", cstates: false, czip: "GRP-4"}; 16i4w_cportal_array_countries [14] = {ccode: "AW", cname: "Aruba", cstates: false, czip: "none"}; 17i4w_cportal_array_countries [15] = {ccode: "AT", cname: "Austria", cstates: false, czip: "GRP-4"}; 18i4w_cportal_array_countries [16] = {ccode: "AZ", cname: "Azerbaijan", cstates: false, czip: "none"}; 19i4w_cportal_array_countries [17] = {ccode: "BS", cname: "Bahamas", cstates: false, czip: "none"}; 20i4w_cportal_array_countries [18] = {ccode: "BH", cname: "Bahrain", cstates: false, czip: "none"}; 21i4w_cportal_array_countries [19] = {ccode: "BD", cname: "Bangladesh", cstates: false, czip: "none"}; 22i4w_cportal_array_countries [20] = {ccode: "BB", cname: "Barbados", cstates: false, czip: "none"}; 23i4w_cportal_array_countries [21] = {ccode: "BY", cname: "Belarus", cstates: false, czip: "none"}; 24i4w_cportal_array_countries [22] = {ccode: "BE", cname: "Belgium", cstates: false, czip: "GRP-4"}; 25i4w_cportal_array_countries [23] = {ccode: "BZ", cname: "Belize", cstates: false, czip: "none"}; 26i4w_cportal_array_countries [24] = {ccode: "BJ", cname: "Benin", cstates: false, czip: "none"}; 27i4w_cportal_array_countries [25] = {ccode: "BM", cname: "Bermuda", cstates: false, czip: "none"}; 28i4w_cportal_array_countries [26] = {ccode: "BT", cname: "Bhutan", cstates: false, czip: "none"}; 29i4w_cportal_array_countries [27] = {ccode: "BO", cname: "Bolivia", cstates: false, czip: "none"}; 30i4w_cportal_array_countries [28] = {ccode: "BA", cname: "Bosnia-Herzegovina", cstates: false, czip: "none"}; 31i4w_cportal_array_countries [29] = {ccode: "BW", cname: "Botswana", cstates: false, czip: "none"}; 32i4w_cportal_array_countries [30] = {ccode: "BV", cname: "Bouvet Island", cstates: false, czip: "none"}; 33i4w_cportal_array_countries [31] = {ccode: "BR", cname: "Brazil", cstates: false, czip: "none"}; 34i4w_cportal_array_countries [32] = {ccode: "IO", cname: "British Indian Ocean Territory", cstates: false, czip: "none"}; 35i4w_cportal_array_countries [33] = {ccode: "BN", cname: "Brunei Darussalam", cstates: false, czip: "none"}; 36i4w_cportal_array_countries [34] = {ccode: "BG", cname: "Bulgaria", cstates: false, czip: "GRP-4"}; 37i4w_cportal_array_countries [35] = {ccode: "BF", cname: "Burkina Faso", cstates: false, czip: "none"}; 38i4w_cportal_array_countries [36] = {ccode: "BI", cname: "Burundi", cstates: false, czip: "none"}; 39i4w_cportal_array_countries [37] = {ccode: "KH", cname: "Cambodia", cstates: false, czip: "GRP-5"}; 40i4w_cportal_array_countries [38] = {ccode: "CM", cname: "Cameroon", cstates: false, czip: "none"}; 41i4w_cportal_array_countries [39] = {ccode: "CV", cname: "Cape Verde", cstates: false, czip: "GRP-4"}; 42i4w_cportal_array_countries [40] = {ccode: "KY", cname: "Cayman Islands", cstates: false, czip: "none"}; 43i4w_cportal_array_countries [41] = {ccode: "CF", cname: "Central African Republic", cstates: false, czip: "none"}; 44i4w_cportal_array_countries [42] = {ccode: "TD", cname: "Chad", cstates: false, czip: "none"}; 45i4w_cportal_array_countries [43] = {ccode: "CL", cname: "Chile", cstates: false, czip: "none"}; 46i4w_cportal_array_countries [44] = {ccode: "CN", cname: "China", cstates: false, czip: "none"}; 47i4w_cportal_array_countries [45] = {ccode: "CX", cname: "Christmas Island", cstates: false, czip: "GRP-4"}; 48i4w_cportal_array_countries [46] = {ccode: "CC", cname: "Cocos (Keeling) Islands", cstates: false, czip: "GRP-4"}; 49i4w_cportal_array_countries [47] = {ccode: "CO", cname: "Colombia", cstates: false, czip: "none"}; 50i4w_cportal_array_countries [48] = {ccode: "KM", cname: "Comoros", cstates: false, czip: "none"}; 51i4w_cportal_array_countries [49] = {ccode: "CG", cname: "Congo", cstates: false, czip: "none"}; 52i4w_cportal_array_countries [50] = {ccode: "CK", cname: "Cook Islands", cstates: false, czip: "none"}; 53i4w_cportal_array_countries [51] = {ccode: "CR", cname: "Costa Rica", cstates: true, czip: "GRP-5"}; 54i4w_cportal_array_countries [52] = {ccode: "HR", cname: "Croatia", cstates: false, czip: "GRP-5"}; 55i4w_cportal_array_countries [53] = {ccode: "CU", cname: "Cuba", cstates: false, czip: "none"}; 56i4w_cportal_array_countries [54] = {ccode: "CY", cname: "Cyprus", cstates: false, czip: "GRP-4"}; 57i4w_cportal_array_countries [55] = {ccode: "CZ", cname: "Czech Republic", cstates: false, czip: "none"}; 58i4w_cportal_array_countries [56] = {ccode: "DK", cname: "Denmark", cstates: false, czip: "GRP-4"}; 59i4w_cportal_array_countries [57] = {ccode: "DJ", cname: "Djibouti", cstates: false, czip: "none"}; 60i4w_cportal_array_countries [58] = {ccode: "DM", cname: "Dominica", cstates: false, czip: "none"}; 61i4w_cportal_array_countries [59] = {ccode: "DO", cname: "Dominican Republic", cstates: false, czip: "GRP-5"}; 62i4w_cportal_array_countries [60] = {ccode: "TP", cname: "East Timor", cstates: false, czip: "none"}; 63i4w_cportal_array_countries [61] = {ccode: "EC", cname: "Ecuador", cstates: false, czip: "none"}; 64i4w_cportal_array_countries [62] = {ccode: "EG", cname: "Egypt", cstates: false, czip: "GRP-5"}; 65i4w_cportal_array_countries [63] = {ccode: "SV", cname: "El Salvador", cstates: false, czip: "GRP-4"}; 66i4w_cportal_array_countries [64] = {ccode: "GQ", cname: "Equatorial Guinea", cstates: false, czip: "none"}; 67i4w_cportal_array_countries [65] = {ccode: "ER", cname: "Eritrea", cstates: false, czip: "none"}; 68i4w_cportal_array_countries [66] = {ccode: "EE", cname: "Estonia", cstates: false, czip: "GRP-5"}; 69i4w_cportal_array_countries [67] = {ccode: "ET", cname: "Ethiopia", cstates: false, czip: "none"}; 70i4w_cportal_array_countries [68] = {ccode: "FK", cname: "Falkland Islands", cstates: false, czip: "none"}; 71i4w_cportal_array_countries [69] = {ccode: "FO", cname: "Faroe Islands", cstates: false, czip: "GRP-3"}; 72i4w_cportal_array_countries [70] = {ccode: "FJ", cname: "Fiji", cstates: false, czip: "none"}; 73i4w_cportal_array_countries [71] = {ccode: "FI", cname: "Finland", cstates: false, czip: "GRP-5"}; 74i4w_cportal_array_countries [72] = {ccode: "CS", cname: "Former Czechoslovakia", cstates: false, czip: "none"}; 75i4w_cportal_array_countries [73] = {ccode: "SU", cname: "Former USSR", cstates: false, czip: "none"}; 76i4w_cportal_array_countries [74] = {ccode: "FR", cname: "France", cstates: false, czip: "GRP-5"}; 77i4w_cportal_array_countries [75] = {ccode: "FX", cname: "France (European Territory)", cstates: false, czip: "GRP-5"}; 78i4w_cportal_array_countries [76] = {ccode: "GF", cname: "French Guyana", cstates: false, czip: "GRP-5"}; 79i4w_cportal_array_countries [77] = {ccode: "TF", cname: "French Southern Territories", cstates: false, czip: "GRP-5"}; 80i4w_cportal_array_countries [78] = {ccode: "GA", cname: "Gabon", cstates: false, czip: "none"}; 81i4w_cportal_array_countries [79] = {ccode: "GM", cname: "Gambia", cstates: false, czip: "none"}; 82i4w_cportal_array_countries [80] = {ccode: "GE", cname: "Georgia", cstates: false, czip: "GRP-4"}; 83i4w_cportal_array_countries [81] = {ccode: "DE", cname: "Germany", cstates: false, czip: "GRP-5"}; 84i4w_cportal_array_countries [82] = {ccode: "GH", cname: "Ghana", cstates: false, czip: "none"};
85i4w_cportal_array_countries [83] = {ccode: "GI", cname: "Gibraltar", cstates: false, czip: "none"}; 86i4w_cportal_array_countries [84] = {ccode: "GB", cname: "Great Britain", cstates: false, czip: "GRP-UK"}; 87i4w_cportal_array_countries [85] = {ccode: "GR", cname: "Greece", cstates: false, czip: "GRP-5"}; 88i4w_cportal_array_countries [86] = {ccode: "GL", cname: "Greenland", cstates: false, czip: "GRP-4"}; 89i4w_cportal_array_countries [87] = {ccode: "GD", cname: "Grenada", cstates: false, czip: "none"}; 90i4w_cportal_array_countries [88] = {ccode: "GP", cname: "Guadeloupe (French)", cstates: false, czip: "GRP-5"}; 91i4w_cportal_array_countries [89] = {ccode: "GU", cname: "Guam (USA)", cstates: false, czip: "GRP-US"}; 92i4w_cportal_array_countries [90] = {ccode: "GT", cname: "Guatemala", cstates: false, czip: "GRP-5"}; 93i4w_cportal_array_countries [91] = {ccode: "GN", cname: "Guinea", cstates: false, czip: "none"}; 94i4w_cportal_array_countries [92] = {ccode: "GW", cname: "Guinea Bissau", cstates: false, czip: "GRP-4"}; 95i4w_cportal_array_countries [93] = {ccode: "GY", cname: "Guyana", cstates: false, czip: "none"}; 96i4w_cportal_array_countries [94] = {ccode: "HT", cname: "Haiti", cstates: false, czip: "GRP-4"}; 97i4w_cportal_array_countries [95] = {ccode: "HM", cname: "Heard and McDonald Islands", cstates: false, czip: "GRP-4"}; 98i4w_cportal_array_countries [96] = {ccode: "HN", cname: "Honduras", cstates: false, czip: "GRP-5"}; 99i4w_cportal_array_countries [97] = {ccode: "HK", cname: "Hong Kong", cstates: false, czip: "none"}; 100i4w_cportal_array_countries [98] = {ccode: "HU", cname: "Hungary", cstates: false, czip: "GRP-4"}; 101i4w_cportal_array_countries [99] = {ccode: "IS", cname: "Iceland", cstates: false, czip: "GRP-3"}; 102i4w_cportal_array_countries [100] = {ccode: "IN", cname: "India", cstates: false, czip: "GRP-6"}; 103i4w_cportal_array_countries [101] = {ccode: "ID", cname: "Indonesia", cstates: false, czip: "GRP-5"}; 104i4w_cportal_array_countries [102] = {ccode: "IR", cname: "Iran", cstates: false, czip: "none"}; 105i4w_cportal_array_countries [103] = {ccode: "IQ", cname: "Iraq", cstates: false, czip: "GRP-5"}; 106i4w_cportal_array_countries [104] = {ccode: "IE", cname: "Ireland", cstates: false, czip: "none"}; 107i4w_cportal_array_countries [105] = {ccode: "IL", cname: "Israel", cstates: false, czip: "none"}; 108i4w_cportal_array_countries [106] = {ccode: "IT", cname: "Italy", cstates: false, czip: "GRP-5"}; 109i4w_cportal_array_countries [107] = {ccode: "CI", cname: "Ivory Coast (Cote D'Ivoire)", cstates: false, czip: "none"}; 110i4w_cportal_array_countries [108] = {ccode: "JM", cname: "Jamaica", cstates: false, czip: "none"}; 111i4w_cportal_array_countries [109] = {ccode: "JP", cname: "Japan", cstates: false, czip: "none"}; 112i4w_cportal_array_countries [110] = {ccode: "JO", cname: "Jordan", cstates: false, czip: "GRP-5"}; 113i4w_cportal_array_countries [111] = {ccode: "KZ", cname: "Kazakhstan", cstates: false, czip: "GRP-6"}; 114i4w_cportal_array_countries [112] = {ccode: "KE", cname: "Kenya", cstates: false, czip: "GRP-6"}; 115i4w_cportal_array_countries [113] = {ccode: "KI", cname: "Kiribati", cstates: false, czip: "none"}; 116i4w_cportal_array_countries [114] = {ccode: "KW", cname: "Kuwait", cstates: false, czip: "GRP-5"}; 117i4w_cportal_array_countries [115] = {ccode: "KG", cname: "Kyrgyzstan", cstates: false, czip: "GRP-6"}; 118i4w_cportal_array_countries [116] = {ccode: "LA", cname: "Laos", cstates: false, czip: "GRP-5"}; 119i4w_cportal_array_countries [117] = {ccode: "LV", cname: "Latvia", cstates: false, czip: "GRP-4"}; 120i4w_cportal_array_countries [118] = {ccode: "LB", cname: "Lebanon", cstates: false, czip: "none"}; 121i4w_cportal_array_countries [119] = {ccode: "LS", cname: "Lesotho", cstates: false, czip: "none"}; 122i4w_cportal_array_countries [120] = {ccode: "LR", cname: "Liberia", cstates: false, czip: "none"}; 123i4w_cportal_array_countries [121] = {ccode: "LY", cname: "Libya", cstates: false, czip: "GRP-5"}; 124i4w_cportal_array_countries [122] = {ccode: "LI", cname: "Liechtenstein", cstates: false, czip: "GRP-4"}; 125i4w_cportal_array_countries [123] = {ccode: "LT", cname: "Lithuania", cstates: false, czip: "GRP-5"}; 126i4w_cportal_array_countries [124] = {ccode: "LU", cname: "Luxembourg", cstates: false, czip: "GRP-4"}; 127i4w_cportal_array_countries [125] = {ccode: "MO", cname: "Macau",
127cstates: false, czip: "none"}; 128i4w_cportal_array_countries [126] = {ccode: "MK", cname: "Macedonia", cstates: false, czip: "GRP-4"}; 129i4w_cportal_array_countries [127] = {ccode: "MG", cname: "Madagascar", cstates: false, czip: "GRP-3"}; 130i4w_cportal_array_countries [128] = {ccode: "MW", cname: "Malawi", cstates: false, czip: "none"}; 131i4w_cportal_array_countries [129] = {ccode: "MY", cname: "Malaysia", cstates: false, czip: "GRP-5"}; 132i4w_cportal_array_countries [130] = {ccode: "MV", cname: "Maldives", cstates: false, czip: "none"}; 133i4w_cportal_array_countries [131] = {ccode: "ML", cname: "Mali", cstates: false, czip: "none"}; 134i4w_cportal_array_countries [132] = {ccode: "MT", cname: "Malta", cstates: false, czip: "none"}; 135i4w_cportal_array_countries [133] = {ccode: "MH", cname: "Marshall Islands", cstates: false, czip: "GRP-US"}; 136i4w_cportal_array_countries [134] = {ccode: "MQ", cname: "Martinique (French)", cstates: false, czip: "GRP-5"}; 137i4w_cportal_array_countries [135] = {ccode: "MR", cname: "Mauritania", cstates: false, czip: "none"}; 138i4w_cportal_array_countries [136] = {ccode: "MU", cname: "Mauritius", cstates: false, czip: "none"}; 139i4w_cportal_array_countries [137] = {ccode: "YT", cname: "Mayotte", cstates: false, czip: "GRP-5"}; 140i4w_cportal_array_countries [138] = {ccode: "MX", cname: "Mexico", cstates: false, czip: "GRP-5"}; 141i4w_cportal_array_countries [139] = {ccode: "FM", cname: "Micronesia", cstates: false, czip: "none"}; 142i4w_cportal_array_countries [140] = {ccode: "MD", cname: "Moldavia", cstates: false, czip: "GRP-4"}; 143i4w_cportal_array_countries [141] = {ccode: "MC", cname: "Monaco", cstates: false, czip: "GRP-5"}; 144i4w_cportal_array_countries [142] = {ccode: "MN", cname: "Mongolia", cstates: false, czip: "none"}; 145i4w_cportal_array_countries [143] = {ccode: "MS", cname: "Montserrat", cstates: false, czip: "none"}; 146i4w_cportal_array_countries [144] = {ccode: "MA", cname: "Morocco", cstates: false, czip: "GRP-5"}; 147i4w_cportal_array_countries [145] = {ccode: "MZ", cname: "Mozambique", cstates: false, czip: "GRP-5"}; 148i4w_cportal_array_countries [146] = {ccode: "MM", cname: "Myanmar", cstates: false, czip: "GRP-5"}; 149i4w_cportal_array_countries [147] = {ccode: "NA", cname: "Namibia", cstates: false, czip: "none"}; 150i4w_cportal_array_countries [148] = {ccode: "NR", cname: "Nauru", cstates: false, czip: "none"}; 151i4w_cportal_array_countries [149] = {ccode: "NP", cname: "Nepal", cstates: false, czip: "GRP-5"}; 152i4w_cportal_array_countries [150] = {ccode: "NL", cname: "Netherlands", cstates: false, czip: "none"}; 153i4w_cportal_array_countries [151] = {ccode: "AN", cname: "Netherlands Antilles", cstates: false, czip: "none"}; 154i4w_cportal_array_countries [152] = {ccode: "NC", cname: "New Caledonia (French)", cstates: false, czip: "GRP-5"}; 155i4w_cportal_array_countries [153] = {ccode: "NZ", cname: "New Zealand", cstates: false, czip: "none"}; 156i4w_cportal_array_countries [154] = {ccode: "NI", cname: "Nicaragua", cstates: false, czip: "none"}; 157i4w_cportal_array_countries [155] = {ccode: "NE", cname: "Niger", cstates: false, czip: "GRP-4"}; 158i4w_cportal_array_countries [156] = {ccode: "NG", cname: "Nigeria", cstates: false, czip: "GRP-6"}; 159i4w_cportal_array_countries [157] = {ccode: "NU", cname: "Niue", cstates: false, czip: "none"}; 160i4w_cportal_array_countries [158] = {ccode: "NF", cname: "Norfolk Island", cstates: false, czip: "GRP-4"}; 161i4w_cportal_array_countries [159] = {ccode: "KP", cname: "North Korea", cstates: false, czip: "none"}; 162i4w_cportal_array_countries [160] = {ccode: "MP", cname: "Northern Mariana Islands", cstates: false, czip: "GRP-US"}; 163i4w_cportal_array_countries [161] = {ccode: "NO", cname: "Norway", cstates: false, czip: "GRP-4"}; 164i4w_cportal_array_countries [162] = {ccode: "OM", cname: "Oman", cstates: false, czip: "GRP-3"}; 165i4w_cportal_array_countries [163] = {ccode: "PK", cname: "Pakistan", cstates: false, czip: "GRP-5"}; 166i4w_cportal_array_countries [164] = {ccode: "PW", cname: "Palau", cstates: false, czip: "GRP-US"}; 167i4w_cportal_array_countries [165] = {ccode: "PA", cname: "Panama", cstates: false, czip: "none"}; 168i4w_cportal_array_countries [166] = {ccode: "PG", cname: "Papua New Guinea", cstates: false, czip: "GRP-3"}; 169i4w_cportal_array_countries [167] = {ccode: "PY", cname: "Paraguay", cstates: false, czip: "GRP-4"}; 170i4w_cportal_array_countries [168] = {ccode: "PE", cname: "Peru", cstates: false, czip: "none"}; 171i4w_cportal_array_countries [169] = {ccode: "PH", cname: "Philippines", cstates: false, czip: "GRP-4"}; 172i4w_cportal_array_countries [170] = {ccode: "PN", cname: "Pitcairn Island", cstates: false, czip: "none"}; 173i4w_cportal_array_countries [171] = {ccode: "PL", cname: "Poland", cstates: false, czip: "none"}; 174i4w_cportal_array_countries [172] = {ccode: "PF", cname: "Polynesia (French)", cstates: false, czip: "GRP-5"}; 175i4w_cportal_array_countries [173] = {ccode: "PT", cname: "Portugal", cstates: false, czip: "none"}; 176i4w_cportal_array_countries [174] = {ccode: "PR", cname: "Puerto Rico", cstates: false, czip: "GRP-US"}; 177i4w_cportal_array_countries [175] = {ccode: "QA", cname: "Qatar", cstates: false, czip: "none"}; 178i4w_cportal_array_countries [176] = {ccode: "RE", cname: "Reunion (French)", cstates: false, czip: "GRP-5"}; 179i4w_cportal_array_countries [177] = {ccode: "RO", cname: "Romania", cstates: false, czip: "GRP-6"}; 180i4w_cportal_array_countries [178] = {ccode: "RU", cname: "Russian Federation", cstates: false, czip: "GRP-6"}; 181i4w_cportal_array_countries [179] = {ccode: "RW", cname: "Rwanda", cstates: false, czip: "none"}; 182i4w_cportal_array_countries [180] = {ccode: "GS", cname: "S. Georgia & S. Sandwich Islands", cstates: false, czip: "none"}; 183i4w_cportal_array_countries [181] = {ccode: "SH", cname: "Saint Helena", cstates: false, czip: "none"}; 184i4w_cportal_array_countries [182] = {ccode: "KN", cname: "Saint Kitts & Nevis Anguilla", cstates: false, czip: "none"}; 185i4w_cportal_array_countries [183] = {ccode: "LC", cname: "Saint Lucia", cstates: false, czip: "none"}; 186i4w_cportal_array_countries [184] = {ccode: "PM", cname: "Saint Pierre and Miquelon", cstates: false, czip: "none"}; 187i4w_cportal_array_countries [185] = {ccode: "ST", cname: "Sao Tome and Principe",
187cstates: false, czip: "none"}; 188i4w_cportal_array_countries [186] = {ccode: "VC", cname: "Saint Vincent & Grenadines", cstates: false, czip: "none"}; 189i4w_cportal_array_countries [187] = {ccode: "WS", cname: "Samoa", cstates: false, czip: "none"}; 190i4w_cportal_array_countries [188] = {ccode: "SM", cname: "San Marino", cstates: false, czip: "GRP-5"}; 191i4w_cportal_array_countries [189] = {ccode: "SA", cname: "Saudi Arabia", cstates: false, czip: "GRP-5"}; 192i4w_cportal_array_countries [190] = {ccode: "SN", cname: "Senegal", cstates: false, czip: "GRP-5"}; 193i4w_cportal_array_countries [191] = {ccode: "SC", cname: "Seychelles", cstates: false, czip: "none"}; 194i4w_cportal_array_countries [192] = {ccode: "SL", cname: "Sierra Leone", cstates: false, czip: "none"}; 195i4w_cportal_array_countries [193] = {ccode: "SG", cname: "Singapore", cstates: false, czip: "GRP-6"}; 196i4w_cportal_array_countries [194] = {ccode: "SK", cname: "Slovak Republic", cstates: false, czip: "none"}; 197i4w_cportal_array_countries [195] = {ccode: "SI", cname: "Slovenia", cstates: false, czip: "GRP-4"}; 198i4w_cportal_array_countries [196] = {ccode: "SB", cname: "Solomon Islands", cstates: false, czip: "none"}; 199i4w_cportal_array_countries [197] = {ccode: "SO", cname: "Somalia", cstates: false, czip: "none"}; 200i4w_cportal_array_countries [198] = {ccode: "ZA", cname: "South Africa", cstates: false, czip: "GRP-4"}; 201i4w_cportal_array_countries [199] = {ccode: "KR", cname: "South Korea", cstates: false, czip: "none"}; 202i4w_cportal_array_countries [200] = {ccode: "ES", cname: "Spain", cstates: false, czip: "GRP-5"}; 203i4w_cportal_array_countries [201] = {ccode: "LK", cname: "Sri Lanka", cstates: false, czip: "GRP-5"}; 204i4w_cportal_array_countries [202] = {ccode: "SD", cname: "Sudan", cstates: false, czip: "GRP-4"}; 205i4w_cportal_array_countries [203] = {ccode: "SR", cname: "Suriname", cstates: false, czip: "none"}; 206i4w_cportal_array_countries [204] = {ccode: "SJ", cname: "Svalbard and Jan Mayen Islands", cstates: false, czip: "none"}; 207i4w_cportal_array_countries [205] = {ccode: "SZ", cname: "Swaziland", cstates: false, czip: "none"}; 208i4w_cportal_array_countries [206] = {ccode: "SE", cname: "Sweden", cstates: false, czip: "none"}; 209i4w_cportal_array_countries [207] = {ccode: "CH", cname: "Switzerland", cstates: false, czip: "GRP-4"}; 210i4w_cportal_array_countries [208] = {ccode: "SY", cname: "Syria", cstates: false, czip: "none"}; 211i4w_cportal_array_countries [209] = {ccode: "TJ", cname: "Tadjikistan", cstates: false, czip: "GRP-6"}; 212i4w_cportal_array_countries [210] = {ccode: "TW", cname: "Taiwan", cstates: false, czip: "GRP-5"}; 213i4w_cportal_array_countries [211] = {ccode: "TZ", cname: "Tanzania", cstates: false, czip: "none"}; 214i4w_cportal_array_countries [212] = {ccode: "TH", cname: "Thailand", cstates: false, czip: "GRP-5"}; 215i4w_cportal_array_countries [213] = {ccode: "TG", cname: "Togo", cstates: false, czip: "none"}; 216i4w_cportal_array_countries [214] = {ccode: "TK", cname: "Tokelau", cstates: false, czip: "none"}; 217i4w_cportal_array_countries [215] = {ccode: "TO", cname: "Tonga", cstates: false, czip: "none"}; 218i4w_cportal_array_countries [216] = {ccode: "TT", cname: "Trinidad and Tobago", cstates: false, czip: "none"}; 219i4w_cportal_array_countries [217] = {ccode: "TN", cname: "Tunisia", cstates: false, czip: "GRP-4"}; 220i4w_cportal_array_countries [218] = {ccode: "TR", cname: "Turkey", cstates: false, czip: "GRP-5"}; 221i4w_cportal_array_countries [219] = {ccode: "TM", cname: "Turkmenistan", cstates: false, czip: "GRP-6"}; 222i4w_cportal_array_countries [220] = {ccode: "TC", cname: "Turks and Caicos Islands", cstates: false, czip: "none"}; 223i4w_cportal_array_countries [221] = {ccode: "TV", cname: "Tuvalu", cstates: false, czip: "none"}; 224i4w_cportal_array_countries [222] = {ccode: "UG", cname: "Uganda", cstates: false, czip: "none"}; 225i4w_cportal_array_countries [223] = {ccode: "UA", cname: "Ukraine", cstates: false, czip: "GRP-5"}; 226i4w_cportal_array_countries [224] = {ccode: "AE", cname: "United Arab Emirates", cstates: false, czip: "none"}; 227i4w_cportal_array_countries [225] = {ccode: "GB", cname: "United Kingdom",
227cstates: false, czip: "GRP-UK"}; 228i4w_cportal_array_countries [226] = {ccode: "UY", cname: "Uruguay", cstates: false, czip: "GRP-5"}; 229i4w_cportal_array_countries [227] = {ccode: "MIL", cname: "US Military", cstates: false, czip: "GRP-US"}; 230i4w_cportal_array_countries [228] = {ccode: "UM", cname: "US Minor Outlying Islands", cstates: false, czip: "GRP-US"}; 231i4w_cportal_array_countries [229] = {ccode: "UZ", cname: "Uzbekistan", cstates: false, czip: "GRP-6"}; 232i4w_cportal_array_countries [230] = {ccode: "VU", cname: "Vanuatu", cstates: false, czip: "none"}; 233i4w_cportal_array_countries [231] = {ccode: "VA", cname: "Vatican City State", cstates: false, czip: "GRP-5"}; 234i4w_cportal_array_countries [232] = {ccode: "VE", cname: "Venezuela", cstates: false, czip: "GRP-4"}; 235i4w_cportal_array_countries [233] = {ccode: "VN", cname: "Vietnam", cstates: false, czip: "GRP-6"}; 236i4w_cportal_array_countries [234] = {ccode: "VG", cname: "Virgin Islands (British)", cstates: false, czip: "GRP-UK"}; 237i4w_cportal_array_countries [235] = {ccode: "VI", cname: "Virgin Islands (USA)", cstates: false, czip: "GRP-US"}; 238i4w_cportal_array_countries [236] = {ccode: "WF", cname: "Wallis and Futuna Islands", cstates: false, czip: "GRP-5"}; 239i4w_cportal_array_countries [237] = {ccode: "EH", cname: "Western Sahara", cstates: false, czip: "none"}; 240i4w_cportal_array_countries [238] = {ccode: "YE", cname: "Yemen", cstates: false, czip: "none"}; 241i4w_cportal_array_countries [239] = {ccode: "YU", cname: "Yugoslavia", cstates: false, czip: "none"}; 242i4w_cportal_array_countries [240] = {ccode: "ZR", cname: "Zaire", cstates: false, czip: "none"}; 243i4w_cportal_array_countries [241] = {ccode: "ZM", cname: "Zambia", cstates: false, czip: "GRP-5"}; 244i4w_cportal_array_countries [242] = {ccode: "ZW", cname: "Zimbabwe", cstates: false, czip: "none"}; 245 246var bgColorRed = "#FF9F9F"; 247var bgColorWhite = "#FFFFFF"; 248 249//uk postalcode 250function i4w_cportal_check_postcode(toCheck) { 251 //return true; 252 // Permitted letters depend upon their position in the postcode. 253 var alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1 254 var alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2 255 var alpha3 = "[abcdefghjkstuw]"; // Character 3 256 var alpha4 = "[abehmnprvwxy]"; // Character 4 257 var alpha5 = "[abdefghjlnpqrstuwxyz]"; // Character 5 258 // Array holds the regular expressions for the valid postcodes 259 var pcexp = new Array(); 260 // Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA 261 pcexp.push(new RegExp("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1,2})(\\s*)([0-9]{1}" + alpha5 + "{2})$", "i")); 262 // Expression for postcodes: ANA NAA 263 pcexp.push(new RegExp("^(" + alpha1 + "{1}[0-9]{1}" + alpha3 + "{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$", "i")); 264 // Expression for postcodes: AANA NAA 265 pcexp.push(new RegExp("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1}" + alpha4 + "{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$", "i")); 266 // Exception for the special postcode GIR 0AA 267 pcexp.push(/^(GIR)(\s*)(0AA)$/i); 268 // Standard BFPO numbers 269 pcexp.push(/^(bfpo)(\s*)([0-9]{1,4})$/i); 270 // c/o BFPO numbers 271 pcexp.push(/^(bfpo)(\s*)(c\/o\s*[0-9]{1,3})$/i); 272 // Overseas Territories 273 pcexp.push(/^([A-Z]{4})(\s*)(1ZZ)$/i); 274 // Load up the string to check 275 toCheck = toCheck.replace(/\s/g, ""); 276 var postCode = toCheck; 277 // Assume we're not going to find a valid postcode 278 var valid = false; 279 // Check the string against the types of post codes 280 for (var i = 0; i < pcexp.length; i++) { 281 if (pcexp[i].test(postCode)) { 282 // The post code is valid - split the post code into component parts 283 pcexp[i].exec(postCode); 284 // Copy it back into the original string, converting it to uppercase and 285 // inserting a space between the inward and outward codes 286 postCode = RegExp.$1.toUpperCase() + " " + RegExp.$3.toUpperCase(); 287 // If it is a BFPO c/o type postcode, tidy up the "c/o" part 288 postCode = postCode.replace(/C\/O\s*/, "c/o "); 289 // Load new postcode back into the form element 290 valid = true; 291 // Remember that we have found that the code is valid and break from loop 292 break; 293 } 294 } 295 // Return with either the reformatted valid postcode or the original invalid 296 // postcode 297 if (valid) { 298 return postCode;
299 } else return false; 300} 301// End Uk Postalcode 302 303var ccErrorNo = 0; 304var ccErrors = new Array() 305ccErrors [0] = "Unknown card type"; 306ccErrors [1] = "No card number provided"; 307ccErrors [2] = "Credit card number is in invalid format"; 308ccErrors [3] = "Credit card number is invalid"; 309ccErrors [4] = "Credit card number has an inappropriate number of digits"; 310function i4w_cportal_check_creditcard(cardnumber, cardname) { 311 // Array to hold the permitted card characteristics 312 var cards = new Array(); 313 // Define the cards we support. You may add addtional card types. 314 // Name: As in the selection box of the form - must be same as user's 315 // Length: List of possible valid lengths of the card number for the card 316 // prefixes: List of possible prefixes for the card 317 // checkdigit Boolean to say whether there is a check digit 318 cards [0] = {name: "Visa", length: "13,16", prefixes: "4", checkdigit: true}; 319 cards [1] = {name: "MasterCard", length: "16", prefixes: "51,52,53,54,55", checkdigit: true}; 320 cards [2] = {name: "DinersClub", length: "14,16", prefixes: "305, 36, 38, 54,55", checkdigit: true}; 321 cards [3] = {name: "CarteBlanche", length: "14", prefixes: "300,301,302,303,304,305", checkdigit: true}; 322 cards [4] = {name: "American Express", length: "15", prefixes: "34,37", checkdigit: true}; 323 cards [5] = {name: "Discover", length: "16", prefixes: "6011,622,64,65", checkdigit: true}; 324 cards [6] = {name: "JCB", length: "16", prefixes: "35", checkdigit: true}; 325 cards [7] = {name: "enRoute", length: "15", prefixes: "2014,2149", checkdigit: true}; 326 cards [8] = {name: "Solo", length: "16,18,19", prefixes: "6334, 6767", checkdigit: true}; 327 cards [9] = { 328 name: "Switch", 329 length: "16,18,19", 330 prefixes: "4903,4905,4911,4936,564182,633110,6333,6759", 331 checkdigit: true 332 }; 333 cards [10] = { 334 name: "Maestro", 335 length: "12,13,14,15,16,18,19", 336 prefixes: "5018,5020,5038,6304,6759,6761", 337 checkdigit: true 338 }; 339 cards [11] = {name: "VisaElectron", length: "16", prefixes: "417500,4917,4913,4508,4844", checkdigit: true}; 340 cards [12] = {name: "LaserCard", length: "16,17,18,19", prefixes: "6304,6706,6771,6709", checkdigit: true}; 341 cards [13] = {name: "AmericanExpress", length: "15", prefixes: "34,37", checkdigit: true}; 342 // Establish card type 343 var cardType = -1; 344 for (var i = 0; i < cards.length; i++) { 345 // See if it is this card (ignoring the case of the string) 346 if (cardname.toLowerCase() == cards[i].name.toLowerCase()) { 347 cardType = i; 348 break; 349 } 350 } 351 // If card type not found, report an error 352 if (cardType == -1) { 353 ccErrorNo = 0; 354 return false; 355 } 356 // Ensure that the user has provided a credit card number 357 if (cardnumber.length == 0) { 358 ccErrorNo = 1; 359 return false; 360 } 361 // Now remove any spaces from the credit card number 362 cardnumber = cardnumber.replace(/\s/g, ""); 363 // Check that the number is numeric 364 var cardNo = cardnumber 365 var cardexp = /^[0-9]{13,19}$/; 366 if (!cardexp.exec(cardNo)) { 367 ccErrorNo = 2; 368 return false; 369 } 370 // Now check the modulus 10 check digit - if required 371 if (cards[cardType].checkdigit) { 372 var checksum = 0; // running checksum total 373 var mychar = ""; // next char to process 374 var j = 1; // takes value of 1 or 2 375 // Process each digit one by one starting at the right 376 var calc; 377 for (i = cardNo.length - 1; i >= 0; i--) { 378 // Extract the next digit and multiply by 1 or 2 on alternative digits. 379 calc = Number(cardNo.charAt(i)) * j; 380 // If the result is in two digits add 1 to the checksum total 381 if (calc > 9) { 382 checksum = checksum + 1; 383 calc = calc - 10; 384 } 385 // Add the units element to the checksum total 386 checksum = checksum + calc; 387 // Switch the value of j 388 if (j == 1) { 389 j = 2 390 } else { 391 j = 1 392 } 393 ; 394 } 395 // All done - if checksum is divisible by 10, it is a valid modulus 10. 396 // If not, report an error. 397 if (checksum % 10 != 0) { 398 ccErrorNo = 3; 399 return false;
400 } 401 } 402 // The following are the card-specific checks we undertake. 403 var LengthValid = false; 404 var PrefixValid = false; 405 var undefined; 406 // We use these for holding the valid lengths and prefixes of a card type 407 var prefix = new Array(); 408 var lengths = new Array(); 409 // Load an array with the valid prefixes for this card 410 prefix = cards[cardType].prefixes.split(","); 411 // Now see if any of them match what we have in the card number 412 for (i = 0; i < prefix.length; i++) { 413 var exp = new RegExp("^" + prefix[i]); 414 if (exp.test(cardNo)) PrefixValid = true; 415 } 416 // If it isn't a valid prefix there's no point at looking at the length 417 if (!PrefixValid) { 418 ccErrorNo = 3; 419 return false; 420 } 421 // See if the length is valid for this card 422 lengths = cards[cardType].length.split(","); 423 for (j = 0; j < lengths.length; j++) { 424 if (cardNo.length == lengths[j]) LengthValid = true; 425 } 426 // See if all is OK by seeing if the length was valid. We only check the 427 // length if all else was hunky dory. 428 if (!LengthValid) { 429 ccErrorNo = 4; 430 return false; 431 } 432 ; 433 // The credit card is in the required format. 434 return true; 435} 436function i4w_cportal_check_form_creditcard(myForm) { 437 retCODE = true; 438 jumpFOCUS = null; 439 with (myForm) { 440 document.getElementById("i4w-cportal-error-submit").style.display = "none"; 441 CreditCard0ExpirationMonth.style.background = bgColorWhite; 442 CreditCard0ExpirationYear.style.background = bgColorWhite; 443 CreditCard0NameOnCard.style.background = bgColorWhite; 444 CreditCard0FirstName.style.background = bgColorWhite; 445 CreditCard0LastName.style.background = bgColorWhite; 446 CreditCard0Email.style.background = bgColorWhite; 447 CreditCard0PhoneNumber.style.background = bgColorWhite; 448 CreditCard0BillAddress1.style.background = bgColorWhite; 449 CreditCard0BillAddress2.style.background = bgColorWhite; 450 CreditCard0BillCity.style.background = bgColorWhite; 451 CreditCard0BillCountry.style.background = bgColorWhite; 452 CreditCard0BillState.style.background = bgColorWhite; 453 CreditCard0BillZip.style.background = bgColorWhite; 454 if (typeof CreditCard0CardNumber !== 'undefined') { 455 CreditCard0CardNumber.style.background = bgColorWhite; 456 CreditCard0CardType.style.background = bgColorWhite; 457 if (CreditCard0CardNumber.value == null || CreditCard0CardNumber.value == "") { 458 CreditCard0CardNumber.style.background = bgColorRed; 459 retCODE = false; 460 if (jumpFOCUS == null) { 461 jumpFOCUS = CreditCard0CardNumber; 462 } 463 } 464 if (!i4w_cportal_check_creditcard(CreditCard0CardNumber.value, CreditCard0CardType.value)) { 465 CreditCard0CardType.style.background = bgColorRed; 466 retCODE = false; 467 if (jumpFOCUS == null) { 468 jumpFOCUS = CreditCard0CardNumber; 469 } 470 } 471 } 472 var d = new Date(); 473 jahr = d.getFullYear(); 474 monat = d.getMonth() + 1; 475 if (CreditCard0ExpirationMonth.value == null || CreditCard0ExpirationMonth.value == "") { 476 document.getElementsByName('CreditCard0ExpirationMonth')[0].style.background = bgColorRed; 477 retCODE = false; 478 if (jumpFOCUS == null) { 479 jumpFOCUS = CreditCard0ExpirationMonth; 480 } 481 } 482 if (CreditCard0ExpirationYear.value == null || CreditCard0ExpirationYear.value == "") { 483 document.getElementsByName('CreditCard0ExpirationYear')[0].style.background = bgColorRed; 484 retCODE = false; 485 if (jumpFOCUS == null) { 486 jumpFOCUS = CreditCard0ExpirationYear; 487 } 488 } 489 if (CreditCard0ExpirationYear.value < jahr || (CreditCard0ExpirationYear.value == jahr && CreditCard0ExpirationMonth.value < monat)) { 490 document.getElementsByName('CreditCard0ExpirationMonth')[0].style.background = bgColorRed; 491 document.getElementsByName('CreditCard0ExpirationYear')[0].style.background = bgColorRed; 492 retCODE = false;
493 if (jumpFOCUS == null) { 494 jumpFOCUS = CreditCard0ExpirationMonth; 495 } 496 } 497 if (CreditCard0NameOnCard.value == null || CreditCard0NameOnCard.value == "") { 498 CreditCard0NameOnCard.style.background = bgColorRed; 499 retCODE = false; 500 if (jumpFOCUS == null) { 501 jumpFOCUS = CreditCard0NameOnCard; 502 } 503 } 504 if (CreditCard0FirstName.value == null || CreditCard0FirstName.value == "") { 505 CreditCard0FirstName.style.background = bgColorRed; 506 retCODE = false; 507 if (jumpFOCUS == null) { 508 jumpFOCUS = CreditCard0FirstName; 509 } 510 } 511 if (CreditCard0LastName.value == null || CreditCard0LastName.value == "") { 512 CreditCard0LastName.style.background = bgColorRed; 513 retCODE = false; 514 if (jumpFOCUS == null) { 515 jumpFOCUS = CreditCard0LastName; 516 } 517 } 518 if (CreditCard0Email.value == null || CreditCard0Email.value == "") { 519 CreditCard0Email.style.background = bgColorRed; 520 retCODE = false; 521 if (jumpFOCUS == null) { 522 jumpFOCUS = CreditCard0Email; 523 } 524 } 525 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,29})+$/.test(CreditCard0Email.value) == false) { 526 CreditCard0Email.style.background = bgColorRed; 527 retCODE = false; 528 if (jumpFOCUS == null) { 529 jumpFOCUS = CreditCard0Email; 530 } 531 } 532 if (CreditCard0PhoneNumber.value == null || CreditCard0PhoneNumber.value == "" || CreditCard0PhoneNumber.value != "" ) { 533 if (/^([-0-9+ ()) ]+)$/.test(CreditCard0PhoneNumber.value) == false) { 534 CreditCard0PhoneNumber.style.background = bgColorRed; 535 retCODE = false; 536 if (jumpFOCUS == null) { 537 jumpFOCUS = CreditCard0PhoneNumber; 538 } 539 } 540 } 541 if (CreditCard0BillAddress1.value == null || CreditCard0BillAddress1.value == "") { 542 if (CreditCard0BillAddress2.value != null && CreditCard0BillAddress2.value != "") { 543 CreditCard0BillAddress1.value = CreditCard0BillAddress2.value; 544 CreditCard0BillAddress2.value = ""; 545 } 546 } 547 if (CreditCard0BillAddress1.value == null || CreditCard0BillAddress1.value == "" || CreditCard0BillAddress1.value.length < 3) { 548 CreditCard0BillAddress1.style.background = bgColorRed; 549 retCODE = false; 550 if (jumpFOCUS == null) { 551 jumpFOCUS = CreditCard0BillAddress1; 552 } 553 } 554 /* 555 if (CreditCard0BillAddress2.value != null && CreditCard0BillAddress2.value != "" && CreditCard0BillAddress2.value.length < 3) { 556 CreditCard0BillAddress2.style.background = bgColorRed; 557 retCODE = false; 558 if (jumpFOCUS == null) { 559 jumpFOCUS = CreditCard0BillAddress2; 560 } 561 } 562 */ 563 if (CreditCard0BillCity.value == null || CreditCard0BillCity.value == "") { 564 CreditCard0BillCity.style.background = bgColorRed; 565 retCODE = false; 566 if (jumpFOCUS == null) { 567 jumpFOCUS = CreditCard0BillCity; 568 } 569 } 570 if (i4w_cportal_check_for_required_state(CreditCard0BillCountry.value, i4w_cportal_required_state_countries)) { 571 if (CreditCard0BillState.value == null || CreditCard0BillState.value == "") { 572 CreditCard0BillState.style.background = bgColorRed; 573 retCODE = false; 574 if (jumpFOCUS == null) { 575 jumpFOCUS = CreditCard0BillState; 576 } 577 } 578 } 579 // Check PostalCode 580 CreditCard0BillZip.value = CreditCard0BillZip.value.replace(/\s/g, ""); 581 CreditCard0BillZip.value = CreditCard0BillZip.value.toUpperCase(); // in case of lowercase 582 if (CreditCard0BillZip.value == null || CreditCard0BillZip.value == "") { 583 CreditCard0BillZip.style.background = bgColorRed; 584 retCODE = false;
585 } else { 586 for (var i = 0; i < i4w_cportal_array_countries.length; i++) { 587 if (CreditCard0BillCountry.value == i4w_cportal_array_countries[i].cname) { 588 if (i4w_cportal_array_countries[i].czip == "none") { 589 if (/^([A-Za-z-0-9+]+)$/.test(CreditCard0BillZip.value) == false) { 590 CreditCard0BillZip.style.background = bgColorRed; 591 retCODE = false; 592 if (jumpFOCUS == null) { 593 jumpFOCUS = CreditCard0BillZip; 594 } 595 break; 596 } 597 } else if (i4w_cportal_array_countries[i].czip == "GRP-US") { 598 reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/); 599 if (!reZip.test(CreditCard0BillZip.value)) { 600 CreditCard0BillZip.style.background = bgColorRed; 601 retCODE = false; 602 if (jumpFOCUS == null) { 603 jumpFOCUS = CreditCard0BillZip; 604 } 605 break; 606 } 607 } else if (i4w_cportal_array_countries[i].czip == "GRP-UK") { 608 var myPostCode = i4w_cportal_check_postcode(CreditCard0BillZip.value); 609 if (myPostCode != false) { 610 CreditCard0BillZip.value = myPostCode; 611 break; 612 } else { 613 CreditCard0BillZip.style.background = bgColorRed; 614 retCODE = false; 615 if (jumpFOCUS == null) { 616 jumpFOCUS = CreditCard0BillZip; 617 } 618 break; 619 } 620 } else if (i4w_cportal_array_countries[i].czip == "GRP-CA") { 621 strlen = CreditCard0BillZip.value.length; 622 if (strlen !== 6) { 623 CreditCard0BillZip.style.background = bgColorRed; 624 retCODE = false; 625 if (jumpFOCUS == null) { 626 jumpFOCUS = CreditCard0BillZip; 627 } 628 break; 629 } 630 if ('ABCEGHJKLMNPRSTVXY'.indexOf(CreditCard0BillZip.value.charAt(0)) < 0) { 631 CreditCard0BillZip.style.background = bgColorRed; 632 retCODE = false; 633 if (jumpFOCUS == null) { 634 jumpFOCUS = CreditCard0BillZip; 635 } 636 break; 637 } 638 if ('0123456789'.indexOf(CreditCard0BillZip.value.charAt(1)) < 0) { 639 CreditCard0BillZip.style.background = bgColorRed; 640 retCODE = false; 641 if (jumpFOCUS == null) { 642 jumpFOCUS = CreditCard0BillZip; 643 } 644 break; 645 } 646 if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(CreditCard0BillZip.value.charAt(2)) < 0) { 647 CreditCard0BillZip.style.background = bgColorRed; 648 retCODE = false; 649 if (jumpFOCUS == null) { 650 jumpFOCUS = CreditCard0BillZip; 651 } 652 break; 653 } 654 if ('0123456789'.indexOf(CreditCard0BillZip.value.charAt(3)) < 0) { 655 CreditCard0BillZip.style.background = bgColorRed; 656 retCODE = false; 657 if (jumpFOCUS == null) { 658 jumpFOCUS = CreditCard0BillZip; 659 } 660 break; 661 } 662 if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(CreditCard0BillZip.value.charAt(4)) < 0) { 663 CreditCard0BillZip.style.background = bgColorRed; 664 retCODE = false;
665 if (jumpFOCUS == null) { 666 jumpFOCUS = CreditCard0BillZip; 667 } 668 break; 669 } 670 if ('0123456789'.indexOf(CreditCard0BillZip.value.charAt(5)) < 0) { 671 CreditCard0BillZip.style.background = bgColorRed; 672 retCODE = false; 673 if (jumpFOCUS == null) { 674 jumpFOCUS = CreditCard0BillZip; 675 } 676 break; 677 } 678 } else if (i4w_cportal_array_countries[i].czip == "GRP-3") { 679 reZip = new RegExp(/(^\d{3}$)/); 680 if (!reZip.test(CreditCard0BillZip.value)) { 681 CreditCard0BillZip.style.background = bgColorRed; 682 retCODE = false; 683 if (jumpFOCUS == null) { 684 jumpFOCUS = CreditCard0BillZip; 685 } 686 break; 687 } 688 } else if (i4w_cportal_array_countries[i].czip == "GRP-4") { 689 reZip = new RegExp(/(^\d{4}$)/); 690 if (!reZip.test(CreditCard0BillZip.value)) { 691 CreditCard0BillZip.style.background = bgColorRed; 692 retCODE = false; 693 if (jumpFOCUS == null) { 694 jumpFOCUS = CreditCard0BillZip; 695 } 696 break; 697 } 698 } else if (i4w_cportal_array_countries[i].czip == "GRP-5") { 699 reZip = new RegExp(/(^\d{5}$)/); 700 if (!reZip.test(CreditCard0BillZip.value)) { 701 CreditCard0BillZip.style.background = bgColorRed; 702 retCODE = false; 703 if (jumpFOCUS == null) { 704 jumpFOCUS = CreditCard0BillZip; 705 } 706 break; 707 } 708 } else if (i4w_cportal_array_countries[i].czip == "GRP-6") { 709 reZip = new RegExp(/(^\d{6}$)/); 710 if (!reZip.test(CreditCard0BillZip.value)) { 711 CreditCard0BillZip.style.background = bgColorRed; 712 retCODE = false; 713 if (jumpFOCUS == null) { 714 jumpFOCUS = CreditCard0BillZip; 715 } 716 break; 717 } 718 } 719 break; 720 } 721 }//endfor 722 } 723 if (CreditCard0BillCountry.value == null || CreditCard0BillCountry.value == "") { 724 CreditCard0BillCountry.style.background = bgColorRed; 725 retCODE = false; 726 if (jumpFOCUS == null) { 727 jumpFOCUS = CreditCard0BillCountry; 728 } 729 } 730 if (retCODE) { 731 var orderButton = Submit; 732 if (orderButton != null) { 733 orderButton.disabled = true; 734 } 735 } else { 736 if (jumpFOCUS != null) { 737 jumpFOCUS.focus(); 738 } 739 document.getElementById("i4w-cportal-error-submit").style.display = "block"; 740 scroll(0,0); 741 } 742 } 743 return retCODE; 744} 745 746if (i4w_cportal_password_settings == null) { 747 var i4w_cportal_password_settings = {"min_passlen":8, "charset": "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!$#", "alert_error_message": "Only following characters are allowed:"}; 748} 749 750function i4w_cportal_check_form_profile(myForm) { 751 retCODE = true; 752 jumpFOCUS = null; 753 with (myForm) { 754 document.getElementById("i4w-cportal-error-submit").style.display = "none"; 755 Contact0FirstName.style.background = bgColorWhite; 756 Contact0LastName.style.background = bgColorWhite; 757 PasswordNew1.style.background = bgColorWhite; 758 PasswordNew2.style.background = bgColorWhite; 759 Contact0Email.style.background = bgColorWhite; 760 Contact0Phone1.style.background = bgColorWhite; 761 Contact0StreetAddress1.style.background = bgColorWhite; 762 Contact0StreetAddress2.style.background = bgColorWhite; 763 Contact0City.style.background = bgColorWhite; 764 Contact0Country.style.background = bgColorWhite; 765 Contact0State.style.background = bgColorWhite; 766 Contact0PostalCode.style.background = bgColorWhite; 767 if (Contact0FirstName.value == null || Contact0FirstName.value == "") { 768 Contact0FirstName.style.background = bgColorRed; 769 retCODE = false;
770 if (jumpFOCUS == null) { 771 jumpFOCUS = Contact0FirstName; 772 } 773 } 774 if (Contact0LastName.value == null || Contact0LastName.value == "") { 775 Contact0LastName.style.background = bgColorRed; 776 retCODE = false; 777 if (jumpFOCUS == null) { 778 jumpFOCUS = Contact0LastName; 779 } 780 } 781 password_alert = false; 782 if (PasswordNew1.value != "" || PasswordNew2.value != "") { 783 if (PasswordNew1.value == null || PasswordNew1.value == "") { 784 PasswordNew1.style.background = bgColorRed; 785 retCODE = false; 786 if (jumpFOCUS == null) { 787 jumpFOCUS = PasswordNew1; 788 } 789 } else { 790 if (PasswordNew1.value.length < i4w_cportal_password_settings.min_passlen) { 791 PasswordNew1.style.background = bgColorRed; 792 retCODE = false; 793 if (jumpFOCUS == null) { 794 jumpFOCUS = PasswordNew1; 795 } 796 } else { 797 var i = PasswordNew1.value.length; 798 while (i--) { 799 if (i4w_cportal_password_settings.charset.indexOf(PasswordNew1.value[i]) == -1) { 800 alert(i4w_cportal_password_settings.alert_error_message + ' ' + i4w_cportal_password_settings.charset); 801 password_alert = true; 802 PasswordNew1.style.background = bgColorRed; 803 retCODE = false; 804 if (jumpFOCUS == null) { 805 jumpFOCUS = PasswordNew1; 806 } 807 break; 808 } 809 } 810 } 811 } 812 if (PasswordNew2.value == null || PasswordNew2.value == "") { 813 PasswordNew2.style.background = bgColorRed; 814 retCODE = false; 815 if (jumpFOCUS == null) { 816 jumpFOCUS = PasswordNew2; 817 } 818 } else { 819 if (PasswordNew2.value.length < i4w_cportal_password_settings.min_passlen) { 820 PasswordNew2.style.background = bgColorRed; 821 retCODE = false; 822 if (jumpFOCUS == null) { 823 jumpFOCUS = PasswordNew2; 824 } 825 } else { 826 var i = PasswordNew2.value.length; 827 while (i--) { 828 if (i4w_cportal_password_settings.charset.indexOf(PasswordNew2.value[i]) == -1) { 829 if (!password_alert) { 830 alert(i4w_cportal_password_settings.alert_error_message + ' ' + i4w_cportal_password_settings.charset); 831 } 832 PasswordNew2.style.background = bgColorRed; 833 retCODE = false; 834 if (jumpFOCUS == null) { 835 jumpFOCUS = PasswordNew2; 836 } 837 break; 838 } 839 } 840 } 841 } 842 if (PasswordNew1.value != PasswordNew2.value) { 843 PasswordNew1.style.background = bgColorRed; 844 PasswordNew2.style.background = bgColorRed; 845 retCODE = false; 846 if (jumpFOCUS == null) { 847 jumpFOCUS = PasswordNew1; 848 } 849 } 850 851 } 852 if (Contact0Email.value == null || Contact0Email.value == "") { 853 Contact0Email.style.background = bgColorRed; 854 retCODE = false; 855 if (jumpFOCUS == null) { 856 jumpFOCUS = Contact0Email; 857 } 858 } 859 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,29})+$/.test(Contact0Email.value) == false) { 860 Contact0Email.style.background = bgColorRed; 861 retCODE = false; 862 if (jumpFOCUS == null) { 863 jumpFOCUS = Contact0Email; 864 } 865 } 866 if (Contact0Phone1.value == null || Contact0Phone1.value == "" || (/^([-0-9+ ()) ]+)$/.test(Contact0Phone1.value) == false)) { 867 Contact0Phone1.style.background = bgColorRed; 868 retCODE = false;
869 if (jumpFOCUS == null) { 870 jumpFOCUS = Contact0Phone1; 871 } 872 } 873 if (Contact0StreetAddress1.value == null || Contact0StreetAddress1.value == "") { 874 if (Contact0StreetAddress2.value != null && Contact0StreetAddress2.value != "") { 875 Contact0StreetAddress1.value = Contact0StreetAddress2.value; 876 Contact0StreetAddress2.value = ""; 877 } 878 } 879 if (Contact0StreetAddress1.value == null || Contact0StreetAddress1.value == "" || Contact0StreetAddress1.value.length < 3) { 880 Contact0StreetAddress1.style.background = bgColorRed; 881 retCODE = false; 882 if (jumpFOCUS == null) { 883 jumpFOCUS = Contact0StreetAddress1; 884 } 885 } 886 if (Contact0City.value == null || Contact0City.value == "") { 887 Contact0City.style.background = bgColorRed; 888 retCODE = false; 889 if (jumpFOCUS == null) { 890 jumpFOCUS = Contact0City; 891 } 892 } 893 if (Contact0Country.value == null || Contact0Country.value == "") { 894 Contact0Country.style.background = bgColorRed; 895 retCODE = false; 896 if (jumpFOCUS == null) { 897 jumpFOCUS = Contact0Country; 898 } 899 } 900 901 if (i4w_cportal_check_for_required_state(Contact0Country.value, i4w_cportal_required_state_countries)) { 902 if (Contact0State.value == null || Contact0State.value == "") { 903 Contact0State.style.background = bgColorRed; 904 retCODE = false; 905 if (jumpFOCUS == null) { 906 jumpFOCUS = Contact0State; 907 } 908 } 909 } 910 // Check PostalCode 911 /* 912 Contact0PostalCode.value = Contact0PostalCode.value.replace(/\s/g, ""); 913 Contact0PostalCode.value = Contact0PostalCode.value.toUpperCase(); // in case of lowercase 914 if (Contact0PostalCode.value == null || Contact0PostalCode.value == "") { 915 Contact0PostalCode.style.background = bgColorRed; 916 retCODE = false; 917 } else { 918 */ 919 if (Contact0PostalCode.value != "") { 920 for (var i = 0; i < i4w_cportal_array_countries.length; i++) { 921 if (Contact0Country.value == i4w_cportal_array_countries[i].cname) { 922 if (i4w_cportal_array_countries[i].czip == "none") { 923 if (/^([A-Za-z-0-9+]+)$/.test(Contact0PostalCode.value) == false) { 924 Contact0PostalCode.style.background = bgColorRed; 925 retCODE = false; 926 if (jumpFOCUS == null) { 927 jumpFOCUS = Contact0PostalCode; 928 } 929 break; 930 } 931 } else if (i4w_cportal_array_countries[i].czip == "GRP-US") { 932 reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/); 933 if (!reZip.test(Contact0PostalCode.value)) { 934 Contact0PostalCode.style.background = bgColorRed; 935 retCODE = false; 936 if (jumpFOCUS == null) { 937 jumpFOCUS = Contact0PostalCode; 938 } 939 break; 940 } 941 } else if (i4w_cportal_array_countries[i].czip == "GRP-UK") { 942 var myPostCode = i4w_cportal_check_postcode(Contact0PostalCode.value); 943 if (myPostCode != false) { 944 Contact0PostalCode.value = myPostCode; 945 break; 946 } else { 947 Contact0PostalCode.style.background = bgColorRed; 948 retCODE = false; 949 if (jumpFOCUS == null) { 950 jumpFOCUS = Contact0PostalCode; 951 } 952 break; 953 } 954 } else if (i4w_cportal_array_countries[i].czip == "GRP-CA") { 955 strlen = Contact0PostalCode.value.length; 956 if (strlen !== 6) { 957 Contact0PostalCode.style.background = bgColorRed; 958 retCODE = false;
959 if (jumpFOCUS == null) { 960 jumpFOCUS = Contact0PostalCode; 961 } 962 break; 963 } 964 if ('ABCEGHJKLMNPRSTVXY'.indexOf(Contact0PostalCode.value.charAt(0)) < 0) { 965 Contact0PostalCode.style.background = bgColorRed; 966 retCODE = false; 967 if (jumpFOCUS == null) { 968 jumpFOCUS = Contact0PostalCode; 969 } 970 break; 971 } 972 if ('0123456789'.indexOf(Contact0PostalCode.value.charAt(1)) < 0) { 973 Contact0PostalCode.style.background = bgColorRed; 974 retCODE = false; 975 if (jumpFOCUS == null) { 976 jumpFOCUS = Contact0PostalCode; 977 } 978 break; 979 } 980 if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(Contact0PostalCode.value.charAt(2)) < 0) { 981 Contact0PostalCode.style.background = bgColorRed; 982 retCODE = false; 983 if (jumpFOCUS == null) { 984 jumpFOCUS = Contact0PostalCode; 985 } 986 break; 987 } 988 if ('0123456789'.indexOf(Contact0PostalCode.value.charAt(3)) < 0) { 989 Contact0PostalCode.style.background = bgColorRed; 990 retCODE = false; 991 if (jumpFOCUS == null) { 992 jumpFOCUS = Contact0PostalCode; 993 } 994 break; 995 } 996 if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(Contact0PostalCode.value.charAt(4)) < 0) { 997 Contact0PostalCode.style.background = bgColorRed; 998 retCODE = false; 999 if (jumpFOCUS == null) { 1000 jumpFOCUS = Contact0PostalCode; 1001 } 1002 break; 1003 } 1004 if ('0123456789'.indexOf(Contact0PostalCode.value.charAt(5)) < 0) { 1005 Contact0PostalCode.style.background = bgColorRed; 1006 retCODE = false; 1007 if (jumpFOCUS == null) { 1008 jumpFOCUS = Contact0PostalCode; 1009 } 1010 break; 1011 } 1012 } else if (i4w_cportal_array_countries[i].czip == "GRP-3") { 1013 reZip = new RegExp(/(^\d{3}$)/); 1014 if (!reZip.test(Contact0PostalCode.value)) { 1015 Contact0PostalCode.style.background = bgColorRed; 1016 retCODE = false; 1017 if (jumpFOCUS == null) { 1018 jumpFOCUS = Contact0PostalCode; 1019 } 1020 break; 1021 } 1022 } else if (i4w_cportal_array_countries[i].czip == "GRP-4") { 1023 reZip = new RegExp(/(^\d{4}$)/); 1024 if (!reZip.test(Contact0PostalCode.value)) { 1025 Contact0PostalCode.style.background = bgColorRed; 1026 retCODE = false; 1027 if (jumpFOCUS == null) { 1028 jumpFOCUS = Contact0PostalCode; 1029 } 1030 break; 1031 } 1032 } else if (i4w_cportal_array_countries[i].czip == "GRP-5") { 1033 reZip = new RegExp(/(^\d{5}$)/); 1034 if (!reZip.test(Contact0PostalCode.value)) { 1035 Contact0PostalCode.style.background = bgColorRed; 1036 retCODE = false;
1037 if (jumpFOCUS == null) { 1038 jumpFOCUS = Contact0PostalCode; 1039 } 1040 break; 1041 } 1042 } else if (i4w_cportal_array_countries[i].czip == "GRP-6") { 1043 reZip = new RegExp(/(^\d{6}$)/); 1044 if (!reZip.test(Contact0PostalCode.value)) { 1045 Contact0PostalCode.style.background = bgColorRed; 1046 retCODE = false; 1047 if (jumpFOCUS == null) { 1048 jumpFOCUS = Contact0PostalCode; 1049 } 1050 break; 1051 } 1052 } 1053 break; 1054 } 1055 }//endfor 1056 } 1057 1058 1059 } 1060 if (retCODE) { 1061 var orderButton = 'submit'; 1062 if (orderButton != null) { 1063 orderButton.disabled = true; 1064 } 1065 } else { 1066 if (jumpFOCUS != null) { 1067 jumpFOCUS.focus(); 1068 } 1069 document.getElementById("i4w-cportal-error-submit").style.display = "block"; 1070 scroll(0,0); 1071 } 1072 return retCODE; 1073} 1074function i4w_cportal_check_for_required_state(country, i4w_cportal_required_state_countries) { 1075 for (var i = 0; i < i4w_cportal_required_state_countries.length; i++) { 1076 if (country == i4w_cportal_required_state_countries[i]) { 1077 return true; 1078 } 1079 } 1080 return false; 1081}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.