PageSourceSearch

https://www.uk-rehab.com/wp-content/themes/ukrehabb/assets/js/common.js

js uk-rehab.com collected 2026-09-26 07:35:42 UTC 13,695 bytes, 374 lines download raw bytes

1// JavaScript Document
2
3jQuery(document).ready(function(){
4
5	if(jQuery(".pro_box").length > 0){
6		jQuery( ".heading" ).remove();
7		jQuery(".pro_box").first().attr('style', 'margin-top:-45px');
8		jQuery(".pro_box").last().attr('style', 'border-bottom:0');
9	}
10
11	if(jQuery("#ajaxClinics").length > 0){
12		jQuery("#ajaxClinics").bind("change", function() {
13			window.location.href = (jQuery(this).val());
14		});						   
15	}
16
17	if(jQuery(".accordBox").length > 0){
18		jQuery(".accordBox h2").click(function(){
19			if(jQuery(this).hasClass("active")){
20				jQuery(".accordBox h2").removeClass("active");
21				jQuery(".accordDtl").slideUp();
22			} else{
23				jQuery(".accordBox h2").removeClass("active");
24				jQuery(".accordDtl").slideUp();
25				
26				jQuery(this).addClass("active");
27				jQuery(this).next(".accordDtl").slideDown();
28			}
29		});
30	}
31
32
33	if(jQuery('.sidem_li').length > 0){
34		jQuery('.sidem_li').click(function () {
35			jQuery(this).toggleClass('expanded');
36			jQuery('.sidem_ul').slideToggle('slow');
37		});   
38	}
39
40	if(jQuery('#ez-toc-container').length > 0){
41		jQuery('#ez-toc-container').wrap("<div class='wrap ttable'></div>");		
42	}
43});
44
45jQuery(document).ready(function(){
46	if(jQuery('.brochure .wpcf7-form').length > 0){
47		var page_link = jQuery(location).attr('href');
48		jQuery('.brochure .wpcf7-form input[name=page_name]').val(jQuery(document).attr('title'));
49		jQuery('.brochure .wpcf7-form input[name=page_link]').val(page_link);		
50	}
51});
52
53
54/*****blog jqury 23-2-16**********/
55
56jQuery(document).ready(function(){
57		 var divs = jQuery("div.blog > div.one_half");
58			for(var i = 0; i < divs.length; i+=2) {
59			  divs.slice(i, i+2).wrapAll("<div class='full'></div>");
60			}
61
62		jQuery(".blog_row").each(function(){
63		  var colors = ["#fdb713","#eef197","#e4e4e4", "#04bfbf"];
64			var rand = Math.floor(Math.random()*colors.length);	
65			jQuery(this).attr('style', 'border-top: 5px solid '+ colors[rand]);
66		});
67});
68
69jQuery(window).on('load', function() {
70
71	if(jQuery(".blog_head").length > 0){
72	if(jQuery( window ).width() > 800){
73	      var divHeight = jQuery('.one_third.top_blog')[0].offsetHeight;
74	      jQuery('.two_third.blog_img').height(divHeight);
75	   }
76	}
77		/*var phoneVal = jQuery('.mobino').html();
78			jQuery('.mobix').attr('href', 'tel:'+phoneVal);*/
79		});
80
81/******if add Masonry on blog 26-5-16*****/
82/*jQuery(window).load( function() {
83	if(jQuery(".blog_head").length > 0){
84		var container = document.querySelector('.blog');
85		var msnry = new Masonry( container, {
86		  columnWidth: '.item',
87		  itemSelector: '.item'
88		});
89	}
90});*/
91
92/*****Area page****/
93jQuery(document).ready(function(){
94	if(jQuery("#ajaxClinics, .menu_serchform").length>0){
95		jQuery("#ajaxClinics").select2({
96			placeholder: "Enter Location"
97			//matcher: matchStart
98		});
99	}
100	if(jQuery('.area_near ul.rehab_center > li').length > 0){
101		jQuery('.area_near ul.rehab_center').each(function(){
102			var center_li = jQuery(this).find('li.rehab_box').length;
103			if(center_li <= 5){
104				jQuery(this).find('.moreCenter').parent().hide();
105			}
106			var sh_center = 5;
107			jQuery(this).find('li.rehab_box:lt('+sh_center+')').slideDown();
108		});
109
110		jQuery('.area_near .moreCenter').click(function (){
111			var sh_center = jQuery(this).parents('ul.rehab_center').find('li.rehab_box:visible').length;
112			var p_rehab = jQuery(this).parents('ul.rehab_center');
113			var center_li = jQuery(this).parents('ul.rehab_center').find('li.rehab_box').length;
114			sh_center = (sh_center + 3 <= center_li) ? sh_center + 3 : center_li;
115			jQuery(p_rehab).find('li.rehab_box:lt('+sh_center+')').slideDown();
116			if(sh_center == center_li){
117				jQuery(this).hide();
118			}
119		});
120	}
121	if(jQuery('.area_nameList li a').length > 0 || jQuery('.area_city a.viewlocation').length > 0){
122		jQuery(".area_nameList li a, .area_city a.viewlocation").click(function(e){
123			e.preventDefault();
124			const elem=this;
125			jQuery('html, body').animate({
126				scrollTop:jQuery(jQuery(elem).attr('href')).offset().top-180
127			});
128		});
129	}	
130	if(jQuery('ul.area_cityalfa li').length > 0){
131		jQuery('ul.area_sel li, ul.area_topcity li').each(function(){
132			locId = jQuery('.area_sel').find('li').first().text();
133			var selName = locId.substr(0,1);
134			if(jQuery('ul.area_sel li.city_s').length == 0){
135				jQuery('ul.area_sel').prepend('<li class="city_s"></li>');
136			}
137			jQuery('ul.area_sel li.city_s').text(selName);
138			if(jQuery(this).text().substr(0,1) == selName){
139				jQuery(this).css('display', 'inline-block');
140			}
141			jQuery('ul.area_sel li:first-child, ul.area_topcity li:first-child').css('display', 'inline-block');
142		});
143		jQuery('ul.area_cityalfa li').click(function(){
144			var selVal = jQuery(this).text();
145			jQuery('ul.area_cityalfa li').removeClass('blue_txt');
146			jQuery(this).addClass('blue_txt');
147			if(jQuery('ul.area_sel li.city_s').length == 0){
148				jQuery('ul.area_sel').prepend('<li class="city_s"></li>');
149			}
150			jQuery('ul.area_sel li.city_s').text(selVal);
151			jQuery('ul.area_sel li, ul.area_topcity li').each(function(){    
152				if(jQuery(this).text().substr(0,1) == selVal){
153					 jQuery(this).css('display', 'inline-block');
154				}else{
155					jQuery(this).removeAttr('style');
156					jQuery(this).hide();
157				}
158				jQuery('ul.area_sel li:first-child, ul.area_topcity li:first-child').css('display', 'inline-block');
159			});
160		});
161	}
162	jQuery(".sarea_claim").click(function() {
163		if(jQuery('body.single-rehab').length == 0){
164			jQuery('#input_22_6').attr('value', '');
165		}
166        jQuery("#popupfrm").fadeIn();
167		jQuery(".claim_frm").fadeIn(800);
168		jQuery('body,html').css('overflow', 'hidden');		
169    });
170	jQuery("#popupfrm .close").click(function() {
171        jQuery("#popupfrm").fadeOut(500);
172		jQuery(".claim_frm").fadeOut(800);
173		jQuery('body, html').css('overflow', 'auto');
174    });
175	jQuery("#popupfrm").click(function(e) {
176        var t = e.target;
177        jQuery(t).is("#popupfrm") && (jQuery(this).fadeOut(500), jQuery(".claim_frm").fadeOut(800), jQuery('body,html').css('overflow', 'auto'));
178    });
179	var area_sel = [];
180	jQuery('ul.area_sel li').each(function(){
181		var first_ch = jQuery(this).text().substr(0, 1).toUpperCase();
182		area_sel.push(first_ch);
183	});
184	jQuery('ul.area_cityalfa li').each(function(){
185		if(jQuery.inArray(jQuery(this).text(), area_sel) !== -1){
186			jQuery(this).addClass('bold');
187		}else{
188			jQuery(this).removeClass('bold');
189		}
190	});
191	jQuery('.ah_area #ts-fab-below').remove();
192
193	mobrehab()
194	window.addEventListener("resize", mobrehab, false);
195
196	jQuery(".rehab_center").on("click", "li.rehab_box.mobi_rbox .r_detail", function(){
197		jQuery('li.rehab_box.mobi_rbox').find('.r_boxdetail, .r_flex').slide
197Up();
198		var r_detail = jQuery(this).parents('li.rehab_box').find('.r_boxdetail, .r_flex');
199		jQuery('li.rehab_box.mobi_rbox .r_detail').removeClass('active');
200		if(jQuery(r_detail).is(":visible")){
201			jQuery(this).parents('li.rehab_box').find('.r_boxdetail, .r_flex').slideUp();
202			jQuery(this).removeClass('active');
203		}else{
204			jQuery(this).parents('li.rehab_box').find('.r_boxdetail, .r_flex').slideDown();
205			jQuery(this).addClass('active');
206		}
207	});
208	if(jQuery('span.revstars').length > 0){
209		jQuery('span.revstars').each(function(){
210			jQuery(this).html(jQuery('<span />').width(Math.max(0, (Math.min(5, parseFloat(jQuery(this).html())))) * 18));
211			jQuery(this).show();
212		});
213	}
214	
215	if(jQuery('.all_county ul.rehab_center > li').length > 0){
216		jQuery('.all_county ul.rehab_center').each(function(){
217			var center_li = jQuery(this).find('li').length;
218			var show_li = 33
219			if(jQuery( window ).width() >= 650){
220				show_li = 33;
221			}else{
222				show_li = 6;
223			}
224			if(center_li <= show_li){
225				jQuery(this).find('.all_county .moreCenter').parent().hide();
226			}
227			var sh_center = show_li;
228			jQuery(this).find('li:lt('+sh_center+')').slideDown();
229		});
230		
231		jQuery('.all_county .moreCenter').click(function (){
232			var center_li = jQuery(this).parents('.all_county').find('ul.rehab_center li').length;
233			var press_height1 = jQuery(this).parents('.all_county').find('ul.rehab_center:visible').height();
234			var sh_center = jQuery(this).parents('.all_county').find('ul.rehab_center li:visible').length;
235			var allcounty_height = jQuery('.all_county').parent().height();
236			var countypress_height = jQuery('.find_treatment .county_pres').parent().height();
237			var morebtn = jQuery(this);
238			var show_li = 33;
239			if(jQuery( window ).width() >= 650){show_li = 33;}else{show_li = 6;}
240			if(sh_center < center_li ){	
241				jQuery(this).parents('.all_county').find('ul.rehab_center li:lt('+center_li+')').slideDown({
242					complete: function(){
243						if(jQuery('.all_county ul.rehab_center li:last').is(this)){
244							var arehab = jQuery('ul.rehab_center:visible').height();								
245							var county_height = jQuery('.find_treatment .county_rehab').height();
246							var acounty_pres = jQuery('.find_treatment .county_pres').height();
247							if(jQuery( window ).width() >= 959){
248								if(allcounty_height >= countypress_height){
249									var stotalheight = arehab + acounty_pres - press_height1;
250									jQuery('.county_pres').css({height:stotalheight});
251								}else{
252									jQuery('.county_pres').removeAttr('style');
253								}
254							}
255							jQuery(morebtn).text('Less');
256						}
257					}
258				});
259			}else{
260				jQuery(this).parents('.all_county').find('ul.rehab_center li').not(':lt('+show_li+')').slideUp({
261					complete: function(){
262						if(jQuery('.all_county ul.rehab_center li:last').is(this)){
263							var arehab = jQuery('ul.rehab_center:visible').height();
264							var acounty_pres = jQuery('.find_treatment .county_pres').height();
265							if(jQuery( window ).width() >= 959){
266								if(allcounty_height >= countypress_height+65){
267									var stotalheight = arehab + acounty_pres - press_height1;
268									jQuery('.county_pres').css({height:stotalheight});
269								}else{
270									jQuery('.county_pres').removeAttr('style');
271								}
272							}
273							jQuery(morebtn).text('More');
274						}
275					}
276				});
277			}				
278		});
279	}
280});
281
282function mobrehab(){
283	jQuery('li.rehab_box').each(function(){
284		if(jQuery( window ).width() <= 768){
285			jQuery(this).addClass('mobi_rbox');
286			jQuery(this).find('.blue_txt').insertAfter(jQuery(this).find('.r_boximg'));
287			jQuery(this).find('.r_boxdetail').insertAfter(jQuery(this).find('.r_detail'));
288			jQuery(this).find('.r_boxdetail, .r_flex').hide();
289		}else{
290			jQuery(this).removeClass('mobi_rbox');
291			jQuery(this).find(jQuery(this).find('.blue_txt')).insertBefore(jQuery(this).find('.r_add'));
292			jQuery(this).find('.r_boxdetail').insertAfter(jQuery(this).find('.r_boximg'));
293			jQuery(this).find('.r_boxdetail, .r_flex').show();
294		}
295	});
296}
297/****End****/
298/***landing_page center***/
299jQuery(document).ready(function(){
300	if(jQuery(".search_formcity, .menu_serchform").length>0){
301
302		jQuery(".navsec > ul > li").hover(function(){		
303			if(jQuery(this).hasClass('menu_serchform')){
304				jQuery(this).addClass("activeli");
305			}else if(jQuery('.menu_serchform.activeli:visible')){
306				jQuery('.menu_serchform').removeClass("activeli");
307				jQuery('.menu_serchform .areasel').select2('close');
308			}
309		});
310		jQuery("body").click(function(e){
311			if(e.target.className !== "menu_serchform"){
312				if(jQuery('.menu_serchform.activeli:visible')){
313					if((e.target.className !== "select2-search__field") && (e.target.className !== "select2-search select2-search--dropdown") && (e.target.className !== "select2-results__option select2-results__message") && (e.target.className !== "select2-results__options")){
314						jQuery('.menu_serchform').removeClass("activeli");
315					}
316				}
317			}
318		});
319		jQuery(window).scroll(function(){
320			if(jQuery('.menu_serchform.activeli:visible')){
321				jQuery('.menu_serchform').removeClass("activeli");
322				jQuery('.menu_serchform .areasel').select2('close');
323			}
324		});
325		function matchStart(params, data) {
326			params.term = params.term || '';
327			if (data.text.toUpperCase().indexOf(params.term.toUpperCase()) == 0){
328				return data;
329			}
330			return null;
331		}
332		jQuery(".search_formcity .areasel").select2({
333			placeholder: "Enter County",
334			matcher: matchStart
335		});
336		jQuery(".search_formcity, .menu_serchform").on("click", ".find_areasel", function(){
337			var selarea = jQuery(this).parents(".search_formcity").find(".areasel option:selected").val();
338			window.location.href = selarea;
339		});
340		jQuery("body").on("click", ".select2-search.select2-search--dropdown", function(){
341			var select_val = jQuery(this).find('.select2-search__field').val();
342			var select_size = jQuery(this).next('.select2-results').find('.select2-results__options li.select2-results__option.select2-results__message').length;	
343			if (select_val != '' && select_size == 0 ){
344				jQuery('.menu_serchform .areasel').select2('close');
345				var re_direct = jQuery('.search_formcity .areasel option').filter(function () { return jQuery(this).html().toLowerCase() == select_val.toLowerCase(); }).val();
346				if(re_direct != 'undefined'){
347					jQuery('.menu_serchform').removeClass("activeli");
348					window.location.href = re_direct;
349				}
350			}
351		});
352	}
353});
354
355jQuery(document).ready(function() {
356    var tooltip = jQuery('<div class="phonetooltip">Who am I contacting?</div>').appendTo('body');
357
358    jQuery('.aroham_popup').each(function() {
359        jQuery(this).hover(function(event) {
360            var $this = jQuery(this);
361            var offset = $this.offset();
362            var width = $this.outerWidth();
363            var height = $this.outerHeight();
364
365            tooltip.css({
366                opacity: 1,
367                top: offset.top + height - 70, // Position tooltip below the element
368                left: offset.left + (width / 2) - (tooltip.outerWidth() / 2) // Center the tooltip
369            });
370        }, function() {
371            tooltip.css('opacity', 0);
372        });
373    });
374});

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.