//
// mes fonction de base pour javascript ...
//

// Fonctions javascript  > source originale www.developpez.net
// check navigateur 
function checkBrowser()  {	
	this.ver=navigator.appVersion;
	this.dom=document.getElementById? 1:0;
	// version tester	
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)? 1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)? 1:0;
	this.ns6=(document.getElementById&&!document.all)? 1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	
	

	// version qui sux
	this.ie4=(document.all && !this.dom)?alert(' 4 Attention votre navigateur nest pas à jour vous pouvez avoir des difficultés pour ce site'):0;
	this.ie55=((this.ver.indexOf("MSIE 5.5")>-1 ) && this.dom)?alert(' 3 Attention votre navigateur nest pas à jour vous pouvez avoir des difficultés pour ce site'):0;
	this.ns4=(document.layers && !this.dom) ? alert('2 Attention votre navigateur nest pas à jour vous pouvez avoir des difficultés pour ce site'):0;
	this.ie5plus=(this.ie6 || this.ie5);
	this.ie5=((this.ver.indexOf("MSIE 5")>-1 ) && this.dom)? alert('1 Attention votre navigateur nest pas à jour vous pouvez avoir des difficultés pour ce site'):0;
	this.ie4plus=(this.ie6 || this.ie5 || this.ie4);

	this.compat =(this.ie7 ||this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5  || this.ns6 );
	return this;
}
//bw= new checkBrowser();
//if ( bw.compat != 1 ) {
//	alert(" votre navigateur nest pas compatible"+ "\r\n" + " le résultat risque detre inattendu" + " \r\n" + " essayez dutiliser un autre navigateur //(mozilla/firefox)");


if (!document.getElementById) {
	document.getElementById = getObjectById;
}
function getObjectById(ID) {
	var obj;
	if (bw.dom)
		return document.getElementById(ID);
	else if (bw.ie4)
		return document.all(ID);
	else if (bw.ns4)
		return eval('document.' + ID);
}
function getObjectByIdParent(ID) {
	var obj;
	if (bw.dom)
		return parent.document.getElementById(ID);
	else if (bw.ie4)
		return parent.document.all(ID);
	else if (bw.ns4)
		return eval('parent.document.' + ID);
}

// en test --> j'ai d'ie chez moi ...
if  (!window.innerWidth) {
	window.innerWidth = compat_innerWidth;
}
function compat_innerWidth() {
	alert('compat_innerWidth() pas implémenté global.js')
}
if  (!window.innerHeight) {
	window.innerHeight = compat_innerHeight;
}
function compat_innerHeight() {
	alert('compat_innerHeight pas implémenté global.js')
}

