function checkBrowser() {	this.ver=navigator.appVersion;this.dom=document.getElementById?1:0;this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;this.ie55=((this.ver.indexOf("MSIE 5.5")>-1 || this.ie6) && this.dom)?1:0;this.ie5=((this.ver.indexOf("MSIE 5")>-1 || this.ie5 || this.ie6) && this.dom)?1:0;this.ie4=(document.all && !this.dom)?1:0;this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;this.ns4=(document.layers && !this.dom)?1:0;this.ie4plus=(this.ie6 || this.ie5 || this.ie4);this.ie5plus=(this.ie6 || this.ie5);this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);return this;}
bw = new checkBrowser();
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);}}
function cancelBubble(netEvent) { if (document.all) { window.event.cancelBubble = true; } else { netEvent.cancelBubble = true; } }
	
function NoError(){ return true; } //window.onerror=NoError;

window.defaultStatus = "Wotaland";

//if (top.frames.length!=0) { top.location=self.document.location; }

function confirmation(txt_msg,links) { var resultats = confirm(" " + txt_msg + " "); if(resultats=="1") { if(links!="") { location.href= links; } return true; } else { return false; }}
function HideSelect(what) { oSelects = document.getElementsByTagName('SELECT'); if (oSelects.length > 0) { for (i = 0; i < oSelects.length; i++) { oSelects[i].style.visibility = what;  }}}

function popz(urls,w,h) {
	
	var top	=((screen.height-h)/2)-50;
  var left=(screen.width-w)/2;
	var POPZ = window.open(urls, '','Width='+w+'px,Height='+h+'px,left='+left+',top='+top+', toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1');
	
}

function SHI(object_id){ // affiche masque sur même clique
 
 var obj = document.getElementById(object_id);	

 	if( obj.style.display == 'block') {
 		obj.style.display='none';
 		what = 'none';
 		//HideSelect('visible');
 	} else {
 		obj.style.display='block';
 		what = 'block';
 		//HideSelect('hidden');
	}
	
}

function IfImgIsLoad( cibleZ, jsZ ) { // action "js" if img "cibleZ" is load !
	
	//alert ( cibleZ + " / " + jsZ );
	
	if( document.getElementById(cibleZ) ) {	
		
		var MyImgLoad	= document.getElementById(cibleZ);
		
		if( MyImgLoad.complete ) { 
			eval(jsZ);
		} else { 
			setTimeout("IfImgIsLoad('"+cibleZ+"','"+jsZ+"')",250);
		}
	} else {
		setTimeout("IfImgIsLoad('"+cibleZ+"','"+jsZ+"')",250);
	}
	
	
	
}


function runOnLoad(f) {
    if (runOnLoad.loaded) f();    // If already loaded, just invoke f() now.
    else runOnLoad.funcs.push(f); // Otherwise, store it for later
}

runOnLoad.funcs = []; // The array of functions to call when the document loads
runOnLoad.loaded = false; // The functions have not been run yet.

// Run all registered functions in the order in which they were registered.
// It is safe to call runOnLoad.run() more than once: invocations after the
// first do nothing. It is safe for an initialization function to call
// runOnLoad() to register another function.
runOnLoad.run = function() {
    if (runOnLoad.loaded) return;  // If we've already run, do nothing

    for(var i = 0; i < runOnLoad.funcs.length; i++) {
        try { runOnLoad.funcs[i](); }
        catch(e) { /* An exception in one function shouldn't stop the rest */ }
    }
    
    runOnLoad.loaded = true; // Remember that we've already run once.
    delete runOnLoad.funcs;  // But don't remember the functions themselves.
    delete runOnLoad.run;    // And forget about this function too!
};

// Register runOnLoad.run() as the onload event handler for the window
if (window.addEventListener)
    window.addEventListener("load", runOnLoad.run, false);
else if (window.attachEvent) window.attachEvent("onload", runOnLoad.run);
else window.onload = runOnLoad.run;



// Insérer l'appel d'un fichier javascript dans l'en-tête de la page
// exemple d'utilisation: include('chemin/script.js');
function include(file) {
  var Head = document.getElementsByTagName('head')[[0]];
  var head_inc = document.createElement('script');
  head_inc.setAttribute('type','text/javascript');
  head_inc.setAttribute('src',file);
  Head.appendChild(head_inc);		
  //return false;

}

function Update_flash(){
  
	if (!document.all || !window.print || window.opera) { return; }
  if (document.getElementsByTagName) { 

		var theObjects = document.getElementsByTagName("object");
   	for (var i = 0; i < theObjects.length; i++) {
      div = theObjects[i].parentNode.insertBefore(document.createElement("div"), theObjects[i]);
      div.style.display="none";
      div.appendChild(theObjects[i]);
      if(div.firstChild.data){
				div.firstChild.removeAttribute('data');
			}
      var theParams = div.getElementsByTagName("param");
			for (var j = 0; j < theParams.length; j++) {
				if(theParams[j].name.toLowerCase() == 'flashvars'){
					var theFlashVars = theParams[j].value;
          break;
				}
			}
      var theInnnerHTML = div.innerHTML;
			var re = /<param name="FlashVars" value="">/ig;
			theInnnerHTML = theInnnerHTML.replace(re, "<param name='FlashVars' value='" + theFlashVars + "'>");
			div.outerHTML = theInnnerHTML;
		}

	var embs = document.getElementsByTagName("embed");
	for (i=0; i<embs.length; i++) {
		embs[i].outerHTML = embs[i].outerHTML;
	}
 }
}

runOnLoad( function(){ Update_flash(); } );

// ---------------------------------------------------
// MyLib 1.0.0 
// ---------------------------------------------------

function getID(el){return document.getElementById(el);}
function getTAG(el){return document.getElementsByTagName(el);}


// ---------------------------------------------------
// MyTab 1.2.2 
// ---------------------------------------------------

MyTab_nbr = 0;

function MyTab_init(t){if(!getTAG('div')){return;}var l='',d=getTAG('div'),b=getID('MyTab_bar');for(var i=0;i<d.length;i++){var el=d[i],rel=String(el.getAttribute('rel')),n=el.getAttribute('name');if(n!=''&&rel=='MyTab'){MyTab_nbr++;l+='<a href="#'+MyTab_nbr+'" id="MyTab_but_'+MyTab_nbr+'" class="MyTab_but" onclick="MyTab_shw('+MyTab_nbr+')">'+n+'</a>';el.className='MyTab_pan';el.id='MyTab_'+MyTab_nbr;}};b.innerHTML=l;if(!t){t=1;};MyTab_shw(t);}
function MyTab_shw(w){for(var n=1;n<MyTab_nbr+1;n++){if(getID('MyTab_'+n)){getID('MyTab_'+n).style.display='none';}if(getID('MyTab_but_'+n)){getID('MyTab_but_'+n).className='MyTab_but';}}getID('MyTab_'+w).style.display='inline';getID('MyTab_but_'+w).className='MyTab_slct';}

