summaryrefslogtreecommitdiffstats
path: root/HTML/script.js
blob: 24ed239df94276a43e73b9f5f9c1d363d0d959f9 (plain)
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
/* $Id$
*/

var isRemoteAvail = false;
var remoteweb     = 'http://start.mandriva.com/';

String.prototype.rtrim     = function() { return this.replace(/\s*$/, ""); };
String.prototype.ltrim     = function() { return this.replace(/^\s*/, ""); };
String.prototype.trim      = function() { return this.rtrim().ltrim(); };
String.prototype.encodeURI = function() { return escape( this ).replace(/\+/g,"%2B"); };

function actOnline() {
	var release = '';
	try {
		var t = document.getElementsByTagName('meta');
		for( var i=0; i<t.length; i+=1 ) {
			if( t.item(i).getAttribute('name') == 'mdv.release' || t.item(i).getAttribute('name') == 'mdv:release' ) {
				release = t.item(i).getAttribute('content');
				break;
			}
		}
	}
	catch( e ) { return false; } 
	finally { }

        if( release !== '' ) {
		remoteweb += '?r='+release.trim().encodeURI();
	}
	parent.location = remoteweb;
	return true;
}
function actOffline() { return true; }
function bodyLoad() { if( isRemoteAvail ) { actOnline(); } else { actOffline(); } }
function imgLoad()  { isRemoteAvail = true; }
function imgError() { isRemoteAvail = false; var i = document.getElementById('i'); i.parentNode.removeChild(i); }
window.alert = function() {}

/*
*/