File: open_google_win.js

package info (click to toggle)
horde3 3.1.3-4etch7
  • links: PTS
  • area: main
  • in suites: etch
  • size: 22,876 kB
  • ctags: 18,071
  • sloc: php: 75,151; xml: 2,979; sql: 1,069; makefile: 79; sh: 64
file content (50 lines) | stat: -rw-r--r-- 1,189 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function open_google_win(args)
{
    var val, url = '';

    for (var i = 0; i < document.google.area.length; i++) {
        if (document.google.area[i].checked) {
            val = document.google.area[i].value;
            break;
        }
    }

    switch (val) {
	case 'web':
    	url = 'http://www.google.com/search?';
	    break;

	case 'images':
	    url = 'http://images.google.com/images?';
        break;

	case 'groups':
	    url = 'http://groups.google.com/groups?';
        break;

	case 'directory':
	    url = 'http://www.google.com/search?cat=gwd%2FTop&';
        break;

	case 'news':
	    url = 'http://news.google.com/news?';
        break;

	default:
    	url = 'http://www.google.com/search?';
    }
    url += 'q=';
    if (typeof encodeURIComponent == 'undefined') {
        url += escape(document.google.q.value);
    } else {
        url += encodeURIComponent(document.google.q.value);
    }

    var name = 'Google';
    var param = 'toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes,width=800,height=600,left=0,top=0';

    eval('name = window.open(url, name, param)');
    if (!eval('name.opener')) {
        eval('name.opener = self');
    }
}