<!--
//DHTML pour la page d'index
	/***********************************************
	* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
	***********************************************/

	var offsetxpoint=-60 //Customize x offset of tooltip
	var offsetypoint=20 //Customize y offset of tooltip
	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

	function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

	function ddrivetip(thetext, thecolor, thewidth){
	if (ns6||ie){
	if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
	if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
	tipobj.innerHTML=thetext
	enabletip=true
	return false
	}
	}

	function positiontip(e){
	if (enabletip){
	var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
	var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
	//Find out how close the mouse is to the corner of the window
	var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
	var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

	var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

	//if the horizontal distance isn't enough to accomodate the width of the context menu
	if (rightedge<tipobj.offsetWidth)
	//move the horizontal position of the menu to the left by it's width
	tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
	else if (curX<leftedge)
	tipobj.style.left="5px"
	else
	//position the horizontal position of the menu where the mouse is positioned
	tipobj.style.left=curX+offsetxpoint+"px"

	//same concept with the vertical position
	if (bottomedge<tipobj.offsetHeight)
	tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
	else
	tipobj.style.top=curY+offsetypoint+"px"
	tipobj.style.visibility="visible"
	}
	}

	function hideddrivetip(){
	if (ns6||ie){
	enabletip=false
	tipobj.style.visibility="hidden"
	tipobj.style.left="-1000px"
	tipobj.style.backgroundColor=''
	tipobj.style.width=''
	}
	}

	document.onmousemove=positiontip
	
	
//Function pour le ladder et les radiobutton.
function radioclick (b) 
{
	document.getElementById('div1').style.display = (b!=1? 'none':'block');
		document.getElementById('div1_10').style.display = (b!=1? 'none':'block');
		
	document.getElementById('div2').style.display = (b!=2? 'none':'block');
		document.getElementById('div2_10').style.display = (b!=2? 'none':'block');
		
	document.getElementById('div3').style.display = (b!=3? 'none':'block');
		document.getElementById('div3_10').style.display = (b!=3? 'none':'block');
	
	/*for(var j=0; j<3; j++)
	{
		if (b==j) {stylef = 'block';} else {stylef = 'none';}
		divtab = new Array();
		divtab = document.getElementsByName("div"+j);
		
		for(var i=0; i<divtab.length; i++)
			divtab[i].style.display = stylef;
	}*/
}
	
	
// Variable pour le script WoWHead	
var mt_css   = 'http://nzladder.fr/Wh.css';
//var mt_width = 900;


//Variables & function pour le calculateur de points d'arènes
var rat = 1;
var inf = " points";

function CalculT(val)
{
	var calc = 0;
		var calc5 = 0;
		var calc3 = 0;
		var calc2 = 0;

	if (val!=0)
	{
		if(rat==1)
		{
			inf = " points";
			if (val>1500)
			{
				//calc = 1426.79/(1+918.836*Math.exp(-0.00386405*val));
				calc = 1511.25 /(1+1639.26*Math.exp(-0.00412*val));
			}
			else
			{
				//calc = 0.38*val-194;
				calc = (0.22*val)+14;
			}
			if (calc < 1) {calc=0;}
			
			var valtab = [(Math.floor(0.5+calc)),(Math.floor(0.5+(0.88*calc))),(Math.floor(0.5+(0.76*calc)))];
		}
		else
		{
			var valtab = [val,(val/0.88),(val/0.76)];
			inf = " rating";
			
			var i=0;while(i<3)
			{
				if (val > 376)
				{
					valtab[i] = Math.round( Math.log( (((1511.25)/(valtab[i]/1)) -1) / 1639.26) / -0.00412 );	
				}
				else
				{	
					valtab[i] = Math.round( (valtab[i]/1 + 194) / 0.38 );
				}
				i=i+1;
			}	
		}	
	
	document.formulaire.val5.value = valtab[0] + inf ;
	document.formulaire.val3.value = valtab[1] + inf ;
	document.formulaire.val2.value = valtab[2] + inf ;
	}
	else
	{
		document.formulaire.val5.value = "";
		document.formulaire.val3.value = "";
		document.formulaire.val2.value = "";
	}
}

function ratingclick (b) 
{
	rat = b
		document.formulaire.champs1.value = "";
		document.formulaire.champs2.value = "";
		
		document.formulaire.val5.value = "";
		document.formulaire.val3.value = "";
		document.formulaire.val2.value = "";
		
	if (rat == 1) 
	{ 
		document.getElementById('DivR').style.display = 'block';
		document.getElementById('DivP').style.display = 'none';
	}
	else 	
	{ 
		document.getElementById('DivP').style.display = 'block';
		document.getElementById('DivR').style.display = 'none';
	} 
}

function Login()
{
	document.location.href = '/index.php';
}

function ShowHide(val)
{
	if (val==1)
	{
		document.getElementById('Trib1').style.display = ('block');
		document.getElementById('Trib2').style.display = ('none');
	}
	else
	{
		document.getElementById('Trib1').style.display = ('none');
		document.getElementById('Trib2').style.display = ('block');
	}
}


//******************************************************************************
    //  Cookie Functions -- "Night of the Living Cookie" Version (25-Jul-96)
    //  Written by:  Bill Dortch, hIdaho Design <bdortch@hidaho.com>
    
    //  "Internal" function to return the decoded value of a cookie
    function getCookieVal (offset) {
      var endstr = document.cookie.indexOf (";", offset);
      if (endstr == -1)
        endstr = document.cookie.length;
      return unescape(document.cookie.substring(offset, endstr));
    }
    
    //  Function to return the value of the cookie specified by "name".
    //    name -    String object containing the cookie name.
    //    returns - String object containing the cookie value,
    //              or null if the cookie does not exist.
    //
    function GetCookie (name) {
      var arg = name + "=";
      var alen = arg.length;
      var clen = document.cookie.length;
      var i = 0;
      while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
          return getCookieVal (j);
    	i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break; 
      }
      return null;
    }
    
    //  Function to create or update a cookie.
    //    name - String object containing the cookie name.
    //    value - String object containing the cookie value.  May contain
    //         any valid string characters.
    //    [expires] - Date object containing the expiration data of the cookie.  If
    //         omitted or null, expires the cookie at the end of the current session.
    //    [path] - String object indicating the path for which the cookie is valid.
    //         If omitted or null, uses the path of the calling document.
    //    [domain] - String object indicating the domain for which the cookie is
    //         valid. If omitted or null, uses the domain of the calling document.
    //    [secure] - Boolean (true/false) value indicating whether cookie
    //         transmission requires a secure channel (HTTPS).  
    //
    //  The first two parameters are required.  The others, if supplied, must
    //  be passed in the order listed above.  To omit an unused optional field,
    //  use null as a place holder.  For example, to call SetCookie using name,
    //  value and path, you would code:
    //
    //      SetCookie ("myCookieName", "myCookieValue", null, "/");
    //
    //  Note that trailing omitted parameters do not require a placeholder.
    //
    //  To set a secure cookie for path "/myPath", that expires after the
    //  current session, you might code:
    //
    //      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
    //
    function SetCookie (name,value,expires,path,domain,secure) {
      document.cookie = name + "=" + escape (value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
    }
    
    //  Function to delete a cookie. (Sets expiration date to start of epoch)
    //    name -   String object containing the cookie name
    //    path -   String object containing the path of the cookie to delete.
    //             This MUST be the same as the path used to create the cookie, or
    //             null/omitted if no path was specified when creating the cookie.
    //    domain - String object containing the domain of the cookie to delete.
    //             This MUST be the same as the domain used to create the cookie, or
    //             null/omitted if no domain was specified when creating the cookie.
    //
    function DeleteCookie (name,path,domain) {
      if (GetCookie(name)) {
        document.cookie = name + "=" +
          ((path) ? "; path=" + path : "") +
          ((domain) ? "; domain=" + domain : "") +
          "; expires=Thu, 01-Jan-70 00:00:01 GMT";
      }
    }
    //******************************************************************************
		
	function AutoLog(log,pwd)
	{
			 duree = 150;  // Durée de vie du cookie en jours
			 date_expire = new Date();
			 date_expire.setTime(date_expire.getTime() + (duree*24*60*60*1000));
			 SetCookie("cook_login",log,date_expire);
			 SetCookie("cook_password",pwd,date_expire);
	}
	
	function DelCook()
	{
		DeleteCookie("cook_login");
		DeleteCookie("cook_password");
	}
	
//Tribune
function doLoad()
{
    setTimeout( "refresh()", 45*1000 );
}

function refresh()
{
	if (!document.form.checkitbabe.checked)
	{
		window.location.reload();
	}
	else
	{
		setTimeout( "refresh()", 45*1000 );
	}
}
function textLeaveFocus()
{
	document.form.checkitbabe.checked = false;
	CheckClick()
}

function textHasFocus()
{
	document.form.checkitbabe.checked = true;
	CheckClick()
}

function showOnline()
{
	if (parent.frames.length < 1)
	{
		document.getElementById('divListeOnline').style.display = ('block');
	}
}

function CheckClick()
{
	if (document.form.checkitbabe.checked) 
	{ 
		document.getElementById('div').style.display = ('block');
		document.getElementById('div2').style.display = ('none');
	}
	else 
	{
		document.getElementById('div2').style.display = ('block');
		document.getElementById('div').style.display = ('none');
	}
}

function Edit(val,id)
{
	document.form.msgtrib.value = val;
	document.form.IDedit.value = id;
	
	document.getElementById('div3').style.display = ('block');
	document.getElementById('div2').style.display = ('none');
}

function StopEdit()
{
	document.form.IDedit.value = "";
	document.form.msgtrib.value = "";

	document.getElementById('div3').style.display = ('none');
	document.getElementById('div2').style.display = ('block');
}
-->