
var progressbar_tick_width = 0;
var interv = 0;
/*
function reload_query() {

	var domain = document.getElementById( 'fsearch').domain.value;
	document.getElementById( 'progressbar').style.width = '0px';
	window.location = 'verifier_domaine.html?domain='+domain+'&submit=rechercher&controler=verifier_domaine&PKG_STANDARD=on';
=> mettre les bons PKG_STANDARD + indiquer le ndd sans www. pour forcer le chargement imédiat de la page

}*/

function timeout_query() {

	var waiting_page_error = document.getElementById( 'waiting_page_error');
	waiting_page_error.style.display = 'block';
	document.getElementById( 'body').style.cursor = 'default';

}

function waiting_page() {

	var centre = document.getElementById( 'centre');
	var waiting_page = document.getElementById( 'waiting_page');
	var content = document.getElementById( 'content');
	var fsearch = document.getElementById( 'fsearch');
	var progressbar = document.getElementById( 'progressbar');
	var waiting_page_error = document.getElementById( 'waiting_page_error');
	var progressbar_ticks = 0;

	waiting_page.style.display = 'block';
	content.style.display = 'none';
	waiting_page_error.style.display = 'none';
	document.getElementById( 'body').style.cursor = 'wait';
	progressbar.style.width = "0px";

	if ( interv) {
		clearInterval( interv);
	}

	if ( fsearch.PKG_TOUTES ) {
		progressbar_ticks += fsearch.PKG_TOUTES.checked ? 27 : 0;
		progressbar_ticks += fsearch.PKG_STANDARD.checked ? 3 : 0;
		progressbar_ticks += fsearch.PKG_EUROPEENES.checked ? 8 : 0;
		progressbar_ticks += fsearch.PKG_INTERNATIONALES.checked ? 7 : 0;
		progressbar_ticks += fsearch.PKG_ANGLOPHONES.checked ? 2 : 0;
		progressbar_ticks += fsearch.PKG_AUTRES.checked ? 3 : 0;
	}
	else {
		ext = document.getElementById( 'ext' );
		progressbar_ticks += ext.value==4095 ? 27 : 0;
		progressbar_ticks += ext.value==2 ? 3 : 0;
		progressbar_ticks += ext.value==1 ? 8 : 0;
		progressbar_ticks += ext.value==8 ? 7 : 0;
		progressbar_ticks += ext.value==4 ? 2 : 0;
		progressbar_ticks += ext.value==16 ? 3 : 0;
	}

	progressbar_tick_width = Math.round( 200 / progressbar_ticks / 2);

	interv = setInterval( progressbar_go, 1500);	// 3 secondes par TLD => 1.5 x 2

	setTimeout( 'timeout_query();', 3000 * progressbar_ticks + 25000);	// 25s apres delai normal relancer

}

function progressbar_go() {

	var progressbar = document.getElementById( 'progressbar');
	var current_width = parseInt( progressbar.style.width);
	var new_width = 0;

	if ( current_width < 200) {
		new_width = current_width + progressbar_tick_width;
		if ( new_width > 200) {
			new_width = 200;
		}
		progressbar.style.width = new_width + 'px';
	}

}


/***********************************************
* 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=-30 //Customize x offset of tooltip  60
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["infosbulles"] : document.getElementById? document.getElementById("infosbulles") : ""

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.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+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
