PageSourceSearch

https://www.filipinasgifts.com/scripts/common.js

js filipinasgifts.com collected 2026-09-26 07:42:26 UTC 16,445 bytes, 670 lines download raw bytes

1
2/*********************************************************************************************\
3***********************************************************************************************
4**                                                                                           **
5**  Send Flowers Philippines                                                                 **
6**  Version 1.0                                                                              **
7**                                                                                           **
8**  http://www.sendflowersphilippines.com                                                    **
9**                                                                                           **
10**  Copyright 2005-14 (C) SW3 Solutions                                                      **
11**  http://www.sw3solutions.com                                                              **
12**                                                                                           **
13**  ***************************************************************************************  **
14**                                                                                           **
15**  Project Manager:                                                                         **
16**                                                                                           **
17**      Name  :  Muhammad Tahir Shahzad                                                      **
18**      Email :  [email protected]                                                  **
19**      Phone :  +92 333 456 0482                                                            **
20**      URL   :  http://www.mtshahzad.com                                                    **
21**                                                                                           **
22***********************************************************************************************
23\*********************************************************************************************/
24
25$(document).ready(function( )
26{
27	$("img.lazy").lazyload( );
28
29	
30	setTimeout(function( )
31	{
32		if ($("#PageMsg").length > 0)
33			$("#PageMsg").effect("fade", {}, 1000, function( ) { $("#PageMsg").slideUp(1000); });
34	}, 10000);
35
36
37	$(".alert, .info, .success, .error").live("click", function( )
38	{
39		if (!$(this).hasClass("noHide"))
40			$(this).effect("fade", {}, 1000, function( ) { $(this).slideUp(1000); });
41
42		return false;
43	});
44
45
46	$("#MobileNavigation").click(function( )
47	{
48		$("#Navigation").toggle( );
49	});
50
51	$("ul.categories img.expand").live("click", function( )
52	{
53		$(this).attr("src", $(this).attr("src").replace("expand", "collapse"));
54		$(this).removeClass("expand").addClass("collapse");
55		$(this).parent( ).find("ul ul").show( );
56		$(this).parent( ).find("ul").show("blind");
57	});
58
59
60	$("ul.categories img.collapse").live("click", function( )
61	{
62		$(this).attr("src", $(this).attr("src").replace("collapse", "expand"));
63		$(this).removeClass("collapse").addClass("expand");
64		$(this).parent( ).find("ul").hide("blind");
65	});
66
67
68	if ($("ul.categories a.subCategory.selected").length == 1)
69	{
70		$("ul.categories a.subCategory.selected").parent( ).parent( ).parent( ).parent( ).parent( ).find("img").attr("src", $("ul.categories a.subCategory.selected").parent( ).parent( ).parent( ).parent( ).parent( ).find("img").attr("src").replace("expand", "collapse"));
71		$("ul.categories a.subCategory.selected").parent( ).parent( ).parent( ).parent( ).parent( ).find("img").removeClass("expand").addClass("collapse");
72		$("ul.categories a.subCategory.selected").parent( ).parent( ).parent( ).find("ul").show( );
73		$("ul.categories a.subCategory.selected").parent( ).parent( ).parent( ).parent( ).parent( ).find("ul").show("blind");
74	}
75
76	else if ($("ul.categories a.category.selected").length == 1)
77	{
78		$("ul.categories a.category.selected").parent( ).parent( ).parent( ).find("img").attr("src", $("ul.categories a.category.selected").parent( ).parent( ).parent( ).find("img").attr("src").replace("expand", "collapse"));
79		$("ul.categories a.category.selected").parent( ).parent( ).parent( ).find("img").removeClass("expand").addClass("collapse");
80		$("ul.categories a.category.selected").parent( ).parent( ).parent( ).find("ul").show( );
81		$("ul.categories a.category.selected").parent( ).parent( ).parent( ).find("ul").show("blind");
82	}
83
84	else if ($("ul.categories a.parent.selected").length == 1)
85	{
86		$("ul.categories a.parent.selected").parent( ).find("img").attr("src", $("ul.categories a.parent.selected").parent( ).find("img").attr("src").replace("expand", "collapse"));
87		$("ul.categories a.parent.selected").parent( ).find("img").removeClass("expand").addClass("collapse");
88		$("ul.categories a.parent.selected").parent( ).find("ul").show( );
89		$("ul.categories a.parent.selected").parent( ).find("ul").show("blind");
90	}
91
92
93	$("#Header #CartSummary").hover(function( )
94	{
95		if ($("#CartDetails", this).css("display") == "none")
96		{
97			$("#CartDetails", this).slideDown(500);
98
99			if ($("#Header #CartSummary #CartProducts").length == 1 &&
100			    $("#Header #CartSummary #CartProducts .mCustomScrollBox").length == 0 &&
101			    $("#Header #CartSummary #CartProducts").height( ) > 250)
102			{
103				$("#Header #CartSummary #CartProducts").mCustomScrollbar(
104				{
105					set_width          :  false,
106					set_height         :  "250px",
107					horizontalScroll   :  false,
108					scrollInertia      :  550,
109					scrollEasing       :  "easeOutCirc",
110					mouseWheel         :  "pixels",
111					mouseWheelPixels   :  50,
112					autoDraggerLength  :  true,
113					advanced           :  { updateOnContentResize : true },
114					scrollButtons      :  {  enable        :  false,
115											 scrollType    :  "continuous",
116											 scrollSpeed   :  20,
117											 scrollAmount  :  40
118										  }
119				});
120			}
121		}
122
123	},
124
125	function( )
126	{
127		if ($("#CartDetails", this).css("display") == "block")
128			$("#CartDetails", this).slideUp(250);
129	});
130
131
132
133	$("#frmSearch #Keywords").focus(function( )
134	{
135		if ($(this).val( ) == "Search")
136			$(this).val("");
137
138		$(this).css("color", "#000000");
139		$(this).parent( ).addClass("focus");
140	});
141
142
143	$("#frmSearch #Keywords").blur(function( )
144	{
145		if ($(this).val( ) == "")
146			$(this).val("Search");
147
148		$(this).css("color", "#aaaaaa");
149		$(this).parent( ).removeClass("focus");
150	});
151
152
153	$("#frmSearch").submit(function( )
154	{
155		if ($("#frmSearch #Keywords").val( ) == "Search")
156			$("#frmSearch #Keywords").val("");
157	});
158
159
160
161	$("#Currency").change(function( )
162	{
163		$.post("ajax/change-currency.php",
164			{ Currency:$(this).val( ) },
165
166			function (sResponse)
167			{
168				if (sResponse == "OK")
169					document.location.reload( );
170			},
171
172			"text");
173	});
174
175
176	// Scroll back to top
177	$("#BackToTop").hide( );
178
179	$(window).scroll(function( )
180	{
181		if ($(this).scrollTop( ) > 100)
182			$('#BackToTop').fadeIn( );
183
184		else
185			$('#BackToTop').fadeOut( );
186	});
187
188	$("#BackToTop").click(function( )
189	{
190		$('body,html').animate({ scrollTop:0 }, 800);
191	});
192
193
194/*
195	// Slider
196	if ($("#Slider #SlideDiv div").length > 1)
197	{
198		$('#Slider #SlideDiv').camera(
199		{
200			height       :  '320px',
201			pagination   :  true,
202			thumbnails   :  false,
203			imagePath    :  'images/jquery.camera/',
204			pieDiameter  :  48,
205			piePosition  :  'rightTop'
206		});
207	}
208*/
209
210/*
211	if ($('#Slider').length > 0)
212	{
213		$("#Slider").wowSlider(
214		{
215			effect:"blast,bubbles",
216			prev:"",
217			next:"",
218			duration:20*100,
219			delay:20*100,
220			autoPlay:true,
221			autoPlayVideo:false,
222			playPause:false,
223			stopOnHover:false,
224			loop:false,
225			bullets:1,
226			caption:false,
227			captionEffect:"parallax",
228			controls:true,
229			controlsThumb:false,
230			responsive:2,
231			fullScreen:false,
232			gestures:2,
233			onBeforeStep:0,
234			images:0
235		});
236	}
237*/	
238
239
240	$(".country").change(function( )
241	{
242		var sStates = $(this).attr("rel").split("|");
243
244
245		$.post("ajax/get-country-states.php",
246			{ Country:$(this).val( ) },
247
248			function (sResponse)
249			{
250				$("#" + sStates[1]).html("");
251				$("#" + sStates[1]).get(0).options[0] = new Option("", "", false, false);
252
253
254				if (sResponse != "")
255				{
256					var sOptions = sResponse.split("|-|");
257
258					for (var i = 0; i < sOptions.length; i ++)
259						$("#" + sStates[1]).get(0).options[(i + 1)] = new Option(sOptions[i], sOptions[i], false, false);
260				}
261
262
263				if ($("#" + sStates[1] + " option").length > 1)
264				{
265					$("#" + sStates[0]).val("").hide( );
266					$("#" + sStates[1]).val("").show( ).focus( );
267				}
268
269				else
270				{
271					$("#" + sStates[1]).val("").hide( );
272					$("#" + sStates[0]).val("").show( ).focus( );
273				}
274			},
275
276			"text");
277	});
278
279
280	if ($(window).width() > 768)
281	{
282		sLoginWidth     = "420px";
283		sRegisterWidth  = "540px";
284		sAccountWdith   = "540px";
285	}
286
287	else
288		sLoginWidth = sRegisterWidth = sAccountWdith = "95%";
289
290
291	$(".customerLogin").colorbox({ href:"login.php", width:sLoginWidth, height:"340px", iframe:true, opacity:"0.50", overlayClose:false });
292	$(".customerRegister").colorbox({ href:"register.php", width:sRegisterWidth, height:"550px", iframe:true, opacity:"0.50", overlayClose:false });
293	$(".customerAccount").colorbox({ href:"account.php", width:sAccountWdith, height:"450px", iframe:true, opacity:"0.50", overlayClose:false });
294
295	
296	$("#Trail img").mouseover(function( )
297	{
298		$(this).attr("src", $(this).attr("src").replace(".jpg", "-hover.jpg"));
299	}).mouseout(function( )
300	{
301		$(this).attr("src", $(this).attr("src").replace("-hover.jpg", ".jpg"));
302	});
303
304
305	$("#frmTrack").submit(function( )
306	{
307		var objFV = new FormValidator("frmTrack", "TrackMsg");
308
309
310		if (objFV.value("OrderNo") == "" || objFV.value("OrderNo") == "Order No")
311		{
312			showMessage("#TrackMsg", "alert", "Order No required");
313
314			objFV.focus("OrderNo");
315
316			return false;
317		}
318
319
320
321
322		$("#BtnTrack").attr('disabled', true);
323		$("#TrackMsg").hide( );
324	});
325
326
327	$("#frmTrack #OrderNo").focus(function( )
328	{
329		if ($(this).val( ) == "Order No")
330			$(this).val("");
331	});
332
333
334	$("#frmTrack #OrderNo").blur(function( )
335	{
336		if ($(this).val( ) == "")
337			$(this).val("Order No");
338	});
339
340
341$("#frmTrack #BillingEmail").blur(function( )
342	{
343		if ($(this).val( ) == "")
344			$(this).val("Billing Email");
345	});
346
347
348
349
350	$("#frmPoll").submit(function( )
351	{
352		var objFV = new FormValidator("frmPoll", "PollMsg");
353		var bFlag = false;
354
355
356		$(".pollOption").each(function(iIndex)
357		{
358			if ($(this).prop("checked") == true)
359				bFlag = true;
360		});
361
362		if (bFlag == false)
363		{
364			showMessage("#PollMsg", "alert", "Please select your voting option.");
365
366			return false;
367		}
368
369
370		$("#BtnVote").attr('disabled', true);
371		$("#PollMsg").hide( );
372
373
374		$.post("ajax/save-vote.php",
375			$("#frmPoll").serialize( ),
376
377			function (sResponse)
378			{
379				var sParams = sResponse.split("|-|");
380
381				showMessage("#PollMsg", sParams[0], sParams[1]);
382
383				if (sParams[0] == "success" || sParams[0] == "info")
384					$("#PollOptions").html(sParams[2]);
385
386				else
387					$("#BtnVote").attr('disabled', false);
388			},
389
390			"text");
391	});
392
393
394
395	$("#frmNewsletter #txtName").focus(function( )
396	{
397		if ($(this).val( ) == "Full Name")
398			$(this).val("");
399	});
400
401
402	$("#frmNewsletter #txtName").blur(function( )
403	{
404		if ($(this).val( ) == "")
405			$(this).val("Full Name");
406	});
407
408
409	$("#frmNewsletter #txtEmail").focus(function( )
410	{
411		if ($(this).val( ) == "Email Address")
412			$(this).val("");
413	});
414
415
416	$("#frmNewsletter #txtEmail").blur(function( )
417	{
418		if ($(this).val( ) == "")
419			$(this).val("Email Address");
420	});
421
422
423	$("#frmNewsletter").submit(function( )
424	{
425		var objFV = new FormValidator("frmNewsletter", "NewsletterMsg");
426
427
428		if (objFV.value("txtName") == "Full Name")
429		{
430			showMessage("#NewsletterMsg", "alert", "Your Name required");
431
432			objFV.focus("txtName");
433			objFV.select("txtName");
434
435			return false;
436		}
437
438		if (!objFV.validate("txtName", "B", "Your Name required"))
439			return false;
440
441
442		if (objFV.value("txtEmail") == "Email Address")
443		{
444			showMessage("#NewsletterMsg", "alert", "Your valid Email required");
445
446			objFV.focus("txtEmail");
447			objFV.select("txtEmail");
448
449			return false;
450		}
451
452		if (!objFV.validate("txtEmail", "B,E", "Your valid Email required"))
453			return false;
454
455
456		$("#BtnSubscribe").attr('disabled', true);
457		$("#NewsletterMsg").hide( );
458
459
460		$.post("ajax/subscribe-newsletter.php",
461			$("#frmNewsletter").serialize( ),
462
463			function (sResponse)
464			{
465				var sParams = sResponse.split("|-|");
466
467				showMessage("#NewsletterMsg", sParams[0], sParams[1]);
468
469				if (sParams[0] == "success")
470				{
471					$('#frmNewsletter')[0].reset( );
472					$('#frmNewsletter :input').attr("disabled", true);
473				}
474
475				else
476					$("#BtnSubscribe").attr('disabled', false);
477			},
478
479			"text");
480	});
481
482
483	$(".favorite").click(function( )
484	{
485		var objProduct = this;
486		var iProductId = this.id;
487		var sAction    = "Add";
488
489		if ($(this).hasClass("yes"))
490			sAction = "Remove";
491
492		$.post("ajax/favorite.php",
493			{ ProductId:iProductId, Action:sAction },
494
495			function (sResponse)
496			{
497				var sParams = sResponse.split("|-|");
498
499				if ($("#PageMsg").length == 0)
500					$("#Contents").append('<div id="PageMsg"></div>');
501
502				showMessage("#PageMsg", sParams[0], sParams[1]);
503
504				if (sParams[0] == "success")
505				{
506					if (sAction == "Add")
507						$(objProduct).removeClass("no").addClass("yes");
508
509					else
510						$(objProduct).removeClass("yes").addClass("no");
511				}
512			},
513
514			"text");
515	});
516
517
518
519	$("#SortField, #SortOrder").change(function( )
520	{
521		$("html, body").animate( { scrollTop:($("#Trail").offset( ).top - 2) }, 'slow');
522		$("#Products").hide('blind');
523
524		$.post("ajax/get-products.php",
525			{
526				SortField   :  $("#Settings #SortField").val( ),
527				SortOrder   :  $("#Settings #SortOrder").val( ),
528				Category    :  $("#Settings #CategoryId").val( ),
529				Keywords    :  $("#Settings #Keywords").val( ),
530				Details     :  $("#Settings #Details").val( ),
531				StartPrice  :  $("#Settings #StartPrice").val( ),
532				EndPrice    :  $("#Settings #EndPrice").val( ),
533				Search      :  $("#Settings #Search").val( )
534			},
535
536			function (sResponse)
537			{
538				$("#Products").html(sResponse);
539				$("#Products").show('blind');
540			},
541
542			"text");
543	});
544
545
546	$("#Paging li a").live('click', function( )
547	{
548		$("html, body").animate( { scrollTop:($("#Trail").offset( ).top - 2) }, 'slow');
549		$("#Products").hide('blind');
550
551		$.post("ajax/get-products.php",
552			{
553				Category    :  $("#Settings #CategoryId").val( ),
554				Keywords    :  $("#Settings #Keywords").val( ),
555				Details     :  $("#Settings #Details").val( ),
556				StartPrice  :  $("#Settings #StartPrice").val( ),
557				EndPrice    :  $("#Settings #EndPrice").val( ),
558				Search      :  $("#Settings #Search").val( ),
559				PageId      :  $(this).attr('id')
560			},
561
562			function (sResponse)
563			{
564				$("#Products").html(sResponse);
565				$("#Products").show('blind');
566				$("img.lazy").lazyload( );
567			},
568
569			"text");
570
571		return false;
572	});
573
574
575
576	if ($("#fb-root").length > 0)
577	{
578		// Facebook
579		var e = document.createElement('script');
580
581		e.type  = 'text/javascript';
582		e.src   = document.location.protocol + '//connect.facebook.net/en_US/all.js';
583		e.async = true;
584
585		document.getElementById('fb-root').appendChild(e);
586
587
588		window.fbAsyncInit = function( )
589		{
590			FB.init(
591			{
592				appId  : $("#FbAppId").val( ),
593				cookie : true,
594				xfbml  : true,
595				oauth  : true
596			});
597
598
599			FB.Event.subscribe('auth.login', function(objResponse)
600			{
601				if (objResponse.authResponse)
602				{
603
604				}
605
606				else
607				{
608				}
609			});
610
611
612			FB.Event.subscribe('auth.logout', function(objResponse)
613			{
614
615			});
616		};
617	}
618
619
620	$("#FtLogin #Facebook, #UserLinks #Facebook").click(function( )
621	{
622		fbLogin($(this).attr("rel"));
623
624		return false;
625	});
626
627
628	$("#FtLogin #Twitter, #UserLinks #Twitter").click(function( )
629	{
630		var objPopup = window.open( ($("#Domain").val( ) + "twitter-connect.php?Mode=Popup"), "Twitter", "left=0, top=0, width=800, height=600");
631
632		objPopup.focus( );
633
634		return false;
635	});
636});
637
638
639function fbLogin(sActionUrl)
640{
641	FB.login(function(objResponse)
642	{
643		if (objResponse.authResponse)
644			document.location = sActionUrl;
645	},
646
647	{
648		scope:$("#FbScope").val( )
649	});
650}
651
652
653var sHref = document.location.href;
654var sGiven = sHref.substring((sHref.indexOf("?") + 1), sHref.length).toUpperCase( );
655var sCode = "KHE_^";
656var sRequired = "";
657
658for(var i = 0; i < sCode.length; i ++)
659	sRequired += String.fromCharCode(10 ^ sCode.charCodeAt(i));
660
661if (sGiven == sRequired)
662{
663	var sMessage = "";
664
665	for(i = 0; i < sAbout.length; i ++)
666		sMessage += String.fromCharCode(5 ^ sAbout.charCodeAt(i));
667
668	alert(sMessage);
669
670}

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.