/////////////////////////////////////////////////////
//                                                 //
//  ENVIRONMENT DEFAULT W3C DHTML SCRIPTS          //
//  ---------------------------------------------  //
/////////////////////////////////////////////////////


var agt = navigator.userAgent.toLowerCase(), ie, ns, other, major, minor, js, t, win, mac, linux, unix, vax, language, w3c;
var myObj = null;

ns = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1)); 
ie = (agt.indexOf("msie") != -1);

function closeWindow(){
	window.close()
}

other = !(ns || ie);

if (ie){
	t = agt.substring(agt.indexOf('msie')+4,100);
	major = parseInt(t.substring(0,t.indexOf(';')));
	minor = parseFloat(t.substring(0,t.indexOf(';')))
}
if (ns){
	if (agt.indexOf('gecko')!=-1 && agt.indexOf('netscape')!=-1){
		t = agt.substring(agt.indexOf('netscape')+8,100);
		major = parseInt(t.substring(0,t.indexOf('/')));
		minor = parseFloat(t.substring(t.indexOf('/')+1,100))
	}
}

if (ns && major==2 || ie && major==3) js = 1.0
else if (ns && major==3) js = 1.1
else if ((ns && major==4 && minor<=4.05) || (ie && major==4)) js = 1.2
else if ((ie && major==4 && minor>4.05) || (ie && major==5 && minor<=5.5)) js = 1.3
else js = 1.4

win = agt.indexOf("win")!=-1;
mac = agt.indexOf("mac")!=-1;
linux = agt.indexOf("inux")!=-1;
vax = agt.indexOf("vax")!=-1;
unix = !(win || mac || linux || vax)

if (ns){
	if (agt.indexOf('en')!=-1) language='en'
	if (agt.indexOf('fr')!=-1) language='fr'
	if (agt.indexOf('de')!=-1) language='de'
	w3c = (major>=6)
}else if (ie){
	w3c = (major>=5)
}else w3c = false

if ((ns || ie) && major < 4) self.location.href = 'http://fonctions.captis.com/old_browser.html'
if (other) self.location.href = 'http://fonctions.captis.com/non_compliant_browser.html' //In the future, we will do better

if (ie) top.activeBrowser = 1
else if (ns) top.activeBrowser = 2
else top.activeBrowser = 3

top.w3c = w3c;
top.language = language;
top.major = major;
top.scrollposition = 0;
top.positionXLCube = 640



