PageSourceSearch

https://deepamtravels.com/scripts/common.js?760

js deepamtravels.com collected 2026-10-02 01:27:10 UTC 3,997 bytes, 116 lines download raw bytes

1function jsTrim(strvalue) {
2	if(strvalue!=''){
3		return strvalue.replace(/^(\s)+/g, '').replace(/(\s)+$/g, '');
4	}else{
5		return '';
6	}
7}
8
9function isName(strvalue) {
10	return (/^[A-Z\sa-z. ]+$/).test(strvalue);//Allow name with alphabets,space and dot
11}
12
13function isNumeric(strvalue) {
14	var IsNum =  strvalue.replace(/0/g, '');
15	if(IsNum != '')
16		return /^(\d-|[0-9]\d*)$/.test(strvalue);
17	else
18		return false;
19}
20
21function isMobileNumber(strvalue){
22       return (/^[6789][0-9]{9}$/).test(strvalue);
23}
24
25function isEmail(strvalue) {
26	return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(strvalue)
27}
28
29function isAlpha(strvalue) {
30	return (/^[A-Z\sa-z]+$/).test(strvalue);
31}
32
33function isFloat(strvalue) {
34	//return /^(\d+.)$/.test(strvalue);
35	return strvalue.match(/^\d{0,20}(?:\.\d{0,20}){0,1}$/);
36}
37
38function number_format (number, decimals, dec_point, thousands_sep) {
39	number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
40	var n = !isFinite(+number) ? 0 : +number,
41	prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
42	sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
43	dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
44	s = '',
45	toFixedFix = function (n, prec) {
46		var k = Math.pow(10, prec);
47		return '' + Math.round(n * k) / k;
48	};
49	s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
50	if (s[0].length > 3) {
51		s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
52	}
53	if ((s[1] || '').length < prec) {
54		s[1] = s[1] || '';
55		s[1] += new Array(prec - s[1].length + 1).join('0');
56	}
57	return s.join(dec);
58}
59function FnConverttimefrom12hrto24hrFormat(time){
60	var hours = Number(time.match(/^(\d+)/)[1]);
61	var minutes = Number(time.match(/:(\d+)/)[1]);
62	var AMPM = time.match(/\s(.*)$/)[1];
63	if(AMPM == "PM" && hours<12) hours = hours+12;
64	if(AMPM == "AM" && hours==12) hours = hours-12;
65	var sHours = hours.toString();
66	var sMinutes = minutes.toString();
67	if(hours<10) sHours = "0" + sHours;
68	if(minutes<10) sMinutes = "0" + sMinutes;
69	return (sHours + ":" + sMinutes);
70}
71function FnMiniPrint(DivID,MiniPrintDivId){
72// here we have to change wen in this fuction call at the time we set that div id to use element(1,2..) and in htis function param to increase based on that div id element no to set param no.
73          var element = document.getElementById(DivID);
74                if(element.innerHTML === 'Zoom Out') {
75                        element.innerHTML = 'Zoom In';
76                        $('#'+MiniPrintDivId).css('MozTransform','scale('+0.5,0.5+')');
77                        $('#'+MiniPrintDivId).css('zoom', ''+0.5,0.5+ '%');
78                }else{
79                        element.innerHTML = 'Zoom Out';
80                        $('#'+MiniPrintDivId).css('MozTransform','scale('+1,1+')');
81                        $('#'+MiniPrintDivId).css('zoom', ''+1,1+ '%');
82                }
83}
84function alpha(e) {
85    var k;
86    document.all ? k = e.keyCode : k = e.which;
87    return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 32 || (k >= 48 && k <= 57));
88}
89function FnClearSess(VarType=''){
90        localStorage.setItem('ind_seat_','');
91        localStorage.setItem('ind_bpdp_', '');
92        localStorage.setItem('tripid','');
93        if(VarType == ''){
94                localStorage.setItem('passengerdata','');
95                localStorage.setItem('seatdata','');
96        }
97}
98
99function FnBuildSearchUrl(VarStation = "", VarTo = "") {
100 	var url = 'search/' + jsTrim(VarStation) + '-to-' + jsTrim(VarTo);
101	$("#searchbus").attr('action', url);
102	$("#searchbus").submit();
103}
104
105function FnWholePageLoading(VarType) {
106    if(VarType=='show') {
107        $('#WholePageLoader').removeClass('noDisplay');
108    } else if(VarType=='hide') {
109        $('#WholePageLoader').addClass('noDisplay');
110    }
111}
112function FnRoundNum(n, digits) {
113  let factor = Math.pow(10, digits);
114  return Math.round((n + 1e-10) * factor) / factor;
115}
116

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.