summaryrefslogtreecommitdiffstats
path: root/HTML/script.js
blob: 9126143ddd4e90589f7c3a118d51fbdf6d7d53c4 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* $Id$
*/

/* */
var isRemoteAvail = false;
	
/* Remote web site */
var remoteweb     = 'http://start.mandriva.com/';
	
/* Display a warning message on parent document in specific element if available.
   @param  text  string to display
   @param  color text color
   @param  background background color
   @return boolean
*/
/*
function parentMessage( text, color, background ) {
	var p = parent.window.document.getElementById('status');
	if( p == null )
		return false;

	p.style.display = 'none';
	if( text == '' )
		return true;

	p.innerHTML        = text;
	p.style.color      = color;
	p.style.background = background;
	p.style.display    = 'block';
	return true;
}
*/
	
/* Redirect parent document to available remote web site
   with the current language code.
   @return boolean
*/
function actOnline() {
	var lang = null;

	try {
		lang = parent.window.document.documentElement.attributes.getNamedItem('lang').value;
	} catch( e ) {
		return false;
	} finally { }
	
        if( lang != null )
		remoteweb += '?l='+lang;
	parent.location = remoteweb;
	//parentMessage('You are online. Go to <a href="'+remoteweb+'">'+remoteweb+'</a>','#006000','#aaff99');
	return true;
}
	
/* If the remote website is not available.
   @return boolean
*/
function actOffline() { 
	//parentMessage('You are offline...','#a00000','#ffaa88');
	//TODO write <meta http-equiv="Refresh" content="60" /> in <head> ?
	return true;
}

function bodyLoad() { if( isRemoteAvail ) { actOnline(); } else { actOffline(); } }
function imgLoad()  { isRemoteAvail = true; }
function imgError() { isRemoteAvail = false; }

window.alert = function() {}
//parentMessage( 'Mandriva...', '#000' );

/* 
*/