Project

General

Profile

1
function include_file(filename, filetype) {
2

    
3
	if(!filetype)
4
		var filetype = 'js'; //js default filetype
5

    
6
	var th = document.getElementsByTagName('head')[0];
7
	var s = document.createElement((filetype == "js") ? 'script' : 'link');
8

    
9
	s.setAttribute('type',(filetype == "js") ? 'text/javascript' : 'text/css');
10

    
11
	if (filetype == "css")
12
		s.setAttribute('rel','stylesheet');
13

    
14
	s.setAttribute((filetype == "js") ? 'src' : 'href', filename);
15
	th.appendChild(s);
16

    
17
}
18

    
19
function redirect_to_page (url, timer) {
20
	setTimeout('self.location.href="'+url+'"', timer);
21
}
22

    
23
$(document).ready(function()
24
{
25

    
26
        if($(".jcalendar").length) {
27
            $.insert(WB_URL+"/include/jscalendar/calendar-system.css");
28
          }
29

    
30
        if($(".jsadmin").length) {
31
            $.insert(WB_URL+"/modules/jsadmin/backend.css");
32
          }
33

    
34
	//Add external link class to external links -
35
	$('a[href^="http://"]').filter(function() {
36
		//Compare the anchor tag's host name with location's host name
37
	    return this.hostname && this.hostname !== location.hostname;
38
	  }).addClass("external").attr("target", "_blank");
39

    
40
	/* Add internal link class to external links -   */
41
	$('a[href^="http://"]').filter(function() {
42
		//Compare the anchor tag's host name with location's host name
43
	    return this.hostname && this.hostname == location.hostname;
44
	  }).addClass("internal");
45

    
46
	$('form').attr('autocomplete', 'off');
47

    
48
});
(5-5/7)