PageSourceSearch

https://www.interfunnels.com/website/js/if-funnel-core.js?v=20261002

js interfunnels.com collected 2026-10-08 05:46:53 UTC 73,467 bytes, 1,831 lines download raw bytes

1/* InterFunnels funnel core runtime.
2   Extracted from templates/includes.html so browsers cache it across the
3   pages of a funnel instead of re-parsing ~73 KB of inline JS per page.
4   Per-page Smarty values are assigned by the inline block that precedes
5   this file; this script must stay non-deferred so that order holds. */
6	function checkCoupon(couponcode, packageId) {
7		$("#couponcode_help").remove();
8		if (!couponcode) {
9			return;
10		}
11		$("[data-id='summary_discount_detail']").remove();
12		var discount = 0;
13		localStorage.setItem(local_is_discount, 'no');
14		var ichar = "!@^+=/*|,?\":<>[]{}`\'; ()&$#%";
15		if (!checkStr(couponcode, ichar)) {
16			localStorage.setItem(local_discount, 0);
17			$('input[name="couponcode"]').after('<div id="couponcode_help">Some Characters in Coupon Code are not allowed</div>');
18		} else if (couponcode.length <= 5) {
19			localStorage.setItem(local_discount, 0);
20			$('input[name="couponcode"]').after('<div id="couponcode_help">Minimin 6 Character </div>');
21		} else {
22			$.ajax({
23				type: "POST",
24				url: url1 + 'check_couponcode.php',
25				data: 'couponcode=' + couponcode + '&packageId=' + packageId,
26				async: true,
27				success: function (resp) {
28					var un = couponcode;
29					$("#couponcode_help").remove();
30					var r = resp.split(':');
31					var user = r[0];
32					var uni_dup = r[1];
33
34					if (un != user) {
35						return;
36					}
37					if (uni_dup == 'yes' && un == user) {
38						$('input[name="couponcode"]').after('<div id="couponcode_help">Coupon Successfully Added</div>');
39						$.ajax({
40							type: "POST",
41							url: url1 + 'get_couponcode.php',
42							data: 'couponcode=' + couponcode + '&packageId=' + packageId,
43							async: true,
44							success: function (resp2) {
45								var re = resp2.split(':');
46								var type = re[0];
47								var damount = (re[1]);
48								localStorage.setItem(local_is_discount, 'yes');
49								localStorage.setItem(local_discounttype, type);
50								localStorage.setItem(local_discountamount, damount);
51								var amount = parseFloat(localStorage.getItem(local_package_price));
52								var shipping = parseFloat(localStorage.getItem(local_shipping));
53								if (shipping > 0) {
54									amount = amount - shipping;
55								}
56								if (type == 'p') {
57									discount = (amount * damount) / 100;
58								} else if (type == 'f') {
59									discount = damount;
60								}
61								localStorage.setItem(local_discount, discount);
62								discountF = parseFloat(discount).toFixed(2);
63								currencyCode = $("input[name=currencyCode]").val();
64								localStorage.setItem(local_currencyCode, currencyCode);
65								dcode = '<div data-id="summary_discount_detail">\
66									<div class="row" id="order_discount" style="margin: 0px;">\
67										<div class="col">\
68											<font style="vertical-align: inherit;font-size: small;color: #000000;">Discount</font>\
69										</div>\
70										<div class="col text-right" style="color: #000000;">' + currencyCode + numberWithCommas(discountF) + '</div>\
71									</div>\
72								</div>';
73								$("[data-id='summary_shipping_detail']").after(dcode);
74							}
75						});
76					} else if (uni_dup == 'invalid' && un == user) {
77						localStorage.setItem(local_discount, 0);
78						$('input[name="couponcode"]').after('<div id="couponcode_help">Invalid Coupon.</div>');
79					} else if (uni_dup == 'expired' && un == user) {
80						localStorage.setItem(local_discount, 0);
81						$('input[name="couponcode"]').after('<div id="couponcode_help">Coupon Code is Expired</div>');
82					} else if (uni_dup == 'redemed' && un == user) {
83						localStorage.setItem(local_discount, 0);
84						$('input[name="couponcode"]').after('<div id="couponcode_help">Coupon Code is Already Used.</div>');
85					}
86				}
87			});
88		}
89
90		total = parseFloat(localStorage.getItem(local_orderTotal));
91		if (localStorage.getItem(local_is_discount) == 'yes') {
92			discounttype = localStorage.getItem(local_discounttype);
93			discountamount = parseFloat(localStorage.getItem(local_discountamount));
94			package_amount = parseFloat(localStorage.getItem(local_package_price));
95			amountwithoutShpiing = total - parseFloat(localStorage.getItem(local_shipping));
96			if (discounttype == 'p') {
97				discount = (package_amount * discountamount) / 100;
98			} else {
99				discount = discountamount;
100			}
101			total = total - discount;
102		}
103		tcode = '<hr><div class="row" style="margin: 0px;">\
104			<div class="col">\
105				<font style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
106			</div>\
107			<div class="col text-right" style="color: #000000;">' + currencyCode + numberWithCommas(total.toFixed(2)) + '</div>\
108		</div>';
109		$("[data-id='summary_total']").html(tcode);
110	}
111	function showLoader() {
112		$('#loading').show();
113	}
114	function hideLoader() {
115		$('#loading').hide();
116	}
117
118	  	local_is_discount = "is_discount_f_"+siteid;
119	  	local_discounttype = "discounttype_f_"+siteid;
120	  	local_discountamount = "discountamount_f_"+siteid;
121	  	local_orderTotal = "orderTotal_f_"+siteid;
122	  	local_shipping = "shipping_f_"+siteid;
123	  	local_discount = "discount_f_"+siteid;
124	  	local_currencyCode = "currencyCode_f_"+siteid;
125	  	local_package_price = "package_price_f_"+siteid;
126	  	local_order_bumps = "order_bumps_f_"+siteid;
127	  	local_oto_detials = "oto_detials_f_"+siteid;
128	  	local_quantity = "quantity_f_"+siteid;
129	  	local_couponcode = "couponcode_f_"+siteid;
130	  	local_name = "name_f_"+siteid;
131	  	local_lName = "lName_f_"+siteid;
132	  	local_lastname = "lastname_f_"+siteid;
133	  	local_email = "email_f_"+siteid;
134	  	local_address = "address_f_"+siteid;
135	  	local_address1 = "address1_f_"+siteid;
136	  	local_address2 = "address2_f_"+siteid;
137	  	local_cellphonenumber = "cellphonenumber_f_"+siteid;
138	  	local_city = "city_f_"+siteid;
139	  	local_state = "state_f_"+siteid;
140	  	local_zip = "zip_f_"+siteid;
141	  	local_country = "country_f_"+siteid;
142	  	local_is_reciept = "is_reciept_f_"+siteid;
143	  	local_bank_reciept = "bank_reciept_f_"+siteid;
144	  	local_ep_mobile_number = "ep_mobile_number_f_"+siteid;
145	  	local_ep_email = "ep_email_f_"+siteid;
146	  	local_gateway = "gateway_f_"+siteid;
147	  	local_username = 'username_f_'+siteid;
148		local_password = 'password_f_'+siteid;
149	  	local_cvv = "cvv_f_"+siteid;
150	  	local_creditCardNumber = "creditCardNumber_f_"+siteid;
151	  	local_expiryYear = "expiryYear_f_"+siteid;
152	  	local_expiryMonth = "expiryMonth_f_"+siteid;
153	  	local_creditCardName = "creditCardName_f_"+siteid;
154	  	local_ad_tracker = 'ad_tracker_f_'+siteid;
155
156	  	 // Facebook Pixel: normalize currency symbols / ISO codes for Meta (requires ISO 4217)
157	  	 window.__getCurrencyCode = function(currencySymbol) {
158	  	 	if (!currencySymbol) { return 'USD'; }
159	  	 	var raw = String(currencySymbol).trim();
160	  	 	var upper = raw.toUpperCase();
161	  	 	if (/^[A-Z]{3}$/.test(upper)) { return upper; }
162	  	 	if (raw === '$') { return 'USD'; }
163	  	 	if (raw === '฿') { return 'THB'; }
164	  	 	if (raw === 'CAD$') { return 'CAD'; }
165	  	 	if (raw === 'AUD$') { return 'AUD'; }
166	  	 	if (raw === '€') { return 'EUR'; }
167	  	 	if (raw === '£') { return 'GBP'; }
168	  	 	if (raw === 'Â¥') { return 'JPY'; }
169	  	 	if (raw === '₹') { return 'INR'; }
170	  	 	if (raw === 'Rs') { return 'PKR'; }
171	  	 	if (raw === 'IDR') { return 'IDR'; }
172	  	 	return 'USD';
173	  	 };
174
175	  	 // Display currency for order summary ($ / € / …). Never return undefined.
176	  	 window.__resolveDisplayCurrency = function() {
177	  	 	var c = null;
178	  	 	try {
179	  	 		c = $("input[name=currencyCode]").val();
180	  	 	} catch (e) {}
181	  	 	if (!c || c === 'undefined') {
182	  	 		try { c = localStorage.getItem(local_currencyCode); } catch (e2) { c = null; }
183	  	 	}
184	  	 	if (!c || c === 'undefined' || c === 'null') {
185	  	 		c = '$';
186	  	 	}
187	  	 	return String(c);
188	  	 };
189
190	  	 // Facebook Pixel: read live order total + currency from localStorage (never use stale/hardcoded values)
191	  	 window.__getPurchaseTrackingData = function() {
192	  	 	var value = 0;
193	  	 	var currency = 'USD';
194	  	 	try {
195	  	 		if (localStorage.getItem(local_orderTotal)) {
196	  	 			value = parseFloat(localStorage.getItem(local_orderTotal)) || 0;
197	  	 			if (localStorage.getItem(local_discount)) {
198	  	 				value = value - (parseFloat(localStorage.getItem(local_discount)) || 0);
199	  	 			}
200	  	 		}
201	  	 		if (localStorage.getItem(local_currencyCode)) {
202	  	 			currency = window.__getCurrencyCode(localStorage.getItem(local_currencyCode));
203	  	 		}
204	  	 	} catch(e) {}
205	  	 	if (value < 0 || isNaN(value)) { value = 0; }
206	  	 	value = Math.round(value * 100) / 100;
207	  	 	return { value: value, currency: currency };
208	  	 };
209
210	  	 window.__refreshPurchaseTrackingVars = function() {
211	  	 	var data = window.__getPurchaseTrackingData();
212	  	 	purchase_value = data.value;
213	  	 	currency_code = data.currency;
214	  	 	return data;
215	  	 };
216
217	  	  $().ready(function(){
218	  	  	$(document).ajaxStart(function () {
219	  	  		$('#loading').show();
220	  	  	})
221	  	  	$(document).ajaxStop(function () {
222	  	  		$('#loading').hide();
223	  	  	})
224	  	  	$('input[name=couponcode]').blur(function(){
225	  	  		packageid =  $('input[name="select_order_package"]:checked').attr('data-packageid');
226	  	  		couponcode = $("input[name='couponcode']").val();
227	  	  		checkCoupon(couponcode,packageid);								
228	  	  	});
229
230	  	  	if(pagetype == 'order')
231	  	  	{
232
233	  	  		total = 0;
234	  	  		str3 = '';
235	  	  		if(readCookie(siteid+"_f_"+'registrationLink'))
236	  	  		{
237	  	  			action = readCookie(siteid+"_f_"+'registrationLink'); 
238		  	  		str_arr  = action.split('%3F');
239		  	  		str2 = str_arr[1];
240		  	  		str3 = decodeURIComponent(str2);
241	  	  		}
242	  	  		country = '';
243	  	  		$('[name="country"]').each(function(){
244						temp_val = $(this).val();
245						if(temp_val)
246						{
247							country = temp_val
248						}
249				})
250				if(str3)
251				{
252					str3 = str3+"&country="+country;
253				}
254				else
255				{
256					str3 = "country="+country;
257				}
258	  	  		$.ajax({
259			        type: "GET",     	 
260				    url: url1+'get_packages.php',
261				    data : str3,
262				    async: true,       
263			    	success: function(data){
264			    	if(data != 'f')	
265			    		if(data == 'error1')
266			    		{
267			    			$("[data-id='order_select_dynamic_update']").html('No Product Avaliable.Please Create Product First.');
268			    		}
269			    		else
270			    		{
271			    			data_arr = data.split("####");
272			    			$("[data-id='order_select_dynamic_update']").html(data_arr[0]);
273			    			//$("[data-name='dynamic_order_select_item']").html(data_arr[1]);
274			    			currencyCode =  data_arr[3];
275			    			packageid =  $('input[name="select_order_package"]:checked').attr('data-packageid');
276			    			localStorage.setItem(local_currencyCode,currencyCode);
277			    			$('<input type ="hidden" name="currencyCode" value="'+currencyCode+'" />').appendTo('body');
278			    			let shipping = parseFloat(data_arr[2]);
279			    			if(data_arr[2] == '')
280			    			{
281			    				shipping = 0;
282			    			}
283			    			localStorage.setItem(local_shipping,shipping);
284
285			    			let p_count = parseFloat(data_arr[4]);
286			    			if(shipping > 0)
287			    			{
288			    				total = total+shipping;
289			    				shippingFixed = parseFloat(shipping).toFixed(2);
290    				    		code = '<div class="row" id="order_shiping" style="margin: 0px;">\
291    								<div class="col">\
292    					                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Shipping</font>\
293    					            </div>\
294    					            <div class="col text-right" style="color: #000000;">'+data_arr[3]+numberWithCommas(shippingFixed)+'</div>\
295    							</div>';
296    							$("[data-id=summary_shipping_detail]").html(code);
297			    			}
298			    			else
299			    			{
300			    				$("[data-id=summary_shipping_detail]").html('');
301			    			}
302			    			/*if(p_count == 1)
303			    			{
304			    				$("#select_item").hide();
305			    				$("[data-name=order_select_item]").hide();
306			    				$("#select_price").hide();
307			    			}*/
308			    			selectid =  $('input[name="select_order_package"]:checked').attr('data-packageid');
309			    			selectType= $('input[name="select_order_package"]:checked').attr('data-type');
310			    			plantype =$('input[name="select_order_package"]:checked').attr('data-plantype');
311			    			is_quantity =$('input[name="select_order_package"]:checked').attr('data-isquantity');
312			    			$("[name=order_select_quantity]").val('1');
313			    			if(selectType == 'p' && plantype == 'o' && is_quantity == '1')
314			    			{
315			    				$("[data-id=order_select_quantity]").show();
316
317			    			}
318			    			else
319			    			{
320			    				$("[data-id=order_select_quantity]").hide();
321			    				$("[name=order_select_quantity]").val('1');
322			    			}
323			    			if(plantype == 'f')
324			    			{
325			    				$('[data-name="credit-card"]').hide();
326			    			}
327			    			else
328			    			{
329			    				$('[data-name="credit-card"]').show();
330			    			}
331			    			//$(".paymentplan").hide();
332			    			//$("#plan"+selectid).show();
333			    			quanity = $('[name=order_select_quantity]').val();
334			    			if(quanity > 1)
335			    			{
336			    				$("#dynamic_quantiy").remove();
337			    				$("#dynamic_package").parent('div').append('<font id="dynamic_quantiy" class="cursorgrab">&nbsp;x'+quanity+'</font>');
338			    			}
339			    			else
340			    			{
341			    				$("#dynamic_quantiy").remove();
342			    			}
343
344			    			// Radios are injected above — refresh summary via delegated change
345			    			// (do NOT call get_package before radios exist; that yielded blank/"Free"/$0).
346			    			var $checkedPkg = $('input[name="select_order_package"]:checked');
347			    			if ($checkedPkg.length) {
348			    				$checkedPkg.trigger('change');
349			    			}
350			    			// Re-apply previously selected order bumps (summary rows + totals)
351			    			if(localStorage.getItem(local_order_bumps))
352			    			{
353			    				order_bumps = localStorage.getItem(local_order_bumps);
354			    				order_bumps = order_bumps.trim();
355			    				order_bumps = order_bumps.slice(0, -1);
356			    				if(order_bumps != '')
357			    				{
358			    					bumps_array = order_bumps.split(',');
359			    					for (i=0; i<bumps_array.length;i++) {
360			    						bumps_id = bumps_array[i];
361			    						bumps_id = bumps_id.trim();
362			    						$("[data-vvveb-bump-id="+bumps_id+"]").prop('checked',true);
363			    						(function(bumps_id_inner){
364			    						data = {'packageid':bumps_id_inner};
365			    				        var pp = url1+"get_order_bump.php";
366			    						$.ajax({
367			    							type: 'POST',
368			    							data : data,
369			    							url: pp,
370			    							async: true,
371			    							success: function(data){
372			    								ifUseBumpResponse(data);
373			    					    		oto_name   = oto_detail[0];
374			    					    		oto_price = oto_detail[1];
375			    					    		var cur = window.__resolveDisplayCurrency();
376			    					    		code = '<div class="row" id="summary_order_bump_'+bumps_id_inner+'" style="margin: 0px;">\
377			    								<div class="col">\
378			    					                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">
378'+oto_name+'</font>\
379			    					            </div>\
380			    					            <div class="col text-right" style="color: #000000;">'+cur+numberWithCommas(oto_price)+'</div>\
381			    							</div>';
382			    							if ($("#summary_order_bump_"+bumps_id_inner).length === 0) {
383			    								$("[data-id='summary_bump_detail']").append(code);
384			    							}
385			    						}
386			    						});
387			    						})(bumps_id);
388			    					}
389			    				}
390			    			}
391			    			//$("[data-name=order_select]").html(data);
392			    		}
393			       	}
394		        })
395	  	  	} 
396  	  	  	if(pagetype == 'order_confirmation')
397  	  	  	{
398  	  	  		try {
399  	  	  			if (typeof receiptBillId === 'string' && receiptBillId) {
400  	  	  				jQuery('#order_id, [data-id="order_number"], [data-id="order_id"], #dynamic_order_number, .dynamic_order_number').text(receiptBillId);
401  	  	  			}
402  	  	  		} catch (eBill) {}
403  	  	  		// Seed localStorage from PHP session snapshot (survives upsell redirect races).
404  	  	  		try {
405  	  	  			if ($.isArray(receiptOtOS) && receiptOtOS.length) {
406  	  	  				var otoCsv = localStorage.getItem(local_oto_detials) || '';
407  	  	  				for (var ri = 0; ri < receiptOtOS.length; ri++) {
408  	  	  					var ro = receiptOtOS[ri] || {};
409  	  	  					if (!ro.id) { continue; }
410  	  	  					if (otoCsv.indexOf(ro.id + ',') === -1) {
411  	  	  						otoCsv += ro.id + ',';
412  	  	  					}
413  	  	  					if (ro.title) {
414  	  	  						localStorage.setItem('f_' + siteid + '_' + ro.id + '_title', ro.title);
415  	  	  					}
416  	  	  					if (ro.price != null && ro.price !== '') {
417  	  	  						localStorage.setItem('f_' + siteid + '_' + ro.id + '_price', String(ro.price));
418  	  	  					}
419  	  	  				}
420  	  	  				localStorage.setItem(local_oto_detials, otoCsv);
421  	  	  			}
422  	  	  			if ($.isArray(receiptBumps) && receiptBumps.length) {
423  	  	  				var bumpCsv = localStorage.getItem(local_order_bumps) || '';
424  	  	  				for (var bi = 0; bi < receiptBumps.length; bi++) {
425  	  	  					var rb = receiptBumps[bi] || {};
426  	  	  					if (!rb.id) { continue; }
427  	  	  					if (bumpCsv.indexOf(rb.id + ',') === -1) {
428  	  	  						bumpCsv += rb.id + ',';
429  	  	  					}
430  	  	  				}
431  	  	  				localStorage.setItem(local_order_bumps, bumpCsv);
432  	  	  			}
433  	  	  		} catch (eReceiptSeed) {}
434
435  	  	  		total  = 0;
436  	  	  		package_storage = 'packageid_f_'+siteid;
437  	  	  		payment_storage = 'paymentplanid_f_'+siteid;
438  	  	  		country_storage = 'country_f_'+siteid;
439  		        packageid =  localStorage.getItem(package_storage);
440  		        planid =  localStorage.getItem(payment_storage); 
441  		        country = localStorage.getItem(country_storage); 
442  	  	  		str3 = 'packageid='+packageid+'&ppid='+planid+'&country='+country; 
443  	  	  		$.ajax({
444  			        type: "POST",     	 
445  				    url: url1+'get_package.php',	
446  				    data:str3,	
447  				    async: true,        
448  			    	success: function(data){ 
449  			    		ifUsePackageResponse(data);
450  			    		package	 = package_detail[0];
451  			    		price = package_detail[1];
452  			    		pricewithoutcurrency = parseFloat(package_detail[4]);
453  			    		if (isNaN(pricewithoutcurrency)) { pricewithoutcurrency = 0; }
454  			    		localStorage.setItem(local_package_price,pricewithoutcurrency);
455  			    		quantity = parseFloat(localStorage.getItem(local_quantity));
456  			    		if (isNaN(quantity) || quantity < 1) { quantity = 1; }
457  			    		currencyCode =  package_detail[3] || localStorage.getItem(local_currencyCode) || '$';
458  			    		if (!currencyCode || currencyCode === 'undefined') { currencyCode = '$'; }
459  			    		localStorage.setItem(local_currencyCode,currencyCode);
460  		    			if(quantity > 1)
461  		    			{
462  		    				pricewithoutcurrency = quantity * pricewithoutcurrency;
463  		    				$("#dynamic_quantiy").remove();
464  		    				$("#dynamic_package").parent('div').append('<font id="dynamic_quantiy" class="cursorgrab">&nbsp;x'+quantity+'</font>');
465  		    			}
466  		    			else
467  		    			{
468  		    				$("#dynamic_quantiy").remove();
469  		    			}
470  		    			price = parseFloat(pricewithoutcurrency).toFixed(2);
471
472  		    			$("#dynamic_package").html(package);
473  			    		$("#dynamic_package_price").html(typeof ifFormatMoney === 'function' ? ifFormatMoney(currencyCode, pricewithoutcurrency) : (currencyCode+numberWithCommas(price)));
474  			    		total = total+pricewithoutcurrency; 
475  			    		let shipping = parseFloat(package_detail[2]); 
476  			    		if (isNaN(shipping)) { shipping = 0; }
477  			    		localStorage.setItem(local_shipping,shipping);
478
479  		    			if(shipping > 0) 
480  		    			{
481  		    				total = total+shipping;
482  		    				shippingFixed = parseFloat(shipping).toFixed(2);
483  				    		code = '<div class="row" id="order_shiping" style="margin: 0px;">\
484  								<div class="col">\
485  					                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Shipping</font>\
486  					            </div>\
487  					            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(shippingFixed)+'</div>\
488  							</div>';
489  							$("[data-id=summary_shipping_detail]").html(code);
490  		    			}
491  		    			else
492  		    			{
493  		    				$("[data-id=summary_shipping_detail]").html('');
494  		    			}
495  		    			$("input[name=currencyCode]").remove();
496  		    			$('<input type ="hidden" name="currencyCode" value="'+currencyCode+'" />').appendTo('body');
497
498  			    		// Bumps / OTOs / Total must run AFTER currency + package total are known
499  			    		$("[data-id='summary_bump_detail']").empty();
500  			    		$(".summary_order_oto").remove();
501  			    		bump_total = 0;
502  			    		var bumpFetches = [];
503  			    		if(localStorage.getItem(local_order_bumps))
504  			    		{
505  			  	  		order_bumps = localStorage.getItem(local_order_bumps);
506  						order_bumps = order_bumps.trim();
507  						order_bumps = order_bumps.slice(0, -1);
508  						if(order_bumps != '')
509  						{
510  							bumps_array = order_bumps.split(',');
511  							for (i=0; i<bumps_array.length;i++) {
512  								bumps_id = bumps_array[i];
513  								bumps_id = bumps_id.trim();
514  								if (!bumps_id) { continue; }
515  								$("[data-vvveb-bump-id="+bumps_id+"]").prop('checked',true);
516  			    				(function(bumps_id_inner){
517  			    				data = {'packageid':bumps_id_inner};
518  			    		        var pp = url1+"get_order_bump.php";
519  			    				bumpFetches.push($.ajax({
520  									type: 'POST',
521  									data : data,
522  									url: pp,
523  									async: true,
524  									success: function(data){
525  										ifUseBumpResponse(data);
526  							    		oto_name   = oto_detail[0];
527  							    		oto_price = oto_detail[1];
528  							    		var rawBump = parseFloat(oto_detail[2]);
529  							    		if (isNaN(rawBump)) {
530  							    			// Fallback: strip currency from display price
531  							    			rawBump = parseFloat(String(oto_price).replace(/[^0-9.]/g, ''));
532  							    		}
533  							    		if (isNaN(rawBump)) { rawBump = 0; }
534  							    		localStorage.setItem('f_'+siteid+'_bump_pirce_'+bumps_id_inner, rawBump);
535  							    		var cur = window.__resolveDisplayCurrency();
536  							    		code = '<div class="row summary_order_bump" id="summary_order_bump_'+bumps_id_inner+'" style="margin: 0px;">\
537  										<div class="col">\
538  							                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_name+'</font>\
539  							            </div>\
540  							            <div class="col text-right" style="color: #000000;">'+cur+numberWithCommas(parseFloat(rawBump).toFixed(2))+'</div>\
541  									</div>';
542  									$("[data-id='summary_bump_detail']").append(code);
543  			    					}
544  			    				}));
545  			    				})(bumps_id);
546  							}
547  						}
548  					}
549  					currencyCode = window.__resolveDisplayCurrency();
550  					localStorage.setItem(local_currencyCode,currencyCode);
551
552  					function vvvebPaintConfirmationExtras() {
553  						bump_total = 0;
554  						if(localStorage.getItem(local_order_bumps)) {
555  							var ob = String(localStorage.getItem(local_order_bumps) || '').trim();
556  							if (ob.slice(-1) === ',') { ob = ob.slice(0, -1); }
557  							if (ob !== '') {
558  								var ba = ob.split(',');
559  								for (var bj = 0; bj < ba.length; bj++) {
560  									var bid = String(ba[bj] || '').trim();
561  									if (!bid) { continue; }
562  									var bp = parseFloat(localStorage.getItem('f_'+siteid+'_bump_pirce_'+bid));
563  									if (isNaN(bp)) { bp = 0; }
564  									bump_total += bp;
565  								}
566  							}
567  						}
568  			  	  		oto_total = 0;
569  			  	  		if(localStorage.getItem(local_oto_detials))
570  			  	  		{
571  				  	  		oto_detials = localStorage.getItem(local_oto_detials);
572  							oto_detials = oto_detials.trim();
573  							oto_detials = oto_detials.slice(0, -1);
574  							if(oto_detials != '')
575  							{
576  								$(".summary_order_oto").remove();
577  								oto_array = oto_detials.split(',');
578  								for (i=0; i<oto_array.length;i++) {
579  									oto_id = oto_array[i];
580  									oto_id = oto_id.trim();
581  									if (!oto_id) { continue; }
582  									oto_title = (typeof ifFriendlyOtoTitle === 'function') ? ifFriendlyOtoTitle(localStorage.getItem("f_"+siteid+"_"+oto_id+"_title")) : (localStorage.getItem("f_"+siteid+"_"+oto_id+"_title") || 'One-time offer');
583  									oto_price = parseFloat(localStorage.getItem("f_"+siteid+"_"+oto_id+"_price"));
584  									if (isNaN(oto_price)) { oto_price = 0; }
585  									var oto_price_fmt = oto_price.toFixed(2);
586  						    		oto_code = '<div class="row summary_order_oto" id="summary_order_oto_'+oto_id+'" style="margin: 0px;">\
587  									<div class="col">\
588  						                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_title+'</font>\
589  						            </div>\
590  						            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(oto_price_fmt)+'</div>\
591  								</div>';
592  								// Append inside bump slot so AI layouts can't hide sibling rows.
593  								$("[data-id='summary_bump_detail']").first().append(oto_code);
594  			    				oto_total = oto_total+oto_price;
595  								}
596  							}
597  						}
598  						var grand = total + bump_total + oto_total;
599  						localStorage.setItem(local_orderTotal, grand);
600  						tcode = '<hr><div class="row"  style="margin: 0px;">\
601  											<div class="col">\
602  								                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
603  								            </div>\
604  								            <div class="col text-right" style="color: #000000;">'+(typeof ifFormatMoney === 'function' ? ifFormatMoney(currencyCode, grand) : (currencyCode+numberWithCommas(grand.toFixed(2))))+'</div>\
605  										</div>';
606  						$("[data-id='summary_total']").html(tcode);
607  						couponcode = localStorage.getItem(local_couponcode);
608  						if(couponcode)
609  						{
610  							checkCoupon(couponcode,packageid);
611  						}
612  						if (typeof window.__vvvebClearFunnelCheckoutStorage === 'function') {
613  							window.__vvvebClearFunnelCheckoutStorage();
614  						}
615  					}
616
617  					if (bumpFetches.length) {
618  						$.when.apply($, bumpFetches).always(function(){ vvvebPaintConfirmationExtras(); });
619  					} else {
620  						vvvebPaintConfirmationExtras();
621  					}
622  			       	}
623  		        })
624		      	
625  			}
626			window.__vvvebClearFunnelCheckoutStorage = function () {
627			if(!(is_clear == 'yes' && available_upsell < 1 && available_oc < 1))
628			{
629				return;
630			}
631				var d = new Date();
632			    d.setTime(d.getTime() - (15*60*1000));
633			    var expires = "expires="+ d.toUTCString();
634			    document.cookie = siteid+"_f_"+"2step= "+sample+"; "+expires+"; path=/";
635			    document.cookie = siteid+"_f_"+"name= "+sample+"; "+expires+"; path=/";
636			    document.cookie = siteid+"_f_"+"email= "+sample+"; "+expires+"; path=/";
637			    document.cookie = siteid+"_f_"+"isRegister= "+sample+"; "+expires+"; path=/";
638			    localStorage.removeItem(local_is_discount);
639			  	localStorage.removeItem(local_discounttype);
640			  	localStorage.removeItem(local_discountamount);
641			  	localStorage.removeItem(local_orderTotal);
642			  	localStorage.removeItem(local_shipping);
643			  	localStorage.removeItem(local_discount);
644			  	localStorage.removeItem(local_currencyCode);
645			  	localStorage.removeItem(local_package_price);
646				  	if(localStorage.getItem(local_order_bumps))
647    			{
648	    			order_bumps =localStorage.getItem(local_order_bumps);
649	    			order_bumps = order_bumps.trim();
650	    			order_bumps = order_bumps.slice(0, -1);
651					if(order_bumps != '')
652					{
653						bumps_array = order_bumps.split(',');
654						for (i=0; i<bumps_array.length;i++) {
655							bumps_id = bumps_array[i];
656							bumps_id = bumps_id.trim();
657		    				bump_item_name = "f_"+siteid+"_"+'bump_pirce_'+bumps_id;
658		    				localStorage.removeItem(bump_item_name);
659						}
660					}
661				}
662
663			  	localStorage.removeItem(local_order_bumps);
664			  	localStorage.removeItem(local_oto_detials);
665			  	localStorage.removeItem(local_quantity);
666			  	localStorage.removeItem(local_couponcode);
667				localStorage.removeItem(local_is_reciept);
668			  	localStorage.removeItem(local_bank_reciept);
669			  	localStorage.removeItem(local_ep_mobile_number);
670			  	localStorage.removeItem(local_ep_email);
671			  	localStorage.removeItem(local_gateway);
672			  	localStorage.removeItem(local_username);
673				localStorage.removeItem(local_password);
674			  	localStorage.removeItem(local_cvv);
675			  	localStorage.removeItem(local_creditCardNumber);
676			  	localStorage.removeItem(local_expiryYear);
677			  	localStorage.removeItem(local_expiryMonth);
678			  	localStorage.removeItem(local_creditCardName);
679			  	try {
680			  		sessionStorage.removeItem(local_cvv);
681			  		sessionStorage.removeItem(local_creditCardNumber);
682			  		sessionStorage.removeItem(local_expiryYear);
683			  		sessionStorage.removeItem(local_expiryMonth);
684			  		sessionStorage.removeItem(local_creditCardName);
685			  	} catch (e) {}
686			  	for (var i = 1; i <= 6; i++) {
687			  		
688			  		oto_title =  "f_"+siteid+'_'+'oto'+i+'_title';
689			  		oto_price =  "f_"+siteid+'_'+'oto'+i+'_price';
690			  		localStorage.removeItem(oto_title);
691			  		localStorage.removeItem(oto_price);
692			  	}
693			  	package_storage = 'packageid_f_'+siteid;
694			  	payment_storage = 'paymentplanid_f_'+siteid;
695			  	localStorage.removeItem(payment_storage);
696			  	localStorage.removeItem(package_storage);
697			};
698			// On confirmation, wait until the receipt ajax paints bumps/OTOs (see success above).
699			// Elsewhere clear immediately when the funnel is done.
700			if (pagetype != 'order_confirmation') {
701				window.__vvvebClearFunnelCheckoutStorage();
702			} 
703			$(document).on('change','[name=country]',function(){
704				country = $(this).val();
705		        packageid =  $('input[name="select_order_package"]:checked').attr('data-packageid');
706	  	  		planid = $('input[name="select_order_package"]:checked').val();
707	  	  		str3 = 'packageid='+packageid+'&ppid='+planid+'&country='+country;
708	  	  		$.ajax({
709			        type: "POST",     	 
710				    url: url1+'get_package.php',	
711				    data:str3,	
712				    async: true,       
713			    	success: function(data){
714			    		ifUsePackageResponse(data);
715			    		package	 = package_detail[0];
716			    		price = package_detail[1];
717			    		shipping = package_detail[2];
718			    		currencyCode = package_detail[3] || window.__resolveDisplayCurrency();
719			    		if (!currencyCode || currencyCode === 'undefined') { currencyCode = '$'; }
720			    		localStorage.setItem(local_currencyCode, currencyCode);
721			    		$("input[name=currencyCode]").remove();
722			    		$('<input type="hidden" name="currencyCode" value="'+currencyCode+'" />').appendTo('body');
723			    		price2 = package_detail[4];
724			    		localStorage.setItem(local_package_price,price2);
725			    		selectid = $('input[name="select_order_package"]:checked').attr('data-packageid');
726			  	  		selectType= $('input[name="select_order_package"]:checked').attr('data-type');
727			    		plantype =$('input[name="select_order_package"]:checked').attr('data-plantype');
728			    		is_quantity =$('input[name="select_order_package"]:checked').attr('data-isquantity');
729			    		if(selectType == 'p' && plantype == 'o' && is_quantity == '1')
730			  	  		{
731			  	  			$("[data-id=order_select_quantity]").show();
732
733			  	  		}
734			  	  		else
735			  	  		{
736			  	  			$("[data-id=order_select_quantity]").hide();
737			  	  			$("[name=order_select_quantity]").val('1');
738			  	  			
739			  	  		}
740			  	  		if(plantype == 'f')
741			  	  		{
742			  	  			$('[data-name="credit-card"]').hide();
743			  	  		}
744			  	  		else
745			  	  		{
746			  	  			$('[data-name="credit-card"]').show();
747			  	  		}
748			  	  		quanity = $('[name=order_select_quantity]').val();
749			  	  		if(quanity > 1)
750			  	  		{
751			  	  			
752							price2 = (parseFloat(price2)*parseFloat(quanity));
753							price = currencyCode+parseFloat(price2).toFixed(2);
754			  	  			$("#dynamic_quantiy").remove();
755			  	  			$("#dynamic_package").parent('div').append('<font id="dynamic_quantiy">&nbsp;x'+quanity+'</font>');
756			  	  		}
757			  	  		else
758			  	  		{
759			  	  			$("#dynamic_quantiy").remove();
760			  	  		}
761			    		$("#dynamic_package").html(package);
762			    		$("#dynamic_package_price").html(numberWithCommas(price));
763			    		ctotal = 0;
764			    		if(shipping == '' || shipping == null || typeof shipping === 'undefined')
765			    		{
766			    			shipping = 0;
767			    		}
768			    		shipping = parseFloat(shipping) || 0;
769			    		localStorage.setItem(local_shipping,shipping);
770			  	  		if(shipping > 0)
771		    			{
772		    				shippingFixed = parseFloat(shipping).toFixed(2);
773				    		code = '<div class="row" id="order_shiping" style="margin: 0px;">\
774								<div class="col">\
775					                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Shipping</font>\
776					            </div>\
777					            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(shippingFixed)+'</div>\
778							</div>';
779							$("[data-id=summary_shipping_detail]").html(code);
780		    			}
781		    			else
782		    			{
783		    				$("[data-id=summary_shipping_detail]").html('');
784		    			}
785		    			ctotal = ctotal+(parseFloat(price2) || 0)+shipping;
786		    			bump_total = 0;
787		    			if(localStorage.getItem(local_order_bumps))
788		    			{
789			    			order_bumps =localStorage.getItem(local_order_bumps);
790			    			order_bumps = order_bumps.trim();
791			    			order_bumps = order_bumps.slice(0, -1);
792							if(order_bumps != '')
793							{
794								bumps_array = order_bumps.split(',');
795								for (i=0; i<bumps_array.length;i++) {
796									bumps_id = bumps_array[i];
797									bumps_id = bumps_id.trim();
798				    				bump_item_name = 'f_'+siteid+'_'+'bump_pirce_'+bumps_id;
799				    				bump_price = (localStorage.getItem(bump_item_name));
800				    				bump_price = parseFloat(bump_price);   
801				    				bump_total = bump_total+bump_price;
802								}
803								ctotal = ctotal+bump_total;
804							}
805							
806						}
807			  	  		oto_total = 0;
808			  	  		if(localStorage.getItem(local_oto_detials))
809			  	  		{
810			  	  			$(".summary_order_oto").remove();
811				  	  		oto_detials = localStorage.getItem(local_oto_detials);
812							oto_detials = oto_detials.trim();
813							oto_detials = oto_detials.slice(0, -1);
814							if(oto_detials != '')
815							{
816								oto_array = oto_detials.split(',');
817								for (i=0; i<oto_array.length;i++) {
818									oto_id = oto_array[i];
819									oto_id = oto_id.trim();
820									oto_title = localStorage.getItem('f_'+siteid+'_'+oto_id+"_title");
821									oto_price = parseFloat(localStorage.getItem('f_'+siteid+'_'+oto_id+"_price")).toFixed(2);
822						    		oto_code = '<div class="row summary_order_oto" id="summary_order_oto_'+oto_id+'" style="margin: 0px;">\
823										<div class="col">\
824							                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_title+'</font>\
825							            </div>\
826							            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(oto_price)+'</div>\
827									</div>';
828									$("[data-id='summary_bump_detail']").after(oto_code);
829				    				oto_price = parseFloat(oto_price);   
830				    				oto_total = oto_total+oto_price;
831								}
832							}
833							ctotal =  ctotal+oto_total; 
834						}
835						currencyCode = $("input[name=currencyCode]").val();
836						localStorage.setItem(local_currencyCode,currencyCode);
837						localStorage.setItem(local_orderTotal,ctotal);
838						tcode = '<hr><div class="row"  style="margin: 0px;">\
839											<div class="col">\
840								                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
841								            </div>\
842								            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(ctotal.toFixed(2))+'</div>\
843										</div>';
844						$("[data-id='summary_total']").html(tcode);
845						couponcode = $("input[name='couponcode']").val();
846						if(couponcode)
847						{
848							checkCoupon(couponcode,packageid);
849						}
850						
851			       	}
852		       })
853			})
854	  	  	$(document).on('change','[data-name=package]',function(){
855	  	  		ctotal = 0;
856	  	  		packageid = $(this).val();
857	  	  		$(".paymentplan").hide();
858	  	  		$("#plan"+packageid).show();
859	  	  		planid = $('input[name="select_order_package"]:checked').val();
860	  	  		country = '';
861	  	  		$('[name="country"]').each(function(){
862						temp_val = $(this).val();
863						if(temp_val)
864						{
865							country = temp_val
866						}
867				})
868	  	  		str3 = 'packageid='+packageid+'&ppid='+planid+'&country='+country;
869	  	  		$.ajax({
870			        type: "POST",     	 
871				    url: url1+'get_package.php',	
872				    data:str3,	
873				    async: true,       
874			    	success: function(data){
875			    		ifUsePackageResponse(data);
876			    		package	 = package_detail[0];
877			    		price = package_detail[1];
878			    		shipping = package_detail[2];
879			    		if(!(shipping))
880			    		{
881			    			shipping = 0;
882			    		}
883			    		localStorage.setItem(local_shipping,shipping);
884			    		currencyCode = package_detail[3];
885			    		localStorage.setItem(local_currencyCode,currencyCode);
886			    		price2 = package_detail[4];
887			    		localStorage.setItem(local_package_price,price2);
888			    		$("#dynamic_package").html(package);
889			    		$("#dynamic_package_price").html(numberWithCommas(price));
890			    		selectid = $('[data-name=package]').val(); 
891		    			selectType= $('[data-name=package]').find(':selected').attr('data-type');
892		    			plantype = $('[data-packageid='+selectid+']').attr('data-plantype');
893		    			is_quantity =$('input[name="select_order_package"]:checked').attr('data-isquantity');
894			    		$("[name=order_select_quantity]").val('1');
895			    		if(selectType == 'p' && plantype == 'o' && is_quantity == '1')
896		    			{
897		    				$("[data-id=order_select_quantity]").show();
898
899		    			}
900		    			else
901		    			{
902		    				$("[data-id=order_select_quantity]").hide();
903		    				$("[name=order_select_quantity]").val('1');
904		    			}
905		    			quanity = $('[name=order_select_quantity]').val();
906		    			if(quanity > 1)
907		    			{
908		    				$("#dynamic_quantiy").remove();
909		    				$("#dynamic_package").parent('div').append('<font id="dynamic_quantiy" class="cursorgrab">&nbsp;x'+quanity+'</font>');
910		    			}
911		    			else
912		    			{
913		    				$("#dynamic_quantiy").remove();
914		    			}
915			  	  		if(shipping > 0)
916		    			{
917		    				shippingFixed = parseFloat(shipping).toFixed(2);
918
919				    		code = '<div class="row" id="order_shiping" style="margin: 0px;">\
920								<div class="col">\
921					                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Shipping</font>\
922					            </div>\
923					            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(shippingFixed)+'</div>\
924							</div>';
925							$("[data-id=summary_shipping_detail]").html(code);
926		    			}
927		    			else
928		    			{
929		    				$("[data-id=summary_shipping_detail]").html('');
930		    			}
931		    			ctotal = ctotal+parseFloat(price2)+parseFloat(shipping);
932		    			bump_total = 0;
933		    			if(localStorage.getItem(local_order_bumps))
934		    			{
935			    			order_bumps =localStorage.getItem(local_order_bumps);
936			    			order_bumps = order_bumps.trim();
937			    			order_bumps = order_bumps.slice(0, -1);
938							if(order_bumps != '')
939							{
940								bumps_array = order_bumps.split(',');
941								for (i=0; i<bumps_array.length;i++) {
942									bumps_id = bumps_array[i];
943									bumps_id = bumps_id.trim();
944				    				bump_item_name = "f_"+siteid+"_"+'bump_pirce_'+bumps_id;
945				    				bump_price = (localStorage.getItem(bump_item_name));
946				    				bump_price = parseFloat(bump_price);   
947				    				bump_total = bump_total+bump_price;
948								}
949								ctotal = ctotal+bump_total;
950							}
951							
952						}
953			  	  		oto_total = 0;
954			  	  		if(localStorage.getItem(local_oto_detials))
955			  	  		{
956				  	  		oto_detials = localStorage.getItem(local_oto_detials);
957							oto_detials = oto_detials.trim();
958							oto_detials = oto_detials.slice(0, -1);
959							if(oto_detials != '')
960							{
961								$(".summary_order_oto").remove();
962								oto_array = oto_detials.split(',');
963								for (i=0; i<oto_array.length;i++) {
964									oto_id = oto_array[i];
965									oto_id = oto_id.trim();
966									oto_title = localStorage.getItem('f_'+siteid+'_'+oto_id+"_title");
967									oto_price = parseFloat(localStorage.getItem('f_'+siteid+'_'+oto_id+"_price")).toFixed(2);
968						    		oto_code = '<div class="row summary_order_oto" id="summary_order_oto_'+oto_id+'" style="margin: 0px;">\
969										<div class="col">\
970							                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_title+'</font>\
971							            </div>\
972							            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(oto_price)+'</div>\
973									</div>';
974									$("[data-id='summary_bump_detail']").after(oto_code);
975				    				oto_price = parseFloat(oto_price);   
976				    				oto_total = oto_total+oto_price;
977								}
978							}
979							ctotal =  ctotal+oto_total; 
980						}
981						currencyCode = $("input[name=currencyCode]").val();
982						localStorage.setItem(local_currencyCode,currencyCode);
983						localStorage.setItem(local_orderTotal,ctotal);
984						tcode = '<hr><div class="row"  style="margin: 0px;">\
985											<div class="col">\
986								                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
987								            </div>\
988								            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(ctotal.toFixed(2))+'</div>\
989										</div>';
990						$("[data-id='summary_total']").html(tcode);
991						couponcode = $("input[name='couponcode']").val();
992						if(couponcode)
993						{
994							checkCoupon(couponcode,packageid);
995						}
996						
997			       	}
998		        });
999	  	  		selectid = $('[data-name=package]').val(); 
1000	  	  		selectType= $('[data-name=package]').find(':selected').attr('data-type');
1001	  	  		plantype = $('[data-packageid='+selectid+']').attr('data-plantype');
1002	  	  		is_quantity =$('input[name="select_order_package"]:checked').attr('data-isquantity');
1003			    $("[name=order_select_quantity]").val('1');
1004			    if(selectType == 'p' && plantype == 'o' && is_quantity == '1')
1005	  	  		{
1006	  	  			$("[data-id=order_select_quantity]").show();
1007
1008	  	  		}
1009	  	  		else
1010	  	  		{
1011	  	  			$("[data-id=order_select_quantity]").hide();
1012	  	  			$("[name=order_select_quantity]").val('1');
1013	  	  		}
1014	  	  	})
1015	  	  	// Delegated: radios are injected by get_packages.php after ready()
1016	  	  	$(document).on('change', 'input[name="select_order_package"]', function() {
1017			    packageid = $(this).attr('data-packageid');
1018			    planid = $(this).val();
1019			    country = '';
1020	  	  		$('[name="country"]').each(function(){
1021						temp_val = $(this).val();
1022						if(temp_val)
1023						{
1024							country = temp_val
1025						}
1026				})
1027			    str3 = 'packageid='+packageid+'&ppid='+planid+'&country='+country;
1028	  	  		$.ajax({
1029			        type: "POST",     	 
1030				    url: url1+'get_package.php',	
1031				    data:str3,	
1032				    async: true,       
1033			    	success: function(data){
1034			    		ifUsePackageResponse(data);
1035			    		package	 = package_detail[0];
1036			    		price = package_detail[1];
1037			    		shipping = package_detail[2];
1038			    		currencyCode = package_detail[3] || window.__resolveDisplayCurrency();
1039			    		if (!currencyCode || currencyCode === 'undefined') { currencyCode = '$'; }
1040			    		localStorage.setItem(local_currencyCode, currencyCode);
1041			    		$("input[name=currencyCode]").remove();
1042			    		$('<input type="hidden" name="currencyCode" value="'+currencyCode+'" />').appendTo('body');
1043			    		price2 = package_detail[4];
1044			    		localStorage.setItem(local_package_price,price2);
1045			    		selectid = $('input[name="select_order_package"]:checked').attr('data-packageid');
1046			  	  		selectType= $('input[name="select_order_package"]:checked').attr('data-type');
1047			    		plantype =$('input[name="select_order_package"]:checked').attr('data-plantype');
1048			    		is_quantity =$('input[name="select_order_package"]:checked').attr('data-isquantity');
1049			    		$("[name=order_select_quantity]").val('1');
1050			    		if(selectType == 'p' && plantype == 'o' && is_quantity == '1')
1051			  	  		{
1052			  	  			$("[data-id=order_select_quantity]").show();
1053
1054			  	  		}
1055			  	  		else
1056			  	  		{
1057			  	  			$("[data-id=order_select_quantity]").hide();
1058			  	  			
1059			  	  		}
1060			  	  		if(plantype == 'f')
1061			  	  		{
1062			  	  			$('[data-name="credit-card"]').hide();
1063			  	  		}
1064			  	  		else
1065			  	  		{
1066			  	  			$('[data-name="credit-card"]').show();
1067			  	  		}
1068			  	  		quanity = $('[name=order_select_quantity]').val();
1069			  	  		if(quanity > 1)
1070			  	  		{
1071			  	  			$("#dynamic_quantiy").remove();
1072			  	  			$("#dynamic_package").parent('div').append('<font id="dynamic_quantiy">&nbsp;x'+quanity+'</font>');
1073			  	  		}
1074			  	  		else
1075			  	  		{
1076			  	  			$("#dynamic_quantiy").remove();
1077			  	  		}
1078			    		$("#dynamic_package").html(package);
1079			    		$("#dynamic_package_price").html(numberWithCommas(price));
1080			    		ctotal = 0;
1081			    		if(shipping == '' || shipping == null || typeof shipping === 'undefined')
1082			    		{
1083			    			shipping = 0;
1084			    		}
1085			    		shipping = parseFloat(shipping) || 0;
1086			    		localStorage.setItem(local_shipping,shipping);
1087			  	  		if(shipping > 0)
1088		    			{
1089		    				shippingFixed = parseFloat(shipping).toFixed(2);
1090				    		code = '<div class="row" id="order_shiping" style="margin: 0px;">\
1091								<div class="col">\
1092					                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Shipping</font>\
1093					            </div>\
1094					            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(shippingFixed)+'</div>\
1095							</div>';
1096							$("[data-id=summary_shipping_detail]").html(code);
1097		    			}
1098		    			else
1099		    			{
1100		    				$("[data-id=summary_shipping_detail]").html('');
1101		    			}
1102		    			ctotal = ctotal+(parseFloat(price2) || 0)+shipping;
1103		    			bump_total = 0;
1104		    			if(localStorage.getItem(local_order_bumps))
1105		    			{
1106			    			order_bumps =localStorage.getItem(local_order_bumps);
1107			    			order_bumps = order_bumps.trim();
1108			    			order_bumps = order_bumps.slice(0, -1);
1109							if(order_bumps != '')
1110							{
1111								bumps_array = order_bumps.split(',');
1112								for (i=0; i<bumps_array.length;i++) {
1113									bumps_id = bumps_array[i];
1114									bumps_id = bumps_id.trim();
1115				    				bump_item_name = 'f_'+siteid+'_'+'bump_pirce_'+bumps_id;
1116				    				bump_price = (localStorage.getItem(bump_item_name));
1117				    				bump_price = parseFloat(bump_price) || 0;   
1118				    				bump_total = bump_total+bump_price;
1119								}
1120								ctotal = ctotal+bump_total;
1121							}
1122							
1123						}
1124			  	  		oto_total = 0;
1125			  	  		if(localStorage.getItem(local_oto_detials))
1126			  	  		{
1127			  	  			$(".summary_order_oto").remove();
1128				  	  		oto_detials = localStorage.getItem(local_oto_detials);
1129							oto_detials = oto_detials.trim();
1130							oto_detials = oto_detials.slice(0, -1);
1131							if(oto_detials != '')
1132							{
1133								oto_array = oto_detials.split(',');
1134								for (i=0; i<oto_array.length;i++) {
1135									oto_id = oto_array[i];
1136									oto_id = oto_id.trim();
1137									oto_title = localStorage.getItem('f_'+siteid+'_'+oto_id+"_title");
1138									oto_price = parseFloat(localStorage.getItem('f_'+siteid+'_'+oto_id+"_price"));
1139									if (isNaN(oto_price)) { oto_price = 0; }
1140									oto_price = oto_price.toFixed(2);
1141						    		oto_code = '<div class="row summary_order_oto" id="summary_order_oto_'+oto_id+'" style="margin: 0px;">\
1142										<div class="col">\
1143							                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_title+'</font>\
1144							            </div>\
1145							            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(oto_price)+'</div>\
1146									</div>';
1147									$("[data-id='summary_bump_detail']").after(oto_code);
1148				    				oto_price = parseFloat(oto_price);   
1149				    				oto_total = oto_total+oto_price;
1150								}
1151							}
1152							ctotal =  ctotal+oto_total; 
1153						}
1154						currencyCode = window.__resolveDisplayCurrency();
1155						localStorage.setItem(local_currencyCode,currencyCode);
1156						localStorage.setItem(local_orderTotal,ctotal);
1157						tcode = '<hr><div class="row"  style="margin: 0px;">\
1158											<div class="col">\
1159								                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
1160								            </div>\
1161								            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(ctotal.toFixed(2))+'</div>\
1162										</div>';
1163						$("[data-id='summary_total']").html(tcode);
1164						couponcode = $("input[name='couponcode']").val();
1165						if(couponcode)
1166						{
1167							checkCoupon(couponcode,packageid);
1168						}
1169						
1170			       	}
1171		       })
1172			});
1173	  	  	$('[data-vvveb-button-visibility="hide_until"]').each(function(){
1174	  	  		var $this = $(this);
1175	  	  		time = $(this).attr('data-vvveb-show-after');
1176
1177	  	  		if(!(time))
1178	  	  		{
1179	  	  			time = '0seconds';
1180	  	  		}
1181	  	  		number = parseInt(time);
1182
1183				unit = time.replace(number, '');
1184
1185				until = 0;
1186				if(unit == 'seconds')
1187				{
1188					until = number*1000;
1189				}
1190				else
1191				{
1192					until = number*60*1000;
1193				}
1194				setTimeout(function() { 
1195			        $this.removeAttr('data-vvveb-button-visibility');
1196			    }, until);
1197	  	  	})
1198	  	  	
1199	  	  	$(document).on('change','[name="order_select_quantity"]',function(){
1200			    packageid =  $('input[name="select_order_package"]:checked').attr('data-packageid');
1201	  	  		planid = $('input[name="select_order_package"]:checked').val();
1202			    country = '';
1203			    thisQauntity = $(this).val();
1204	  	  		$('[name="country"]').each(function(){
1205						temp_val = $(this).val();
1206						if(temp_val)
1207						{
1208							country = temp_val
1209						}
1210				})
1211			    str3 = 'packageid='+packageid+'&ppid='+planid+'&country='+country;
1212	  	  		$.ajax({
1213			        type: "POST",     	 
1214				    url: url1+'get_package.php',	
1215				    data:str3,	
1216				    async: true,       
1217			    	success: function(data){
1218			    		ifUsePackageResponse(data);
1219			    		package	 = package_detail[0];
1220			    		price = package_detail[1];
1221			    		shipping = package_detail[2];
1222			    		price2 = package_detail[4];
1223			    		localStorage.setItem(local_package_price,price2);
1224			    		selectid = $('input[name="select_order_package"]:checked').attr('data-packageid');
1225			  	  		selectType= $('input[name="select_order_package"]:checked').attr('data-type');
1226			    		plantype =$('input[name="select_order_package"]:checked').attr('data-plantype');
1227			    		is_quantity =$('input[name="select_order_package"]:checked').attr('data-isquantity');
1228			    		//$("[name=order_select_quantity]").val('1');
1229			    		if(selectType == 'p' && plantype == 'o' && is_quantity == '1')
1230			  	  		{
1231			  	  			$("[data-id=order_select_quantity]").show();
1232
1233			  	  		}
1234			  	  		else
1235			  	  		{
1236			  	  			$("[data-id=order_select_quantity]").hide();
1237			  	  			
1238			  	  		}
1239			  	  		if(plantype == 'f')
1240			  	  		{
1241			  	  			$('[data-name="credit-card"]').hide();
1242			  	  		}
1243			  	  		else
1244			  	  		{
1245			  	  			$('[data-name="credit-card"]').show();
1246			  	  		}
1247			  	  		quanity = thisQauntity;
1248			  	  		if(quanity > 1)
1249			  	  		{
1250			  	  			
1251							price2 = (parseFloat(price2)*parseFloat(quanity));
1252							price = parseFloat(price2).toFixed(2);
1253			  	  			$("#dynamic_quantiy").remove();
1254			  	  			$("#dynamic_package").parent('div').append('<font id="dynamic_quantiy">&nbsp;x'+quanity+'</font>');
1255			  	  		}
1256			  	  		else
1257			  	  		{
1258			  	  			$("#dynamic_quantiy").remove();
1259			  	  		}
1260			    		$("#dynamic_package").html(package);
1261			    		currencyCode = $("input[name=currencyCode]").val();
1262			    		$("#dynamic_package_price").html(currencyCode+numberWithCommas(price))
1263			    		ctotal = 0;
1264			    		if(shipping == '')
1265			    		{
1266			    			shipping = 0;
1267			    		}
1268			    		localStorage.setItem(local_shipping,shipping);
1269			  	  		if(shipping > 0)
1270		    			{
1271		    				shippingFixed = parseFloat(shipping).toFixed(2);
1272				    		code = '<div class="row" id="order_shiping" style="margin: 0px;">\
1273								<div class="col">\
1274					                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Shipping</font>\
1275					            </div>\
1276					            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(shippingFixed)+'</div>\
1277							</div>';
1278							$("[data-id=summary_shipping_detail]").html(code);
1279		    			}
1280		    			else
1281		    			{
1282		    				$("[data-id=summary_shipping_detail]").html('');
1283		    			}
1284		    			ctotal = ctotal+parseFloat(price2)+parseFloat(shipping);
1285		    			bump_total = 0;
1286		    			if(localStorage.getItem(local_order_bumps))
1287		    			{
1288			    			order_bumps =localStorage.getItem(local_order_bumps);
1289			    			order_bumps = order_bumps.trim();
1290			    			order_bumps = order_bumps.slice(0, -1);
1291							if(order_bumps != '')
1292							{
1293								bumps_array = order_bumps.split(',');
1294								for (i=0; i<bumps_array.length;i++) {
1295									bumps_id = bumps_array[i];
1296									bumps_id = bumps_id.trim();
1297				    				bump_item_name = 'f_'+siteid+'_'+'bump_pirce_'+bumps_id;
1298				    				bump_price = (localStorage.getItem(bump_item_name));
1299				    				bump_price = parseFloat(bump_price);   
1300				    				bump_total = bump_total+bump_price;
1301								}
1302								ctotal = ctotal+bump_total;
1303							}
1304							
1305						}
1306			  	  		oto_total = 0;
1307			  	  		if(localStorage.getItem(local_oto_detials))
1308			  	  		{
1309			  	  			$(".summary_order_oto").remove();
1310				  	  		oto_detials = localStorage.getItem(local_oto_detials);
1311							oto_detials = oto_detials.trim();
1312							oto_detials = oto_detials.slice(0, -1);
1313							if(oto_detials != '')
1314							{
1315								oto_array = oto_detials.split(',');
1316								for (i=0; i<oto_array.length;i++) {
1317									oto_id = oto_array[i];
1318									oto_id = oto_id.trim();
1319									oto_title = localStorage.getItem('f_'+siteid+'_'+oto_id+"_title");
1320									oto_price = parseFloat(localStorage.getItem('f_'+siteid+'_'+oto_id+"_price")).toFixed(2);
1321						    		oto_code = '<div class="row summary_order_oto" id="summary_order_oto_'+oto_id+'" style="margin: 0px;">\
1322										<div class="col">\
1323							                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_title+'</font>\
1324							            </div>\
1325							            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(oto_price)+'</div>\
1326									</div>';
1327									$("[data-id='summary_bump_detail']").after(oto_code);
1328				    				oto_price = parseFloat(oto_price);   
1329				    				oto_total = oto_total+oto_price;
1330								}
1331							}
1332							ctotal =  ctotal+oto_total; 
1333						}
1334						currencyCode = $("input[name=currencyCode]").val();
1335						localStorage.setItem(local_currencyCode,currencyCode);
1336						localStorage.setItem(local_orderTotal,ctotal);
1337						tcode = '<hr><div class="row"  style="margin: 0px;">\
1338											<div class="col">\
1339								                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
1340								            </div>\
1341								            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(ctotal.toFixed(2))+'</div>\
1342										</div>';
1343						$("[data-id='summary_total']").html(tcode);
1344						couponcode = $("input[name='couponcode']").val();
1345						if(couponcode)
1346						{
1347							checkCoupon(couponcode,packageid);
1348						}
1349						
1350			       	}
1351		       })
1352
1353	  	  	})
1354	  	  	$(document).on('change','input[name="order_bump_check"]',function(){
1355	  	  		bump_id= $(this).attr('data-vvveb-bump-id');
1356	  	  		if($(this).prop('checked') == true)
1357				{
1358					$('input[data-vvveb-bump-id="'+bump_id+'"]').prop('checked', true);
1359					data = {'packageid':bump_id};
1360			        var pp = url1+"add_order_bump.php";
1361					$.ajax({
1362							type: 'POST',
1363							data : data,
1364							url: pp,
1365							async: true,
1366							success: function(data){
1367								if(localStorage.getItem(local_order_bumps))
1368								{
1369									localStorage.setItem(local_order_bumps,localStorage.getItem(local_order_bumps)+bump_id+",");
1370								}
1371								else
1372								{
1373									localStorage.setItem(local_order_bumps,bump_id+",");
1374								}
1375
1376								ifUseBumpResponse(data);
1377					    		oto_name   = oto_detail[0];
1378					    		oto_price = oto_detail[1];
1379					    		
1380					    		code = '<div class="row" id="summary_order_bump_'+bump_id+'" style="margin: 0px;">\
1381									<div class="col">\
1382						                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_name+'</font>\
1383						            </div>\
1384						            <div class="col text-right" style="color: #000000;">'+numberWithCommas(oto_price)+'</div>\
1385								</div>';
1386								$("[data-id='summary_bump_detail']").append(code);
1387								bump_price = oto_detail[2];
1388								bump_price_name = 'f_'+siteid+'_'+"bump_pirce_"+bump_id;
1389								localStorage.setItem(bump_price_name, bump_price);
1390								btotal = localStorage.getItem(local_orderTotal);
1391								btotal = parseFloat(btotal)+parseFloat(bump_price);
1392								currencyCode = $("input[name=currencyCode]").val();
1393								localStorage.setItem(local_currencyCode,currencyCode);
1394								bcode = '<hr><div class="row"  style="margin: 0px;">\
1395													<div class="col">\
1396										                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
1397										            </div>\
1398										            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(btotal.toFixed(2))+'</div>\
1399												</div>';
1400								$("[data-id='summary_total']").html(bcode);
1401								localStorage.setItem(local_orderTotal,btotal);
1402
1403						}
1404					});
1405				}
1406				else
1407				{
1408					$('input[data-vvveb-bump-id="'+bump_id+'"]').prop('checked', false);
1409					data = {'packageid':bump_id};
1410					var pp = url1+"remove_order_bump.php";
1411					$.ajax({
1412						type: 'POST',
1413						data : data,
1414						url: pp,
1415						async: true,
1416						data: data,
1417						success: function(data)
1418						{
1419							bumps = localStorage.getItem(local_order_bumps);
1420							search = bump_id+',';
1421							bumps = bumps.replace(search,' ');
1422							localStorage.setItem(local_order_bumps,bumps);
1423							$("#summary_order_bump_"+bump_id).remove();
1424						}
1425 					});
1426
1427 					bump_price_name = 'f_'+siteid+'_'+"bump_pirce_"+bump_id;
1428 					bump_price = (localStorage.getItem(bump_price_name));
1429 					localStorage.removeItem(bump_price_name);
1430 					btotal = localStorage.getItem(local_orderTotal);
1431 					btotal = parseFloat(btotal)-parseFloat(bump_price);
1432 					localStorage.setItem(local_orderTotal,btotal);
1433 					currencyCode = $("input[name=currencyCode]").val();
1434 					localStorage.setItem(local_currencyCode,currencyCode);
1435 					bcode = '<hr><div class="row"  style="margin: 0px;">\
1436 										<div class="col">\
1437 							                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
1438 							            </div>\
1439 							            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(btotal.toFixed(2))+'</div>\
1440 									</div>';
1441 					$("[data-id='summary_total']").html(bcode);
1442				}
1443				couponcode = $("input[name='couponcode']").val();
1444				if(couponcode)
1445				{
1446					checkCoupon(couponcode,packageid);
1447				}
1448	  	  	})
1449	  	  	$(document).on("click","#gotoStep1",function(){
1450	  	  		$('input[name="2stepoptin"]').val('step1');
1451				$( "#menu1" ).removeClass('active');
1452		        $( "#uptab2" ).removeClass('active');
1453		        $( "#home" ).addClass('active');
1454		        $( "#uptab1" ).addClass('active');
1455	  	  	})
1456	  	  	$(document).on('click','[data-vvveb-image-link]',function(){
1457	  	  		url = $(this).attr('data-vvveb-image-link');
1458	  	  		target = $(this).attr('data-vvveb-image-link-target');
1459	  	  		if(target)
1460	  	  		{
1461	  	  			if(target == '_blank')
1462	  	  			{
1463	  	  				$('body').append('<a href="'+url+'" target="_blank" id="tempAnchor"></a>');
1464	  	  				$('#tempAnchor')[0].click();
1465	  	  			}
1466	  	  			else
1467	  	  			{
1468	  	  				 window.location = url;
1469	  	  			}
1470	  	  		}
1471	  	  		else
1472	  	  		{
1473	  	  			 window.location = url;	
1474	  	  		}
1475	  	    })
1476	  	  	$('div[id*="section"]').each(function( index ) {
1477			  $( this ).removeAttr('class');
1478			  $( this ).removeAttr('spellcheck');
1479			  $( this ).removeAttr('role');
1480			  $( this ).removeAttr('aria-label');
1481			  $( this ).removeAttr('title');
1482			  $( this ).removeAttr('style');
1483			});
1484			if(localStorage.getItem(local_name))
1485			{
1486				temp = localStorage.getItem(local_name);
1487				temp = temp.replaceAll( "**sq**","'");
1488				temp = temp.replaceAll( "**dq**",'"');
1489				temp = temp.replaceAll( "**et**",'=');
1490				temp = temp.replaceAll( "**as**","&");
1491				localStorage.setItem(local_name,temp);
1492				$('input[name="name"]').val(localStorage.getItem(local_name));
1493				fbName1 = localStorage.getItem(local_name);
1494			}
1495			if(localStorage.getItem(local_lName))
1496			{
1497				temp = localStorage.getItem(local_lName);
1498				temp = temp.replaceAll( "**sq**","'");
1499				temp = temp.replaceAll( "**dq**",'"');
1500				temp = temp.replaceAll( "**et**",'=');
1501				temp = temp.replaceAll( "**as**","&");
1502				localStorage.setItem(local_lName,temp);
1503				$('input[name="lName"]').val(localStorage.getItem(local_lName));
1504				fbName2 = localStorage.getItem(local_lName);
1505			}
1506			if(localStorage.getItem(local_lastname))
1507			{
1508				temp = localStorage.getItem(local_lastname);
1509				temp = temp.replaceAll( "**sq**","'");
1510				temp = temp.replaceAll( "**dq**",'"');
1511				temp = temp.replaceAll( "**et**",'=');
1512				temp = temp.replaceAll( "**as**","&");
1513				localStorage.setItem(local_lastname,temp);
1514				$('input[name="lastname"]').val(localStorage.getItem(local_lastname));
1515				fbName3 = localStorage.getItem(local_lastname);
1516			}
1517			if(localStorage.getItem(local_email))
1518			{
1519				temp = localStorage.getItem(local_email);
1520				temp = temp.replaceAll( "**sq**","'");
1521				temp = temp.replaceAll( "**dq**",'"');
1522				temp = temp.replaceAll( "**et**",'=');
1523				temp = temp.replaceAll( "**as**","&");
1524				localStorage.setItem(local_email,temp);
1525				$('input[name="email"]').val(localStorage.getItem(local_email));
1526				fbEmail = localStorage.getItem(local_email);
1527			}
1528			if(localStorage.getItem(local_address))
1529			{
1530				temp = localStorage.getItem(local_address);
1531				temp = temp.replaceAll( "**sq**","'");
1532				temp = temp.replaceAll( "**dq**",'"');
1533				temp = temp.replaceAll( "**et**",'=');
1534				temp = temp.replaceAll( "**as**","&");
1535				localStorage.setItem(local_address,temp);
1536				$('input[name="address"]').val(localStorage.getItem(local_address));
1537			}
1538			if(localStorage.getItem(local_address1))
1539			{
1540				temp = localStorage.getItem(local_address1);
1541				temp = temp.replaceAll( "**sq**","'");
1542				temp = temp.replaceAll( "**dq**",'"');
1543				temp = temp.replaceAll( "**et**",'=');
1544				temp = temp.replaceAll( "**as**","&");
1545				localStorage.setItem(local_address1,temp);
1546				$('input[name="address1"]').val(localStorage.getItem(local_address1));
1547			}
1548			if(localStorage.getItem(local_address2))
1549			{
1550				temp = localStorage.getItem(local_address2);
1551				temp = temp.replaceAll( "**sq**","'");
1552				temp = temp.replaceAll( "**dq**",'"');
1553				temp = temp.replaceAll( "**et**",'=');
1554				temp = temp.replaceAll( "**as**","&");
1555				localStorage.setItem(local_address2,temp);
1556				$('input[name="address2"]').val(localStorage.getItem(local_address2));
1557			}
1558			if(localStorage.getItem(local_cellphonenumber))
1559			{
1560				temp = localStorage.getItem(local_cellphonenumber);
1561				temp = temp.replaceAll( "**sq**","'");
1562				temp = temp.replaceAll( "**dq**",'"');
1563				temp = temp.replaceAll( "**et**",'=');
1564				temp = temp.replaceAll( "**as**","&");
1565				localStorage.setItem(local_cellphonenumber,temp);
1566				$('input[name="cellphonenumber"]').val(localStorage.getItem(local_cellphonenumber));
1567				fbPhone = localStorage.getItem(local_cellphonenumber);
1568			}
1569			if(localStorage.getItem(local_city))
1570			{
1571				temp = localStorage.getItem(local_city);
1572				temp = temp.replaceAll( "**sq**","'");
1573				temp = temp.replaceAll( "**dq**",'"');
1574				temp = temp.replaceAll( "**et**",'=');
1575				temp = temp.replaceAll( "**as**","&");
1576				localStorage.setItem(local_city,temp);
1577				$('input[name="city"]').val(localStorage.getItem(local_city));
1578				fbCity = localStorage.getItem(local_city);
1579			}
1580			if(localStorage.getItem(local_state))
1581			{
1582				temp = localStorage.getItem(local_state);
1583				temp = temp.replaceAll( "**sq**","'");
1584				temp = temp.replaceAll( "**dq**",'"');
1585				temp = temp.replaceAll( "**et**",'=');
1586				temp = temp.replaceAll( "**as**","&");
1587				localStorage.setItem(local_state,temp);
1588				$('input[name="state"]').val(localStorage.getItem(local_state));
1589			}
1590			if(localStorage.getItem(local_zip))
1591			{
1592				temp = localStorage.getItem(local_zip);
1593				temp = temp.replaceAll( "**sq**","'");
1594				temp = temp.replaceAll( "**dq**",'"');
1595				temp = temp.replaceAll( "**et**",'=');
1596				temp = temp.replaceAll( "**as**","&");
1597				localStorage.setItem(local_zip,temp);
1598				$('input[name="zip"]').val(localStorage.getItem(local_zip));
1599			}
1600			if(localStorage.getItem(local_country))
1601			{
1602				$('select[name="country"]').val(localStorage.getItem(local_country));
1603				packageid =  $('input[name="select_order_package"]:checked').attr('data-packageid');
1604	  	  		planid = $('input[name="select_order_package"]:checked').val();
1605	  	  		country = localStorage.getItem(local_country);
1606	  	  		if(pagetype == 'order')
1607	  	  		{
1608		  	  		str3 = 'packageid='+packageid+'&ppid='+planid+'&country='+country;
1609					$.ajax({
1610				        type: "POST",     	 
1611					    url: url1+'get_package.php',	
1612					    data:str3,	
1613					    async: true,       
1614				    	success: function(data){
1615				    		ifUsePackageResponse(data);
1616				    		package	 = package_detail[0];
1617				    		price = package_detail[1];
1618				    		shipping = package_detail[2];
1619				    		price2 = package_detail[4];
1620				    		localStorage.setItem(local_package_price,price2);
1621				    		selectid = $('input[name="select_order_package"]:checked').attr('data-packageid');
1622				  	  		selectType= $('input[name="select_order_package"]:checked').attr('data-type');
1623				    		plantype =$('input[name="select_order_package"]:checked').attr('data-plantype');
1624				    		is_quantity =$('input[name="select_order_package"]:checked').attr('data-isquantity');
1625				    		$("[name=order_select_quantity]").val('1');
1626				    		if(selectType == 'p' && plantype == 'o' && is_quantity == '1')
1627				  	  		{
1628				  	  			$("[data-id=order_select_quantity]").show();
1629
1630				  	  		}
1631				  	  		else
1632				  	  		{
1633				  	  			$("[data-id=order_select_quantity]").hide();
1634				  	  			
1635				  	  		}
1636				  	  		if(plantype == 'f')
1637				  	  		{
1638				  	  			$('[data-name="credit-card"]').hide();
1639				  	  		}
1640				  	  		else
1641				  	  		{
1642				  	  			$('[data-name="credit-card"]').show();
1643				  	  		}
1644				  	  		quanity = $('[name=order_select_quantity]').val();
1645				  	  		if(quanity > 1)
1646				  	  		{
1647				  	  			$("#dynamic_quantiy").remove();
1648				  	  			$("#dynamic_package").parent('div').append('<font id="dynamic_quantiy">&nbsp;x'+quanity+'</font>');
1649				  	  		}
1650				  	  		else
1651				  	  		{
1652				  	  			$("#dynamic_quantiy").remove();
1653				  	  		}
1654				    		$("#dynamic_package").html(package);
1655				    		$("#dynamic_package_price").html(numberWithCommas(price));
1656				    		ctotal = 0;
1657				    		if(shipping == '')
1658				    		{
1659				    			shipping = 0;
1660				    		}
1661				    		localStorage.setItem(local_shipping,shipping);
1662				  	  		if(shipping > 0)
1663			    			{
1664			    				shippingFixed = parseFloat(shipping).toFixed(2);
1665					    		code = '<div class="row" id="order_shiping" style="margin: 0px;">\
1666									<div class="col">\
1667						                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Shipping</font>\
1668						            </div>\
1669						            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(shippingFixed)+'</div>\
1670								</div>';
1671								$("[data-id=summary_shipping_detail]").html(code);
1672			    			}
1673			    			else
1674			    			{
1675			    				$("[data-id=summary_shipping_detail]").html('');
1676			    			}
1677			    			ctotal = ctotal+parseFloat(price2)+parseFloat(shipping);
1678			    			bump_total = 0;
1679			    			if(localStorage.getItem(local_order_bumps))
1680			    			{
1681				    			order_bumps =localStorage.getItem(local_order_bumps);
1682				    			order_bumps = order_bumps.trim();
1683				    			order_bumps = order_bumps.slice(0, -1);
1684								if(order_bumps != '')
1685								{
1686									bumps_array = order_bumps.split(',');
1687									for (i=0; i<bumps_array.length;i++) {
1688										bumps_id = bumps_array[i];
1689										bumps_id = bumps_id.trim();
1690					    				bump_item_name = 'f_'+siteid+'_'+'bump_pirce_'+bumps_id;
1691					    				bump_price = (localStorage.getItem(bump_item_name));
1692					    				bump_price = parseFloat(bump_price);   
1693					    				bump_total = bump_total+bump_price;
1694									}
1695									ctotal = ctotal+bump_total;
1696								}
1697								
1698							}
1699				  	  		oto_total = 0;
1700				  	  		if(localStorage.getItem(local_oto_detials))
1701				  	  		{
1702				  	  			$(".summary_order_oto").remove();
1703					  	  		oto_detials = localStorage.getItem(local_oto_detials);
1704								oto_detials = oto_detials.trim();
1705								oto_detials = oto_detials.slice(0, -1);
1706								if(oto_detials != '')
1707								{
1708									oto_array = oto_detials.split(',');
1709									for (i=0; i<oto_array.length;i++) {
1710										oto_id = oto_array[i];
1711										oto_id = oto_id.trim();
1712										oto_title = localStorage.getItem('f_'+siteid+'_'+oto_id+"_title");
1713										oto_price = parseFloat(localStorage.getItem('f_'+siteid+'_'+oto_id+"_price")).toFixed(2);
1714							    		oto_code = '<div class="row summary_order_oto" id="summary_order_oto_'+oto_id+'" style="margin: 0px;">\
1715											<div class="col">\
1716								                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">'+oto_title+'</font>\
1717								            </div>\
1718								            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(oto_price)+'</div>\
1719										</div>';
1720										$("[data-id='summary_bump_detail']").after(oto_code);
1721					    				oto_price = parseFloat(oto_price);   
1722					    				oto_total = oto_total+oto_price;
1723									}
1724								}
1725								ctotal =  ctotal+oto_total; 
1726							}
1727							currencyCode = $("input[name=currencyCode]").val();
1728							localStorage.setItem(local_currencyCode,currencyCode);
1729							localStorage.setItem(local_orderTotal,ctotal);
1730							tcode = '<hr><div class="row"  style="margin: 0px;">\
1731												<div class="col">\
1732									                 <font  style="vertical-align: inherit;font-size: small;color: #000000;">Total</font>\
1733									            </div>\
1734									            <div class="col text-right" style="color: #000000;">'+currencyCode+numberWithCommas(ctotal.toFixed(2))+'</div>\
1735											</div>';
1736							$("[data-id='summary_total']").html(tcode);
1737							couponcode = $("input[name='couponcode']").val();
1738							if(couponcode)
1739							{
1740								checkCoupon(couponcode,packageid);
1741							}
1742							
1743				       	}
1744			        })
1745				}
1746			}
1747			for (var i =0; i <= 20; i++) {
1748				custom_name = 'f_'+siteid+'_'+'customfield'+i+'_value';
1749				if(localStorage.getItem(custom_name))
1750				{
1751					custom_name2 = 'custom'+i;
1752					temp = localStorage.getItem(custom_name);
1753					temp = temp.replaceAll( "**sq**","'");
1754					temp = temp.replaceAll( "**dq**",'"');
1755					temp = temp.replaceAll( "**et**",'=');
1756					temp = temp.replaceAll( "**as**","&");
1757					localStorage.setItem(custom_name,temp);
1758					$('[name='+custom_name2+']').val(localStorage.getItem(custom_name));
1759				}
1760			}
1761			gatewayCode = $("#gateways_temp").html();
1762			$("#gateways #gateway_option").html(gatewayCode);
1763			$("#gateways_temp").remove();
1764			selected_val = $('select[name="gateway"]').val();
1765
1766			if($('#creditcard').prop('checked') || (selected_val && selected_val != '18' && selected_val != '5' &&  selected_val != '19' && selected_val != '23'))  
1767			{ 
1768				$("#creditcardfields").show();
1769			}
1770			else
1771			{
1772				$("#creditcardfields").hide();
1773			}
1774			if($('#bankTransfer').prop('checked') || selected_val == '23') 
1775			{ 
1776
1777				$("#bank_transfer_fields").show();
1778			}
1779			else
1780			{
1781				$("#bank_transfer_fields").hide();
1782			}
1783			if($('#EPTransfer').prop('checked') || selected_val == '25') 
1784			{ 
1785
1786				$("#ep_transfer_fields").show();
1787			}
1788			else
1789			{
1790				$("#ep_transfer_fields").hide();
1791			}
1792			$('input[type=radio][name=gateway],select[name=gateway]').change(function() {
1793				try { ifEnsureCodPhoneField(); } catch (eGw) {}
1794				if(this.value)
1795				{
1796				    if (this.value == '18' || this.value == '5' || this.value == '19' || this.value == '23') {
1797				       $("#creditcardfields").hide();
1798				    }
1799				    else {
1800				       $("#creditcardfields").show();
1801				    }
1802				    if (this.value == '23') {
1803				       $("#bank_transfer_fields").show();
1804				    }
1805				    else {
1806				     	$("#bank_transfer_fields").hide();
1807				    }
1808				    if (this.value == '25') {
1809				       $("#ep_transfer_fields").show();
1810				    }
1811				    else {
1812				     	$("#ep_transfer_fields").hide();
1813				    }
1814			    }
1815			    else
1816			    {
1817			    	$("#creditcardfields").hide();
1818			    	$("#bank_transfer_fields").hide();
1819			    	$("#ep_transfer_fields").hide();
1820			    }
1821			});
1822
1823	  	  });
1824	  	  if(isredirect == "on")
1825	  	  {
1826	  	  	var time = redirectTime * 1000;
1827	  	  	setTimeout(function () {
1828			   window.location.href = redirectUrl; //will redirect to your blog page (an ex: blog.html)
1829			}, time);
1830	  	  }
1831	  

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.