PageSourceSearch

https://batteries4laptop.com/include/header.js

js batteries4laptop.com collected 2026-10-05 22:57:57 UTC 6,166 bytes, 245 lines download raw bytes

1		function addtocart(Gcode,itemno,qty)
2		{
3			var url = window.location.toString();
4
5			window.location="/createhtml/Addtocart.aspx?item="+ itemno +"&qty=1&sell=''" + "&backurl=" + url;
6		}
7		function getdata()
8		{
9			//alert("Here");
10				 getUsercontrol() ;
11				 getfooter();
12		}
13		function chkEnterPress4Search(e)
14		{
15			if(e.keycode==9)
16			{
17			return clear();
18			}
19
20			if(e.keyCode==13)
21			{
22				return search();
23			}
24
25
26		}
27		function search()
28		{
29			
30			if(trimWhitespace(document.getElementById('txtSearch').value)=="Search")
31			{
32				alert("Please enter the search string.");
33				//document.getElementById('txtSearch').select();
34				document.getElementById('txtSearch').focus();
35				return false;
36			}
37			if(trimWhitespace(document.getElementById('txtSearch').value).length==0)
38			{
39				alert("Please enter the search string.");
40				document.getElementById('txtSearch').select();
41				document.getElementById('txtSearch').focus();
42				return false;
43			}
44			if(trimWhitespace(document.getElementById('txtSearch').value).length <=2)
45			{
46				alert("Please enter the search string greater than 2 character.");
47				document.getElementById('txtSearch').select();
48				document.getElementById('txtSearch').focus();
49				return false;
50			}
51			else
52			{
53				var keyword = document.getElementById('txtSearch').value;
54				
55				
56				document.location.href="/newsearch/Global_search.aspx?txtSearch=" + keyword + "&exact=exact&ordersearch=popular";
57				
58				return true;
59			}
60		}
61		
62		
63		function trimWhitespace(string) 
64		{
65			var newString  = '';
66			var substring  = '';
67			beginningFound = false;
68			
69			// copy characters over to a new string
70			// retain whitespace characters if they are between other characters
71			for (var i = 0; i < string.length; i++) 
72			{
73				
74				// copy non-whitespace characters
75				if (string.charAt(i) != ' ' && string.charCodeAt(i) != 9) 
76				{
77					
78					// if the temporary string contains some whitespace characters, copy them first
79					if (substring != '') 
80					{
81						newString += substring;
82						substring = '';
83					}
84					newString += string.charAt(i);
85					if (beginningFound == false) beginningFound = true;
86				}
87				
88				// hold whitespace characters in a temporary string if they follow a non-whitespace character
89				else if (beginningFound == true) substring += string.charAt(i);
90			}
91			return newString;
92		}
93		
94		
95		
96		
97
98		function getUsercontrol() 
99		{
100			
101			var req = false;
102			
103					
104			var rand_no = Math.random();
105			refurl= document.referrer;
106					
107			url = "/CreateHTML/getheadernormal.aspx?simply=" + rand_no + "&refurl=" + refurl
108			//alert(url);
109					
110						
111			// For Safari, Firefox, and other non-MS browsers
112			if (window.XMLHttpRequest) {
113				try {
114				req = new XMLHttpRequest();
115				} catch (e) {
116				req = false;
117				}
118			} else if (window.ActiveXObject) {
119				// For Internet Explorer on Windows
120				try {
121				req = new ActiveXObject("Msxml2.XMLHTTP");
122				} catch (e) {
123				try {
124					req = new ActiveXObject("Microsoft.XMLHTTP");
125				} catch (e) {
126					req = false;
127				}
128				}
129			}
130			
131			if (req)
132			 {
133				// Synchronous request, wait till we have it all
134				req.open('GET', url, false);
135				req.send(null);
136				
137				
138				//element.innerHTML = req.responseText;
139				var str =req.responseText;
140				try {
141				document.getElementById('headercon').innerHTML=str
142				} catch (e) {}
143				document.close();
144				
145						
146				
147			} 
148		}
149		
150		function getfooter() 
151		{
152			
153			var req = false;
154			
155					
156			var rand_no = Math.random();
157			refurl= document.referrer;
158					
159			url = "/CreateHTML/getfooter.aspx?simply=" + rand_no + "&refurl=" + refurl
160			//alert(url);
161					
162						
163			// For Safari, Firefox, and other non-MS browsers
164			if (window.XMLHttpRequest) {
165				try {
166				req = new XMLHttpRequest();
167				} catch (e) {
168				req = false;
169				}
170			} else if (window.ActiveXObject) {
171				// For Internet Explorer on Windows
172				try {
173				req = new ActiveXObject("Msxml2.XMLHTTP");
174				} catch (e) {
175				try {
176					req = new ActiveXObject("Microsoft.XMLHTTP");
177				} catch (e) {
178					req = false;
179				}
180				}
181			}
182			
183			if (req)
184			 {
185				// Synchronous request, wait till we have it all
186				req.open('GET', url, false);
187				req.send(null);
188				
189				
190				//element.innerHTML = req.responseText;
191				var str =req.responseText;
192				try {
193				document.getElementById('footercon').innerHTML=str
194				} catch (e) {}
195				document.close();
196				
197						
198				
199			} 
200		}
201		function google()
202		{
203			window.location.href = "http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=" + document.location.href + "&title=" + document.title;
204		}
205		function Digg()
206		{
207			window.location.href = "http://digg.com/submit?phase=2&url="+document.location.href+"&title="+document.title;
208		}
209		function FURL()
210		{
211			window.location.href = "http://www.furl.net/store?s=f&to=0&u="+document.location.href+"&ti="+document.title;
212		}
213		function REDDIT()
214		{
215			window.location.href = "http://reddit.com/submit?url="+document.location.href+"&title="+document.title;
216		}
217		function STUMBLEUPON()
218		{
219			window.location.href = "http://www.stumbleupon.com/submit?url="+document.location.href+"&title="+document.title;
220		}
221		function TECHNORATI()
222		{
223			window.location.href = "http://technorati.com/faves?add="+document.location.href;
224		}
225		function SQUIDOO()
226		{
227			window.location.href = "http://www.squidoo.com/lensmaster/bookmark?"+document.location.href+"&title="+document.title;
228		}
229		function WINDOWS()
230		{
231			window.location.href = "https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url="+document.location.href+"&title="+document.title;
232		}
233		function YAHOO()
234		{
235			window.location.href = "http://myweb.yahoo.com/myresults/bookmarklet?u="+document.location.href+"&t="+document.title;
236		}
237		function ASK()
238		{
239			window.location.href = "http://myjeeves.ask.com/mysearch/BookmarkIt?v=1.2&t=webpages&url="+document.title.href+"&title="+document.title;
240		}
241		
242		
243		
244		
245		

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.