text changes to registration mail content
[namibia] / public / min / builder / bm.js
1 javascript:(function() {
2     var d = document
3        ,uris = []
4        ,i = 0
5        ,o
6        ,home = (location + '').split('/').splice(0, 3).join('/') + '/';
7     function add(uri) {
8         return (0 === uri.indexOf(home))
9             && (!/[\?&]/.test(uri))
10             && uris.push(escape(uri.substr(home.length)));
11     };
12     function sheet(ss) {
13         // we must check the domain with add() before accessing ss.cssRules
14         // otherwise a security exception will be thrown
15         if (ss.href && add(ss.href) && ss.cssRules) {
16             var i = 0, r;
17             while (r = ss.cssRules[i++])
18                 r.styleSheet && sheet(r.styleSheet);
19         }
20     };
21     while (o = d.getElementsByTagName('script')[i++])
22         o.src && !(o.type && /vbs/i.test(o.type)) && add(o.src);
23     i = 0;
24     while (o = d.styleSheets[i++])
25     /* http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-DocumentStyle-styleSheets
26     document.styleSheet is a list property where [0] accesses the 1st element and 
27     [outOfRange] returns null. In IE, styleSheets is a function, and also throws an 
28     exception when you check the out of bounds index. (sigh) */
29         sheet(o);
30     if (uris.length)
31         window.open('%BUILDER_URL%#' + uris.join(','));
32     else
33         alert('No js/css files found with URLs within "' 
34             + home.split('/')[2]
35             + '".\n(This tool is limited to URLs with the same domain.)');
36 })();