var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
   if (badBrowser) {
     // later code goes here
   }
/*-------->  tester :
 
  http://docs.jquery.com/Tutorials:PNG_Opacity_Fix_for_IE6

entre autre : png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";


voir aussi : http://www.howtocreate.co.uk/alpha.html (ie 5 à 7)
*/

function get(id) {
    return document.getElementById(id);
}

/*
function _init() {
}
*/
function init() {
	// creation de l'instance
	manager = new jsAnimManager();  

	// la carte de fond 
	oCarteBase = get("cartebase");
	manager.registerPosition("cartebase");
	// la carte de fond et le fondu vers la carte à fond rouge
	oCarteBase.setPosition(0,156);
	animApparitionCarte = manager.createAnimObject("cartebase"); 

	// zones de rayonnement
	ozonesrayonnement = get("zonesrayonnement");  /* img 500x332 */
	manager.registerPosition("zonesrayonnement");  
	ozonesrayonnement.setPosition(0,156);   
	animzonesrayonnement3 = manager.createAnimObject("zonesrayonnement");  // opacité

	// zone europe
	ozoneeurope = get("zoneeurope");  /* img 500x332 */
	manager.registerPosition("zoneeurope");  
	ozoneeurope.setPosition(0,156);   
	animzoneeurope = manager.createAnimObject("zoneeurope");  // opacité
	// info europe
	oinfoeurope = get("infoeurope");  /* img 500x332 */
	manager.registerPosition("infoeurope");  
	oinfoeurope.setPosition(0,120);   
	animinfoeuropeOpacite = manager.createAnimObject("infoeurope");  // opacité
	animinfoeuropeTaille = manager.createAnimObject("infoeurope");  // taille
	animinfoeuropePos    = manager.createAnimObject("infoeurope");  // Position
	animinfoeuropePolice = manager.createAnimObject("infoeurope");  // taille police

	// zone Singapour
	ozonesingapour = get("zonesingapour");  /* img 500x332 */
	manager.registerPosition("zonesingapour");  
	ozonesingapour.setPosition(0,156);   
	animzonesingapour = manager.createAnimObject("zonesingapour");  // opacité
	// info singapour
	oinfosingapour = get("infosingapour");  /* img 500x332 */
	manager.registerPosition("infosingapour");  
	oinfosingapour.setPosition(180,220);   
	animinfosingapourOpacite = manager.createAnimObject("infosingapour");  // opacité
	animinfosingapourTaille = manager.createAnimObject("infosingapour");  // taille
	animinfosingapourPos    = manager.createAnimObject("infosingapour");  // Position
	animinfosingapourPolice = manager.createAnimObject("infosingapour");  // taille police

	// zone Canada
	ozonecanada = get("zonecanada");  /* img 500x332 */
	manager.registerPosition("zonecanada");  
	ozonecanada.setPosition(0,156);   
	animzonecanada = manager.createAnimObject("zonecanada");  // opacité
	// info canada
	oinfocanada = get("infocanada");  /* img 500x332 */
	manager.registerPosition("infocanada");  
	oinfocanada.setPosition(-150,80);   
	animinfocanadaOpacite = manager.createAnimObject("infocanada");  // opacité
	animinfocanadaTaille = manager.createAnimObject("infocanada");  // taille
	animinfocanadaPos    = manager.createAnimObject("infocanada");  // Position
	animinfocanadaPolice = manager.createAnimObject("infocanada");  // taille police

	// zone Brésil
	ozonebresil = get("zonebresil");  /* img 500x332 */
	manager.registerPosition("zonebresil");  
	ozonebresil.setPosition(0,156);   
	animzonebresil = manager.createAnimObject("zonebresil");  // opacité
	// info Brésil
	oinfobresil = get("infobresil");  /* img 500x332 */
	manager.registerPosition("infobresil");  
	oinfobresil.setPosition(-100,150);   
	animinfobresilOpacite = manager.createAnimObject("infobresil");  // opacité
	animinfobresilTaille = manager.createAnimObject("infobresil");  // taille
	animinfobresilPos    = manager.createAnimObject("infobresil");  // Position
	animinfobresilPolice = manager.createAnimObject("infobresil");  // taille police
	
	animApparitionCarte.add({
		property: Prop.opacity, 
		from : 0,
		to: 1, 
		duration: 1000,
		oncomplete: animzonesrayonnement3.add({
			property: Prop.opacity,
			from: 0, to: 1,  
			duration: 2000
		})
	});

	cacher('infoeurope');
	cacher('infosingapour');
	cacher('infocanada');
	cacher('infobresil');

}

// europe
function ZoneEurope(effet) { // on ou off

	if (effet=='on')
		animzoneeurope.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000
		});
	else animzoneeurope.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 1000
		});
}
function ZoneInfoEurope(effet) { // on ou off

	if (effet=='on') {
		montrer("infoeurope");
		if (get('infosingapour').style.display=="block") ZoneInfoSingapour('off');
		if (get('infocanada').style.display=="block") ZoneInfoCanada('off');
		if (get('infobresil').style.display=="block") ZoneInfoBresil('off');
		animinfoeuropeOpacite.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfoeuropeTaille.add({
			property: Prop.dimension,
			from: new Dim(20,15),
			to: new Dim(200,200),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfoeuropePos.add({
			property: Prop.position,
			from: new Pos(0,120),
			to: new Pos(40,220),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfoeuropePolice.add({
			property: Prop.fontSize,
			from: 1,
			to: 9,
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
	}
	else {
		animinfoeuropeOpacite.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 500
		});
		animinfoeuropeTaille.add({
			property: Prop.dimension, to: new Dim(20,15),
			duration: 500
		});
		animinfoeuropePolice.add({
			property: Prop.fontSize,
			from: 9,
			to: 1,
			duration: 500,
			onComplete: function () { cacher('infoeurope'); }
		});
	}
}

function cacher(div) {
    obj = get(div);
    obj.style.display="none";
    return;
}
function montrer(div) {
    obj = get(div);
    obj.style.display="block";
    return;
}

// Singapour
function ZoneSingapour(effet) { // on ou off

	if (effet=='on')
		animzonesingapour.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000
		});
	else animzonesingapour.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 1000
		});
}
function ZoneInfoSingapour(effet) { // on ou off

	if (effet=='on') {
		montrer("infosingapour");
		if (get('infoeurope').style.display=="block") ZoneInfoEurope('off');
		if (get('infocanada').style.display=="block") ZoneInfoCanada('off');
		if (get('infobresil').style.display=="block") ZoneInfoBresil('off');
		animinfosingapourOpacite.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfosingapourTaille.add({
			property: Prop.dimension,
			from: new Dim(20,15),
			to: new Dim(150,120),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfosingapourPos.add({
			property: Prop.position,
			from: new Pos(180,200),
			to: new Pos(40,260),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfosingapourPolice.add({
			property: Prop.fontSize,
			from: 1,
			to: 9,
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
	}
	else {
		animinfosingapourOpacite.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 500
		});
		animinfosingapourTaille.add({
			property: Prop.dimension, to: new Dim(20,15),
			duration: 500
		});
		animinfosingapourPos.add({
			property: Prop.position,
			to: new Pos(180,200),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfosingapourPolice.add({
			property: Prop.fontSize,
			from: 9,
			to: 1,
			duration: 500,
			onComplete: function () { cacher('infosingapour'); }
		});
	}
}

// Canada
function ZoneCanada(effet) { // on ou off

	if (effet=='on')
		animzonecanada.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000
		});
	else animzonecanada.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 1000
		});
}
function ZoneInfoCanada(effet) { // on ou off

	if (effet=='on') {
		montrer("infocanada");
		if (get('infoeurope').style.display=="block") ZoneInfoEurope('off');
		if (get('infosingapour').style.display=="block") ZoneInfoSingapour('off');
		if (get('infobresil').style.display=="block") ZoneInfoBresil('off');
		animinfocanadaOpacite.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfocanadaTaille.add({
			property: Prop.dimension,
			from: new Dim(20,15),
			to: new Dim(150,120),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfocanadaPos.add({
			property: Prop.position,
			from: new Pos(-150,80),
			to: new Pos(40,260),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfocanadaPolice.add({
			property: Prop.fontSize,
			from: 1,
			to: 9,
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
	}
	else {
		animinfocanadaOpacite.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 500
		});
		animinfocanadaTaille.add({
			property: Prop.dimension, to: new Dim(20,15),
			duration: 500
		});
		animinfocanadaPos.add({
			property: Prop.position,
			to: new Pos(180,200),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfocanadaPolice.add({
			property: Prop.fontSize,
			from: 9,
			to: 1,
			duration: 500,
			onComplete: function () { cacher('infocanada'); }
		});
	}
}

// Brésil
function ZoneBresil(effet) { // on ou off

	if (effet=='on')
		animzonebresil.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000
		});
	else animzonebresil.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 1000
		});
}
function ZoneInfoBresil(effet) { // on ou off

	if (effet=='on') {
		montrer("infobresil");
		if (get('infoeurope').style.display=="block") ZoneInfoEurope('off');
		if (get('infosingapour').style.display=="block") ZoneInfoSingapour('off');
		if (get('infocanada').style.display=="block") ZoneInfoCanada('off');
		animinfobresilOpacite.add({
			property: Prop.opacity, 
			from : 0,
			to: 1, 
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfobresilTaille.add({
			property: Prop.dimension,
			from: new Dim(20,15),
			to: new Dim(150,120),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfobresilPos.add({
			property: Prop.position,
			from: new Pos(-120,200),
			to: new Pos(40,260),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfobresilPolice.add({
			property: Prop.fontSize,
			from: 1,
			to: 9,
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
	}
	else {
		animinfobresilOpacite.add({
			property: Prop.opacity, 
			from : 1,
			to: 0, 
			duration: 500
		});
		animinfobresilTaille.add({
			property: Prop.dimension, to: new Dim(20,15),
			duration: 500
		});
		animinfobresilPos.add({
			property: Prop.position,
			to: new Pos(180,200),
			duration: 1000,
			ease: jsAnimEase.parabolicPos
		});
		animinfobresilPolice.add({
			property: Prop.fontSize,
			from: 9,
			to: 1,
			duration: 500,
			onComplete: function () { cacher('infobresil'); }
		});
	}
}
