PageSourceSearch

https://www.hec.gov.pk/Style%20Library/HEC/js/CustomJS/LandingPageJs.js

js hec.gov.pk collected 2026-10-01 10:43:07 UTC 45,813 bytes, 1,239 lines download raw bytes

1$(document).ready(function () {
2	$('body').removeClass('bodySpace');
3	//GetYoutubeVideo();
4	$('#s4-workspace').addClass('LandinBg')
5    if( $(location).attr('href').indexOf("urdu")  > -1){
6    $("#NavigationMob").text("سمت شناسی");
7    $("#ExploreMob").text("دریافت کریں");
8    $("#UtilityMob").text("افادیت");
9    $("#SpotlightText").text("مہینے کی اسپاٹ لائٹ")
10	GetQuickLinksLandingForUrdu();
11	getSpotlightForUrdu();
12	GetAnnouncementsForUrdu();
13	getLandingFooterForUrdu();
14	getLandingPrivacySectionForUrdu();
15	getNavHeadersAllItemsForUrdu();
16	getExploreMenuForUrdu();
17	getprivacyLinksForUrdu();
18	getPrivacyMobileSectionForUrdu();
19	
20	if( window.innerWidth <= 991 && $(location).attr('href').indexOf("urdu")  > -1) {
21    GetServicesMobileUrdu();
22	}else{
23	GetServicesforUrdu();
24	}
25
26	
27	$('#welcomeText :first-child').text("ایچ ای سی پاکستان میں خوش آمدید");
28	$('#welcomeText').find('p').text("تعلیم کے ذریعے پاکستان کو بااختیار بنانا");
29	$('#quLinkTxt').text('فوری روابط');
30	}else{
31	
32	GetListItems();
33	getSpotlight();
34	GetAnnouncements();
35	getLandingFooter();
36	getLandingPrivacySection();
37	getNavHeadersAllItems();
38	getExploreMenu();
39	getprivacyLinks();
40	getPrivacyMobileSection();
41	
42	if( window.innerWidth <= 991 ) {
43    GetServicesMobile();
44	}else{
45	GetServices();
46	}
47	
48	$('#welcomeText :first-child').text("Welcome to HEC Pakistan");
49	$('#welcomeText').find('p').text("Empowering Pakistan through Higher Education");
50	}
51   
52});
53
54$(window).on('load', function() {     	
55		$("ul#searchLinks li").removeClass();
56		$('#SearchBox').find('div').find('input').addClass('myInput');
57		$('#SpotlightSection')
58		.on('afterChange', function(event, slick, currentSlide, nextSlide){
59		settingText();
60		});
61});
62  var subsite = _spPageContextInfo.webAbsoluteUrl;
63  var listUrl = "/_api/web/lists/getByTitle('QuickLinks')/items?$orderby=Order_x0020_By asc";
64
65  var html = "";
66  var AnnounHtml = "";
67  var spotlightdata = 0;
68
69function GetListItems() {
70    $("#QuickLinks").html("");
71	$("#searchLinksMaster").html("");
72    $.ajax({
73      url: siteCollection + listUrl,
74      type: "GET",
75      headers: {
76        Accept: "application/json;odata=verbose"
77      },
78      success: function (data) {
79        jQuery.each(data.d.results, function (index, item) {
80		  var title = item.Title == "" ? "" : item.Title;
81		  var linkToPage = "";
82          if(item.LinkToPage !=null){
83          	linkToPage = item.LinkToPage.Url
84          }else{
85          
86          }         
87          if(item.isHeading == 1){
88          var AnnounHtml = '<li class="d-none d-xl-block">';
89          AnnounHtml += '<p>' + title + '</p>';
90          AnnounHtml += '</li>';
91          $("#QuickLinks").append(AnnounHtml);		  
92          }else{
93          var AnnounHtml = '<li>';
94          AnnounHtml += '<a href="'+linkToPage+'">' + title + '</a>';
95          AnnounHtml += '</li>';
96          $("#QuickLinks").append(AnnounHtml);
97		  $("#searchLinks").append(AnnounHtml);
98		  $("#searchLinksMaster").append(AnnounHtml);
99		  }
100		  
101        });
102        
103           var socialIcon = '<li class="d-none d-xl-block">';
104           socialIcon += '<ul class="d-flex align-items-center flex-wrap flex-xl-nowrap" id="social-media-icons">';
105           socialIcon += '</ul>';
106           socialIcon += '</li>';
107         $("#QuickLinks").append(socialIcon)
108      }, eror: function (data) {
109        console.log("An error occurred. Please try again.");
110      }
111    })
112}
113function GetAnnouncements() {
114    $("#AnnouncementsList").html("");
115    var listUrl = "/_api/web/lists/getByTitle('Announcements')/items?$filter=IsActive eq 1&$orderby=Order_x0020_By asc";
116    var announcements = '';
117    var itemLength = 0;
118    $.ajax({
119      url: siteCollection + listUrl,
120      type: "GET",
121      headers: {
122        Accept: "application/json;odata=verbose"
123      },
124      success: function (data) {
125      itemLength = data.d.results.length;
126        jQuery.each(data.d.results, function (index, item) {
127          var text = item.Body;
128          var link = item.Link == null ? "" :  item.Link.Url;
129          announcements += '<div>';
130          announcements += '<a href="'+link+'"><p>' + text + '</p></a>';
131          announcements += '</div>';
132
133        })
134          $("#AnnouncementsList").append(announcements);
135          announcements = '';
136          if(itemLength == 1){
137          $("#AnnouncementsList.single-item").not('.slick-initialized').slick({
138			dots: false,
139			speed: 300,
140			slidesToShow: 1,
141			slidesToScroll: 1,
142			autoplay: true,
143			autoplaySpeed: 3000,
144			infinite: true,
145			variableWidth: true,			
146		});
147          }else{
148        $("#AnnouncementsList.single-item").not('.slick-initialized').slick({
149        	dots: false,
150			speed: 300,
151			slidesToShow: 1,
152			slidesToScroll: 1,
153			autoplay: true,
154			autoplaySpeed: 3000,			
155		});
156		}
157      }, eror: function (data) {
158        console.log("An error occurred. Please try again.");
159     }
160   })
161}
162
163
164function GetServicesMobile() {
165    var listUrl = "/_api/web/lists/getByTitle('Services')/items?$orderby=Order_x0020_By asc&$top=9";
166    $("#ServicesList").html("");
167    $.ajax({
168      url: siteCollection + listUrl,
169      type: "GET",
170      headers: {
171        Accept: "application/json;odata=verbose"
172      },
173      success: function (data) {
174        jQuery.each(data.d.results, function (index, item) {
175          var Title = item.Title == "" || item.Title == null ? "" : item.Title;
176          var body = item.Body == "" || item.Body == null ? "" : item.Body;           
177          var imgUrl = "";
178          if(item.Image !=null){
179          	imgUrl = item.Image.Url
180          	var ImgDesc = item.Image.Description
181          }else{
182          	imgUrl = "/Style Library/HEC/images/scholarship.png"
183          	var ImgDesc = "degree"
184          }
185          var redUrl = "";
186          if(item.RedirectLink !=null){
187          	redUrl = item.RedirectLink.Url
188          }else{
189          	redUrl = ""
190          } 
191          AnnounHtml += '<li class="' + ImgDesc + '">';
192          AnnounHtml += '<a href="'+redUrl+'" class="mobile-link">';
193          AnnounHtml += '<div class="landing-card"><img src="' + imgUrl + '" alt="'+ImgDesc+'"><div>';
194          AnnounHtml += '<a href="'+redUrl+'"><h3> ' + Title + ' </h3></a>';
195          AnnounHtml += '<p class="scholar-para">' + body + '</p></div></div></a>';
196          AnnounHtml += '<div class="landing-card-link d-none d-lg-block"><a href="' + redUrl + '">See Details</a></div>';
197          AnnounHtml += '</li>';
198          $("#ServicesList").html(AnnounHtml);
199        })
200        
201
202        }, 
203        eror: function (data) {
204        console.log("An error occurred. Please try again.");
205      }
206    })
207  }
208
209function GetServices() {
210    var listUrl = "/_api/web/lists/getByTitle('Services')/items?$orderby=Order_x0020_By asc";
211    $("#ServicesList").html("");
212    $.ajax({
213      url: siteCollection + listUrl,
214      type: "GET",
215      headers: {
216        Accept: "application/json;odata=verbose"
217      },
218      success: function (data) {
219        jQuery.each(data.d.results, function (index, item) {
220          var Title = item.Title == "" || item.Title == null ? "" : item.Title;
221          var body = item.Body == "" || item.Body == null ? "" : item.Body;           
222          var imgUrl = "";
223          if(item.Image !=null){
224          	imgUrl = item.Image.Url
225          	var ImgDesc = item.Image.Description
226          }else{
227          	imgUrl = "/Style Library/HEC/images/scholarship.png"
228          	var ImgDesc = "degree"
229          }
230          var redUrl = "";
231          if(item.RedirectLink !=null){
232          	redUrl = item.RedirectLink.Url
233          }else{
234          	redUrl = ""
235          }
236          
237          AnnounHtml += '<li class="' + ImgDesc + '">';
238          AnnounHtml += '<a href="'+redUrl+'" class="mobile-link">';
239          AnnounHtml += '<div class="landing-card"><img src="' + imgUrl + '" alt="'+ImgDesc+'"><div>';
240          AnnounHtml += '<a href="'+redUrl+'"><h3> ' + Title + ' </h3></a>';
241          AnnounHtml += '<p class="scholar-para">' + body + '</p></div></div></a>';
242          AnnounHtml += '<div class="landing-card-link d-none d-lg-block"><a href="' + redUrl + '">See Details</a></div>';
243          AnnounHtml += '</li>';
244          $("#ServicesList").html(AnnounHtml);
245        })
246        		
247		  function desktopOnlySlider() {
248            $('#ServicesList.services-list-item').slick({
249                dots: false,
250                infinite: true,
251                speed: 500,
252                slidesToShow: 5,
253                slidesToScroll: 1,
254                arrows: true,
255                responsive: [{
256                    breakpoint: 1024,
257                    settings: {
258                        slidesToShow: 5,
259                    },
260
261                }, {
262                    breakpoint: 992,
263                    settings: "unslick"
264                }]
265            });
266        }
267        if (window.innerWidth > 992) {
268            desktopOnlySlider();
269        }
270        $(window).resize(function(e) {
271            if (window.innerWidth > 992) {
272                if (!$('#ServicesList.services-list-item').hasClass('slick-initialized')) {
273                    desktopOnlySlider();
274                }
275
276            } else {
277                if ($('#ServicesList.services-list-item').hasClass('slick-initialized')) {
278                    $('#ServicesList.services-list-item').slick('unslick');
279                }
280            }
281        });
282		
283        }, 
284        eror: function (data) {
285        console.log("An error occurred. Please try again.");
286      }
287    })
288  }
289function getSpotlight() {
290    var listUrl = "/_api/web/lists/getByTitle('Spotlight')/items?$select=*,AttachmentFiles&$expand=AttachmentFiles&$filter=Section eq 'Spotlight'&$top=4&$orderby=Order_x0020_By asc";
291	var SliderSection = "";
292	var TextSection = "";
293	moblieSpotlight = '';
294	var count = 0;
295    $("#SpotlightSection").html("");
296    $("#spot-light").html("");   
297    $.ajax({
298      url: siteCollection + listUrl,
299      type: "GET",
300      headers: {
301        Accept: "application/json;odata=verbose"
302      },
303      success: function (data) {
304        jQuery.each(data.d.results, function (index, item) {
305          var body = item.Body == "" ? " " : item.Body;
306          var Url = "";
307          if(item.Link !=null){
308          	Url = item.Link.Url
309          }else{
310          	Url = ""
311          }
312          
313          var attachment = item.AttachmentFiles.results.length > 0 ? item.AttachmentFiles.results[0].ServerRelativeUrl : "/PublishingImages/helena-lopes-592971-unsplash.png";
314          spotlightdata++;
315          
316              
317              SliderSection += '<div>';
318		      SliderSection += '<img src="'+attachment+'" alt="menu-img" id="'+spotlightdata+'">';
319		      SliderSection += ' </div>';
320		      
321		      var Spotlightmobile = '<div>';
322			  Spotlightmobile += '<img src="'+attachment+'">';
323			  Spotlightmobile += '<p>'+body+'</p>';
324			  Spotlightmobile += '<a href="'+Url+'">Read More</a>'
325			  Spotlightmobile += '</div>';
326			  
327		      if(spotlightdata == 1){
328		      TextSection += '<div class="other-slides light-text" id="'+spotlightdata+'" style="display:flex">'
329		      TextSection += '<p>' + body + '</p>';
330		      TextSection += '<a href="'+Url+'">Read More<i class="icon-arrow"></i></a>';
331		      TextSection += '</div>';
332		      }else{
333		      TextSection += '<div  class="other-slides" style="display:none" id="'+spotlightdata+'">'
334		      TextSection += '<p>' + body + '</p>';
335		      TextSection += '<a href="'+Url+'">Read More <i class="icon-arrow"></i></a>';
336		      TextSection += '</div>';	      
337		      }
338		      
339		      
340				$("#mobSpotlight").append(Spotlightmobile);
341			    $("#SpotlightSection").append(SliderSection);
342			  
343			  
344		      $("#spot-light").append(TextSection);	      
345		      if(spotlightdata == 1){				              
346				moblieSpotlight += '<img src="'+attachment+'" alt="menu-img">';						            
347		      	moblieSpotlight += '<div class="menu-img-info">';
348		      	moblieSpotlight += '<p>'+body+'</p>';
349		      	moblieSpotlight += '<a href="'+Url+'">Read More <img src="/Style Library/HEC/images/menu-arrow.svg" alt="menu-arrow"></a>';
350		      	moblieSpotlight += '</div>';
351		      	
352		      	$("#SpotlightMobile").append(moblieSpotlight);
353		      }
354		      SliderSection = '';
355		      TextSection = '';
356		      moblieSpotlight = '';
357		      
358        })
359        $('.animatedImages').slick({
360  autoplay: true,
361    arrows: false,
362    dots: true,
363    slidesToShow: 1,
364    centerPadding: "10px",
365    draggable: false,
366    infinite: true,
367    pauseOnHover: false,
368    swipe: false,
369    touchMove: false,
370    vertical: true,
371    speed: 3000,
372    autoplaySpeed: 2000,
373    useTransform: true,
374    adaptiveHeight: true,
375  });      
376  //});
377  $(".single-item-spotlight").slick({
378			dots: false,
379			speed: 300,
380			slidesToShow: 1,
381			slidesToScroll: 1,
382			//infinite: false,			
383		});
384
385      }, eror: function (data) {
386        console.log("An error occurred. Please try again.");
387      }
388    })
389}
390function GetYoutubeVideo() {
391    var listUrl = "/_api/web/lists/getByTitle('Spotlight')/items?select=*&$filter=Section eq 'Video'";
392    $("#youtubeVideo").html("");
393    $.ajax({
394      url: siteCollection + listUrl,
395      type: "GET",
396      headers: {
397        Accept: "application/json;odata=verbose"
398      },
399      success: function (data) {   
400        jQuery.each(data.d.results, function (index, item) {
401          var VideoId = "";
402          var url = item.Link.Url;
403          var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
404          var match = url.match(regExp);
405          if (match && match[2].length == 11) {
406            VideoId = match[2];
407            VideoId = "https://www.youtube.com/embed/" + VideoId;
408          } else {
409          }
410          var Html = '<iframe width="290" height="165" src="' + VideoId + '">';
411          Html += '</iframe>';
412          $("#youtubeVideo").html(Html);
413        })
414      }, eror: function (data) {
415        console.log("An error occurred. Please try again.");
416      }
417    })
418}
419function getExploreMenu() {
420    var listUrl = "/_api/web/lists/getByTitle('Explore Navigation')/items?$orderby=Order_x0020_By asc";
421    $("#ExploreMenu").html("");
422    $.ajax({
423      url: siteCollection + listUrl,
424      type: "GET",
425      headers: {
426        Accept: "application/json;odata=verbose"
427      },
428      success: function (data) {
429        jQuery.each(data.d.results, function (index, item) {
430		  var link = "";
431		  if(item.Link !=null){
432		   link = item.Link.Url;
433		  }else{
434		  	link = "http://dc-spapp01/" 
435		  }         
436          var Title = item.Title == '' ? " " : item.Title;
437          var MobileMenu = '<li><a href="' + link + '">' + Title + '</a></li>';
438          $("#ExploreMenu").append(MobileMenu);
439        })
440      }, eror: function (data) {
441        console.log("An error occurred. Please try again.");
442      }
443    })
444}
445function getMobileMenuNavigation(ItemTitle, UlId) {	
446    var listUrl = "/_api/web/lists/getByTitle('MobileMenu')/items?$select=*,Category/Title,Category/ID&$expand=Category/Title,Category/ID&$filter=Category/ID eq '" + ItemTitle + "'&$orderby=Order_x0020_By asc";
447    $.ajax({
448      url: siteCollection + listUrl,
449      type: "GET",
450      headers: {
451        Accept: "application/json;odata=verbose"
452      },
453      success: function (data) {
454        jQuery.each(data.d.results, function (index, item) {
455          var Title = item.Title;
456          var category = item.Category.results[0].Title
457          var arrOfId = item.CategoryId.results
458          var vTitle = Title == '' ? "" : Title;
459          var x;
460          if (item.Link != null) {
461            x = item.Link.Url;
462          } else {
463            x = "#"
464          }
465		 var elementId = UlId
466              var NewMobileMenu = '<li><a href="' + x + '">' + vTitle + '</a></li>';
467              $('#' + elementId).append(NewMobileMenu);
468        })
469      }, eror: function (data) {
470        console.log("An error occurred. Please try again.");
471      }
472    })
473}
474function getNavHeadersAllItems() {
475    var NavTitle;
476    var listUrl = "/_api/web/lists/getByTitle('SiteMapNavigationHeaders')/items?$orderby=Order_x0020_By asc";
477    $("#MobileMenu").html("");
478    $.ajax({
479      url: siteCollection + listUrl,
480      type: "GET",
481      headers: {
482        Accept: "application/json;odata=verbose"
483      },
484      success: function (data) {
485        jQuery.each(data.d.results, function (index, item) {
486          NavTitle = item.Title;
487          var str = NavTitle.replace(/\s/g, '');
488          str = str.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g,'_');
489          str = str + "MegaMenu";         
490          var itemId = item.ID;
491          var MobileMenu = '<div class="col-md-12 col-lg-3 navigation-links">';
492          MobileMenu += '<a href="/_catalogs/masterpage/services-facilities.html" class="collapsed" data-toggle="collapse" data-target="#'+str+'" aria-expanded="false">';
493          MobileMenu += '<h3>' + NavTitle + '</h3>';
494          MobileMenu += '</a>';
495          MobileMenu += '<ul id="' + str + '" class="collapse"></ul>';
496          MobileMenu += '</div>';
497          $("#MobileMenu").append(MobileMenu);
498          getMobileMenuNavigation(itemId, str);
499        })	
500        }, 
501        eror: function (data) {
502        console.log("An error occurred. Please try again.");
503      }
504    })
505}
506function _getSocialMediaProfiles() {
507    var listUrl = "/_api/web/lists/getByTitle('SocialMediaAccounts')/items";
508    $("#social-media-icons").html("");
509    $("#NavSocialLinks").html("");
510    $("#MobileScreenIcons").html("");
511    $.ajax({
512      url: siteCollection + listUrl,
513      type: "GET",
514      headers: {
515        Accept: "application/json;odata=verbose"
516      },
517      success: function (data) {
518        jQuery.each(data.d.results, function (index, item) {
519          var vTitle = item.Title == '' ? "#" : item.Title;
520          var icon = "";
521          if (item.Icon != null) {
522            icon = item.Icon.Url;
523          } else {
524            icon = item.Title
525          }
526          var x;
527          if (item.Link != null) {
528            x = item.Link.Url;
529          } else {
530            x = ""
531         }
532          var AnnounHtml = '<li><a href="'+x+'"><img src="' + icon + '" alt="' + vTitle + '"></a>';
533          AnnounHtml += '</li>';
534          $("#social-media-icons").append(AnnounHtml);
535          $("#NavSocialLinks").append(AnnounHtml);
536          $("#MobileScreenIcons").append(AnnounHtml);          
537        })
538        }, 
539        eror: function (data) {
540        console.log("An error occurred. Please try again.");
541      }
542    })
543}
544function getLandingFooter(){
545    var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Site Pages' and OnHome eq 1)";
546    $("#landingBottomFooter").html("");
547    $.ajax({
548      url: siteCollection + listUrl,
549      type: "GET",
550      headers: {
551        Accept: "application/json;odata=verbose"
552      },
553      success: function (data) {
554        jQuery.each(data.d.results, function (index, item) {
555          var vTitle = item.Title == '' ? "#" : item.Title;         
556          var link;
557          if (item.Link != null) {
558            link = item.Link.Url;
559          } else {
560            link = ""
561          }                
562          if(item.isLanguage == 1){
563          var lang = '<option value="'+item.Link.Description+'">'+vTitle+'</option>'	  
564          $("#langFooter").append(lang); 
565          }else{         
566          var AnnounHtml = '<li><a href="'+link+'">'+vTitle+'</a>';
567          AnnounHtml += '</li>';
568          $("#landingBottomFooter").append(AnnounHtml);
569          }
570        })        
571      }, eror: function (data) {
572        console.log("An error occurred. Please try again.");
573      }
574    })
575}
576function getLandingPrivacySection(){
577  	var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Policies' and OnHome eq 1)";
578    $("#landingBottomsection2").html("");
579    $.ajax({
580      url: siteCollection + listUrl,
581      type: "GET",
582      headers: {
583        Accept: "application/json;odata=verbose"
584      },
585      success: function (data) {
586        jQuery.each(data.d.results, function (index, item) {
587          var vTitle = item.Title == '' ? "#" : item.Title;        
588          var link;
589          if (item.Link != null) {
590            link = item.Link.Url;
591          } else {
592            link = ""
593          }                   
594          var AnnounHtml = '<li><a href="'+link+'">'+vTitle+'</a>';
595          AnnounHtml += '</li>';
596          $("#landingBottomsection2").append(AnnounHtml);         
597        })
598        },
599         eror: function (data) {
600        console.log("An error occurred. Please try again.");
601      }
602    })
603}
604function getPrivacyMobileSection(){
605  	var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Policies' and OnHome eq 1)&$top=2&$orderby=Order_x0020_By desc";
606    $("#PrivacyMobileSection").html("");
607    var AnnounHtml = '';
608    var AnnounHtmlRender = '';
609    var count = 0;
610    $.ajax({
611      url: siteCollection + listUrl,
612      type: "GET",
613      headers: {
614        Accept: "application/json;odata=verbose"
615      },
616      success: function (data) {
617        jQuery.each(data.d.results, function (index, item) {
618          var vTitle = item.Title == '' ? "#" : item.Title;        
619          var link;
620          if (item.Link != null) {
621            link = item.Link.Url;
622          } else {
623            link = ""
624          }
625          if(count == 0){
626          	AnnounHtml += '<li class="d-none"><a href="'+link+'">'+vTitle+'</a></li>';
627          	AnnounHtml += '<li>';
628			AnnounHtml += '<ul class="d-flex align-items-center" id="MobileScreenIcons">';
629			AnnounHtml += '	</ul>';
630			AnnounHtml += '	</li>';
631          	count++;
632          }else{
633            AnnounHtml += '<li class="d-none"><a href="'+link+'">'+vTitle+'</a></li>';
634          } 
635          AnnounHtmlRender +=  AnnounHtml;
636          AnnounHtml = "";                       
637        })
638          $("#PrivacyMobileSection").append(AnnounHtmlRender);
639        },
640         eror: function (data) {
641        console.log("An error occurred. Please try again.");
642      }
643    })
644}
645function getprivacyLinks() {
646    var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Policies' and OnMaster eq 1)&$top=2&$orderby=Order_x0020_By asc";
647    $("#footerBottom").html("");
648    $("#privacyLinksLandingPage").html("");
649    $.ajax({
650      url: siteCollection + listUrl,
651      type: "GET",
652      headers: {
653        Accept: "application/json;odata=verbose"
654      },
655      success: function (data) {
656        jQuery.each(data.d.results, function (index, item) {
657          var vTitle = item.Title == '' ? "#" : item.Title;
658          var link;
659          if (item.Link != null) {
660            link = item.Link.Url
661          } else {
662            link = siteCollection;
663          }
664          var AnnounHtml = '<li><a href="'+link+'">'+vTitle+'</a>';
665          AnnounHtml += '</li>';
666          $("#footerBottom").append(AnnounHtml);
667          $("#privacyLinksLandingPage").append(AnnounHtml);        
668        })
669        
670      }, eror: function (data) {
671        console.log("An error occurred. Please try again.");
672      }
673   })
674}
675//Javscript code for the Urdu Site 
676function GetServicesforUrdu() {
677    var listUrl = "/_api/web/lists/getByTitle('Services')/items?$orderby=Order_x0020_By asc";
678    $("#ServicesList").html("");
679    $.ajax({
680      url: siteCollection + listUrl,
681      type: "GET",
682      headers: {
683        Accept: "application/json;odata=verbose"
684      },
685      success: function (data) {
686        jQuery.each(data.d.results, function (index, item) {
687          var Title = item.Title_UR == "" || item.Title_UR == null ? "" : item.Title_UR;
688          var body = item.Body_UR == "" || item.Body_UR == null ? "" : item.Body_UR;           
689          var imgUrl = "";
690          if(item.Image !=null){
691          	imgUrl = item.Image.Url
692          	var ImgDesc = item.Image.Description
693          }else{
694          	imgUrl = "/Style Library/HEC/images/scholarship.png"
695          	var ImgDesc = "degree"
696          }
697          var redUrl = "";
698          if(item.RedirectLink !=null){
699          	redUrl = item.RedirectLink.Url
700          }else{
701          	redUrl = ""
702          }
703          
704          AnnounHtml += '<li class="' + ImgDesc + '">';
705          AnnounHtml += '<a href="'+redUrl+'" class="mobile-link">';
706          AnnounHtml += '<div class="landing-card"><img src="' + imgUrl + '" alt="'+ImgDesc+'"><div>';
707          AnnounHtml += '<a href="'+redUrl+'"><h3> ' + Title + ' </h3></a>';
708          AnnounHtml += '<p class="scholar-para">' + body + '</p></div></div></a>';
709          AnnounHtml += '<div class="landing-card-link d-none d-lg-block"><a href="' + redUrl + '">تفصیلات دیکھیں</a></div>';
710          AnnounHtml += '</li>';
711          $("#ServicesList").html(AnnounHtml);
712        })
713        
714		function desktopOnlySlider() {
715            $('#ServicesList.services-list-item').slick({
716                dots: false,
717                infinite: true,
718                speed: 500,
719                slidesToShow: 5,
720                slidesToScroll: 1,
721                arrows: true,
722                responsive: [{
723                    breakpoint: 1024,
724                    settings: {
725                        slidesToShow: 5,
726                    },
727
728                }, {
729                    breakpoint: 992,
730                    settings: "unslick"
731                }]
732            });
733        }
734        if (window.innerWidth > 992) {
735            desktopOnlySlider();
736        }
737        $(window).resize(function(e) {
738            if (window.innerWidth > 992) {
739                if (!$('#ServicesList.services-list-item').hasClass('slick-initialized')) {
740                    desktopOnlySlider();
741                }
742
743            } else {
744                if ($('#ServicesList.services-list-item').hasClass('slick-initialized')) {
745                    $('#ServicesList.services-list-item').slick('unslick');
746                }
747            }
748        });
749
750        }, 
751        eror: function (data) {
752        console.log("An error occurred. Please try again.");
753      }
754    })
755  }
756function GetQuickLinksLandingForUrdu() {
757    $("#QuickLinks").html("");
758	//$("#searchLinks").html("");
759    $.ajax({
760      url: siteCollection + listUrl,
761      type: "GET",
762      headers: {
763        Accept: "application/json;odata=verbose"
764      },
765      success: function (data) {
766        jQuery.each(data.d.results, function (index, item) {
767		  var title = item.Title_UR == "" ? "" : item.Title_UR;
768		  var linkToPage = "";
769          if(item.LinkToPage !=null){
770          	linkToPage = item.LinkToPage.Url.replace("/english","/urdu");
771          }else{
772          	linkToPage = "http://dc-spapp01/"
773          }         
774          if(item.isHeading == 1){
775          var AnnounHtml = '<li class="d-none d-xl-block">';
776          AnnounHtml += '<p>' + title + '</p>';
777          AnnounHtml += '</li>';
778          $("#QuickLinks").append(AnnounHtml);
779		  $("#searchLinks").append(AnnounHtml);
780          }else{
781
782          var AnnounHtml = '<li>';
783          AnnounHtml += '<a href="'+linkToPage+'">' + title + '</a>';
784          AnnounHtml += '</li>';
785          $("#QuickLinks").append(AnnounHtml);
786		  $("#searchLinks").append(AnnounHtml);
787		  }
788        })
789        var socialIcon = '<li class="d-none d-xl-block">';
790           socialIcon += '<ul class="d-flex align-items-center flex-wrap flex-xl-nowrap" id="social-media-icons">';
791           socialIcon += '</ul>';
792           socialIcon += '</li>';
793         $("#QuickLinks").append(socialIcon)
794      }, eror: function (data) {
795        console.log("An error occurred. Please try again.");
796      }
797    })
798}
799function getSpotlightForUrdu() {
800        var listUrl = "/_api/web/lists/getByTitle('Spotlight')/items?$select=*,AttachmentFiles&$expand=AttachmentFiles&$filter=Section eq 'Spotlight'&$top=4&$orderby=Order_x0020_By asc";
801        var SliderSection = "";
802        var TextSection = "";
803        moblieSpotlight = '';
804        var count = 0;
805        $("#SpotlightSection").html("");
806        $("#spot-light").html("");   
807        $.ajax({
808          url: siteCollection + listUrl,
809          type: "GET",
810          headers: {
811            Accept: "application/json;odata=verbose"
812          },
813          success: function (data) {
814            jQuery.each(data.d.results, function (index, item) {
815                var body = item.Body_UR == "" ? " " : item.Body_UR;          
816                var Url = "";
817                if(item.Link !=null){
818                    Url = item.Link.Url.replace("/english","/urdu");
819                }else{
820                    Url = ""
821                }
822      
823              
824              var attachment = item.AttachmentFiles.results.length > 0 ? item.AttachmentFiles.results[0].ServerRelativeUrl : "/PublishingImages/helena-lopes-592971-unsplash.png";
825              spotlightdata++;
826              
827                  
828                  SliderSection += '<div>';
829                  SliderSection += '<img src="'+attachment+'" alt="menu-img" id="'+spotlightdata+'">';
830                  SliderSection += ' </div>';
831                  
832                  var Spotlightmobile = '<div>';
833                  Spotlightmobile += '<img src="'+attachment+'">';
834                  Spotlightmobile += '<p>'+body+'</p>';
835                  Spotlightmobile += '<a href="'+Url+'">Read More</a>'
836                  Spotlightmobile += '</div>';
837                  
838                  if(spotlightdata == 1){
839                  TextSection += '<div class="other-slides light-text" id="'+spotlightdata+'" style="display:flex">'
840                  TextSection += '<p>' + body + '</p>';
841                  TextSection += '<a href="'+Url+'">Read More<i class="icon-arrow"></i></a>';
842                  TextSection += '</div>';
843                  }else{
844                  TextSection += '<div  class="other-slides" style="display:none" id="'+spotlightdata+'">'
845                  TextSection += '<p>' + body + '</p>';
846                  TextSection += '<a href="'+Url+'">Read More <i class="icon-arrow"></i></a>';
847                  TextSection += '</div>';	      
848                  }
849                  
850                  
851                    $("#mobSpotlight").append(Spotlightmobile);
852                    $("#SpotlightSection").append(SliderSection);
853                  
854                  
855                  $("#spot-light").append(TextSection);	      
856                  if(spotlightdata == 1){				              
857                    moblieSpotlight += '<img src="'+attachment+'" alt="menu-img">';						            
858                      moblieSpotlight += '<div class="menu-img-info">';
859                      moblieSpotlight += '<p>'+body+'</p>';
860                      moblieSpotlight += '<a href="'+Url+'">Read More <img src="/Style Library/HEC/images/menu-arrow.svg" alt="menu-arrow"></a>';
861                      moblieSpotlight += '</div>';
862                      
863                      $("#SpotlightMobile").append(moblieSpotlight);
864                  }
865                  SliderSection = '';
866                  TextSection = '';
867                  moblieSpotlight = '';
868                  
869            })
870            $('.animatedImages').slick({
871      autoplay: true,
872        arrows: false,
873        dots: true,
874        slidesToShow: 1,
875        centerPadding: "10px",
876        draggable: false,
877        infinite: true,
878        pauseOnHover: false,
879        swipe: false,
880        touchMove: false,
881        vertical: true,
882        speed: 3000,
883        autoplaySpeed: 2000,
884        useTransform: true,
885        adaptiveHeight: true,
886      });      
887      //});
888      $(".single-item-spotlight").slick({
889                dots: false,
890                speed: 300,
891                slidesToShow: 1,
892                slidesToScroll: 1,
893                //infinite: false,			
894            });
895    
896          }, eror: function (data) {
897            console.log("An error occurred. Please try again.");
898          }
899        })
900    }
901function GetAnnouncementsForUrdu() {
902    var listUrl = "/_api/web/lists/getByTitle('Announcements')/items?$filter=IsActive eq 1&$orderby=Order_x0020_By asc";
903    $("#AnnouncementsList").html("");
904    var itemLength = 0;
905    $.ajax({
906      url: siteCollection + listUrl,
907      type: "GET",
908      headers: {
909        Accept: "application/json;odata=verbose"
910      },
911      success: function (data) {
912      itemLength = data.d.results.length;
913        jQuery.each(data.d.results, function (index, item) {
914          var text = item.Body_UR;
915          var link = item.Link == null ? "" :  item.Link.Url.replace("/english","/urdu");
916          var announcements = '<div>';
917          announcements += '<a href="'+link+'"><p>' + text + '</p></a>';
918          announcements += '</div>';
919          $("#AnnouncementsList").append(announcements);
920          announcements = '';
921
922        })
923        $('#seeAllAnnoun').text('تمام دیکھیں');
924        $('#seeAllAnnoun').attr('href','/urdu/HECAnnouncements/Pages/Announcements.aspx');
925        $('#AnnounTitle').text('اعلانات');
926        if(itemLength == 1){
927          $("#AnnouncementsList.single-item").not('.slick-initialized').slick({
928			dots: false,
929			speed: 300,
930			slidesToShow: 1,
931			slidesToScroll: 1,
932			autoplay: true,
933			autoplaySpeed: 3000,
934			infinite: true,
935			variableWidth: true,			
936		});
937          }else{
938        $("#AnnouncementsList.single-item").not('.slick-initialized').slick({
939        	dots: false,
940			speed: 300,
941			slidesToShow: 1,
942			slidesToScroll: 1,
943			autoplay: true,
944			autoplaySpeed: 3000,			
945		});
946		}
947		}, eror: function (data) {
948        console.log("An error occurred. Please try again.");
949     }
950   })
951}
952function getLandingFooterForUrdu(){
953    var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Site Pages' and OnHome eq 1)";
954    $("#landingBottomFooter").html("");
955    $.ajax({
956      url: siteCollection + listUrl,
957      type: "GET",
958      headers: {
959        Accept: "application/json;odata=verbose"
960      },
961      success: function (data) {
962        jQuery.each(data.d.results, function (index, item) {
963          var vTitle = item.Title_UR == '' ? "#" : item.Title_UR;         
964          var link;
965          if (item.Link != null) {
966            link = item.Link.Url.replace("/english","/urdu");
967          } else {
968            link = ""
969          }                
970          if(item.isLanguage == 1){
971          var lang = '<option value="'+item.Link.Description+'">'+vTitle+'</option>'	  
972          $("#langFooter").append(lang); 
973          }else{         
974          var AnnounHtml = '<li><a href="'+link+'">'+vTitle+'</a>';
975          AnnounHtml += '</li>';
976          $("#landingBottomFooter").append(AnnounHtml);
977          }
978        })        
979      }, eror: function (data) {
980        console.log("An error occurred. Please try again.");
981      }
982    })
983}
984function getLandingPrivacySectionForUrdu(){
985  	var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Policies' and OnHome eq 1)";
986    $("#landingBottomsection2").html("");
987    $.ajax({
988      url: siteCollection + listUrl,
989      type: "GET",
990      headers: {
991        Accept: "application/json;odata=verbose"
992      },
993      success: function (data) {
994        jQuery.each(data.d.results, function (index, item) {
995          var vTitle = item.Title_UR == '' ? "#" : item.Title_UR;        
996          var link;
997          if (item.Link != null) {
998            link = item.Link.Url.replace("/english","/urdu");
999          } else {
1000            link = ""
1001          }                   
1002          var AnnounHtml = '<li><a href="'+link+'">'+vTitle+'</a>';
1003          AnnounHtml += '</li>';
1004          $("#landingBottomsection2").append(AnnounHtml);         
1005        })
1006        },
1007         eror: function (data) {
1008        console.log("An error occurred. Please try again.");
1009      }
1010    })
1011}
1012function getNavHeadersAllItemsForUrdu() {
1013    var NavTitle;
1014    var TitleUrdu;
1015    var listUrl = "/_api/web/lists/getByTitle('SiteMapNavigationHeaders')/items?$orderby=Order_x0020_By asc";
1016    $("#MobileMenu").html("");
1017    $.ajax({
1018      url: siteCollection + listUrl,
1019      type: "GET",
1020      headers: {
1021        Accept: "application/json;odata=verbose"
1022      },
1023      success: function (data) {
1024        jQuery.each(data.d.results, function (index, item) {
1025          TitleUrdu = item.Title_UR == null || item.Title_UR == "" ? "" : item.Title_UR;
1026          NavTitle = item.Title;
1027          var str = NavTitle.replace(/\s/g, '');
1028          str = str.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g,'_');
1029          str = str + "MegaMenu";         
1030          var itemId = item.ID;
1031          var MobileMenu = '<div class="col-md-12 col-lg-3 navigation-links">';
1032          MobileMenu += '<a href="/_catalogs/masterpage/services-facilities.html" class="collapsed" data-toggle="collapse" data-target="#'+str+'" aria-expanded="false">';
1033          MobileMenu += '<h3>' + TitleUrdu + '</h3>';
1034          MobileMenu += '</a>';
1035          MobileMenu += '<ul id="' + str + '" class="collapse"></ul>';
1036          MobileMenu += '</div>';
1037          $("#MobileMenu").append(MobileMenu);
1038          getMobileMenuNavigationForUrdu(itemId, str);
1039        })	
1040        }, 
1041        eror: function (data) {
1042        console.log("An error occurred. Please try again.");
1043      }
1044    })
1045}
1046function getMobileMenuNavigationForUrdu(ItemTitle, UlId) {	
1047    var listUrl = "/_api/web/lists/getByTitle('MobileMenu')/items?$select=*,Category/Title,Category/ID&$expand=Category/Title,Category/ID&$filter=Category/ID eq '" + ItemTitle + "'&$orderby=Order_x0020_By asc";
1048    $.ajax({
1049      url: siteCollection + listUrl,
1050      type: "GET",
1051      headers: {
1052        Accept: "application/json;odata=verbose"
1053      },
1054      success: function (data) {
1055        jQuery.each(data.d.results, function (index, item) {
1056          var Title = item.Title_UR;
1057          var category = item.Category.results[0].Title
1058          var arrOfId = item.CategoryId.results
1059          var vTitle = Title == '' ? "" : Title;
1060          var x;
1061          if (item.Link != null) {
1062            x = item.Link.Url.replace("/english","/urdu");
1063          } else {
1064            x = "#"
1065          }
1066		 var elementId = UlId
1067              var NewMobileMenu = '<li><a href="' + x + '">' + vTitle + '</a></li>';
1068              $('#' + elementId).append(NewMobileMenu);
1069        })
1070      }, eror: function (data) {
1071        console.log("An error occurred. Please try again.");
1072      }
1073    })
1074}
1075function getExploreMenuForUrdu() {
1076    var listUrl = "/_api/web/lists/getByTitle('Explore Navigation')/items?$orderby=Order_x0020_By asc";
1077    $("#ExploreMenu").html("");
1078    $.ajax({
1079      url: siteCollection + listUrl,
1080      type: "GET",
1081      headers: {
1082        Accept: "application/json;odata=verbose"
1083      },
1084      success: function (data) {
1085        jQuery.each(data.d.results, function (index, item) {
1086		  var link = "";
1087		  if(item.Link !=null){
1088		   link = item.Link.Url.replace("/english","/urdu");
1089		  }else{
1090		  	link = "http://dc-spapp01/" 
1091		  }         
1092          var Title = item.Title_UR == '' ? " " : item.Title_UR;
1093          var MobileMenu = '<li><a href="' + link + '">' + Title + '</a></li>';
1094          $("#ExploreMenu").append(MobileMenu);
1095        })
1096      }, eror: function (data) {
1097        console.log("An error occurred. Please try again.");
1098      }
1099    })
1100}
1101function getprivacyLinksForUrdu() {
1102    var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Policies' and OnMaster eq 1)&$top=2&$orderby=Order_x0020_By asc";
1103    $("#footerBottom").html("");
1104    $("#privacyLinksLandingPage").html("");
1105    $.ajax({
1106      url: siteCollection + listUrl,
1107      type: "GET",
1108      headers: {
1109        Accept: "application/json;odata=verbose"
1110      },
1111      success: function (data) {
1112        jQuery.each(data.d.results, function (index, item) {
1113          var vTitle = item.Title_UR == '' ? "#" : item.Title_UR;
1114          var link;
1115          if (item.Link != null) {
1116            link = item.Link.Url.replace("/english","/urdu");
1117          } else {
1118            link = siteCollection;
1119          }
1120          var AnnounHtml = '<li><a href="'+link+'">'+vTitle+'</a>';
1121          AnnounHtml += '</li>';
1122          $("#footerBottom").append(AnnounHtml);
1123          $("#privacyLinksLandingPage").append(AnnounHtml);         
1124        })
1125        
1126      }, eror: function (data) {
1127        console.log("An error occurred. Please try again.");
1128      }
1129   })
1130}
1131function getPrivacyMobileSectionForUrdu(){
1132  	var listUrl = "/_api/web/lists/getByTitle('Footer Content')/items?$select=*&$filter=(Section eq 'Policies' and OnHome eq 1)&$top=2&$orderby=Order_x0020_By asc";
1133    $("#PrivacyMobileSection").html("");
1134    var AnnounHtml = '';
1135    var AnnounHtmlRender = '';
1136    var count = 0;
1137    $.ajax({
1138      url: siteCollection + listUrl,
1139      type: "GET",
1140      headers: {
1141        Accept: "application/json;odata=verbose"
1142      },
1143      success: function (data) {
1144        jQuery.each(data.d.results, function (index, item) {
1145          var vTitle = item.Title_UR == '' ? "#" : item.Title_UR;        
1146          var link;
1147          if (item.Link != null) {
1148            link = item.Link.Url.replace("/english","/urdu");
1149          } else {
1150            link = ""
1151          }
1152          if(count == 0){
1153          	AnnounHtml += '<li><a href="'+link+'">'+vTitle+'</a></li>';
1154          	AnnounHtml += '<li>';
1155			AnnounHtml += '<ul class="d-flex align-items-center flex-wrap flex-xl-nowrap" id="MobileScreenIcons">';
1156			AnnounHtml += '	</ul>';
1157			AnnounHtml += '	</li>';
1158          	count++;
1159          }else{
1160            AnnounHtml += '<li><a href="'+link+'">'+vTitle+'</a></li>';
1161          } 
1162          AnnounHtmlRender +=  AnnounHtml;
1163          AnnounHtml = "";                       
1164        })
1165          $("#PrivacyMobileSection").append(AnnounHtmlRender);
1166        },
1167         eror: function (data) {
1168        console.log("An error occurred. Please try again.");
1169      }
1170    })
1171}
1172function GetServicesMobileUrdu() {
1173    var listUrl = "/_api/web/lists/getByTitle('Services')/items?$orderby=Order_x0020_By asc&$top=9";
1174    $("#ServicesList").html("");
1175    $.ajax({
1176      url: siteCollection + listUrl,
1177      type: "GET",
1178      headers: {
1179        Accept: "application/json;odata=verbose"
1180      },
1181      success: function (data) {
1182        jQuery.each(data.d.results, function (index, item) {
1183          var Title = item.Title_UR == "" || item.Title_UR == null ? "" : item.Title_UR;
1184          var body = item.Body_UR == "" || item.Body_UR == null ? "" : item.Body_UR;           
1185          var imgUrl = "";
1186          if(item.Image !=null){
1187          	imgUrl = item.Image.Url
1188          	var ImgDesc = item.Image.Description
1189          }else{
1190          	imgUrl = "/Style Library/HEC/images/scholarship.png"
1191          	var ImgDesc = "degree"
1192          }
1193          var redUrl = "";
1194          if(item.RedirectLink !=null){
1195          	redUrl = item.RedirectLink.Url.replace("english","urdu")
1196          }else{
1197          	redUrl = ""
1198          }
1199 
1200          AnnounHtml += '<li class="' + ImgDesc + '">';
1201          AnnounHtml += '<a href="'+redUrl+'" class="mobile-link">';
1202          AnnounHtml += '<div class="landing-card"><img src="' + imgUrl + '" alt="'+ImgDesc+'"><div>';
1203          AnnounHtml += '<a href="'+redUrl+'"><h3> ' + Title + ' </h3></a>';
1204          AnnounHtml += '<p class="scholar-para">' + body + '</p></div></div></a>';
1205          AnnounHtml += '<div class="landing-card-link d-none d-lg-block"><a href="' + redUrl + '">تفصیلات دیکھیں</a></div>';
1206          AnnounHtml += '</li>';
1207          $("#ServicesList").html(AnnounHtml);
1208        })
1209        
1210
1211        }, 
1212        eror: function (data) {
1213        console.log("An error occurred. Please try again.");
1214      }
1215    })
1216  }
1217
1218function settingText(){
1219	var  p  = $('.other-slides');
1220	for (var i = 0; i < p.length; i++){
1221		if(parseInt(p[i].id) === parseInt($('.animatedImages').find('.slick-current').find("img").attr('id'))){
1222		if(p[i].style.display == 'none'){
1223		var first = parseInt($('#spot-light :first').attr('id'))
1224		if(first != parseInt(p[i].id)){
1225			p[i].style.display = 'block';
1226			p[i].style.display = 'flex';
1227			$('#spot-light :first').css('display','none');
1228			$('#spot-light :first').removeClass('d-flex');
1229			}else{
1230				p[i].style.display = 'block';
1231				p[i].style.display = 'flex';
1232				p[i].children[0].classList.add('light-text');
1233			}
1234		}
1235		}else{
1236			p[i].style.display = 'none';
1237		}
1238	}
1239}

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.