function popup(page,width,height)
{
	var page=window.open(page,"new","toolbar=no,left=0,top=0,width="+width+",height="+height+",directories=no,status=no,menubar=no,scrollbars=yes");
	page.focus();
}


//==========================================
// Favoris
//==========================================
function addFav() 
{ 
  if (document.all) 
  { 
  window.external.AddFavorite(location.href, document.title); 
  } 
  else 
  { 
  alert('Vous pouvez faire CTRL + D pour ajouter cette page dans vos signets, ou favoris.') 
  } 
} 

//==========================================
// Show/hide toggle
//==========================================

function toggleview(id)
{
	if ( ! id ) return;
	
	if ( itm = my_getbyid(id) )
	{
		if (itm.style.display == "none")
		{
			my_show_div(itm);
		}
		else
		{
			my_hide_div(itm);
		}
	}
}
function toggleview1(id)
{
	if ( ! id ) return;
	
	if ( itm = my_getbyid(id) )
	{
		if (itm.style.display == "none")
		{
			my_show_div(itm);
		}
		else
		{
			my_hide_div(itm);
		}
	}
}
function toggleview2(id)
{
	if ( ! id ) return;
	
	if ( itm = my_getbyid(id) )
	{
		if (itm.style.display != "none")
		{
			my_hide_div(itm);
		}
	}
}

//==========================================
// Set DIV ID to hide
//==========================================

function my_hide_div(itm)
{
	if ( ! itm ) return;
	
	itm.style.display = "none";
}

//==========================================
// Set DIV ID to show
//==========================================

function my_show_div(itm)
{
	if ( ! itm ) return;
	
	itm.style.display = "";
}

function ShowHide(id1, id2)
{
	if (id1 != '') toggleview1(id1);
	if (id2 != '') toggleview2(id2);
}
function Show(id1, id2)
{
	if (id1 != '') toggleview1(id1);
	if (id2 != '') toggleview1(id2);
}
function Hide(id1, id2)
{
	if (id1 != '') toggleview2(id1);
	if (id2 != '') toggleview2(id2);
}
//==========================================
// Get element by id
//==========================================

function my_getbyid(id)
{
	itm = null;
	
	if (document.getElementById)
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	}
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	
	return itm;
}
//===========================================
// Affichage description
//===========================================
  
    var defaultStatus = "Guide du Travail";

   var xMousePos = 0; // Horizontal position of the mouse on the screen
    var yMousePos = 0; // Vertical position of the mouse on the screen
    var xMousePosMax = 0; // Width of the page
    var yMousePosMax = 0; // Height of the page

    var toolTip = null;
    var toolTipTimeout = null;

    function captureMousePosition(e) {
      if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
      } else if (document.getElementById) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth + window.pageXOffset;
        yMousePosMax = window.innerHeight + window.pageYOffset;
      }

      toolTip.style.top = "" + (yMousePos + 10) + "px";
      toolTip.style.left = "" + (xMousePos + 10) + "px";
      window.status = " x:" + xMousePos + " y:" + yMousePos;
    }

    function clearTip() {
      if(toolTipTimeout != null) {
        clearTimeout(toolTipTimeout);
        toolTipTimeout = null;
      }
      toolTip.style.display = "none";
      while (toolTip.firstChild != null) toolTip.removeChild(toolTip.firstChild);
    }

    function setTip(texte) {
      toolTip.style.display = "block";
      while (toolTip.firstChild != null) toolTip.removeChild(toolTip.firstChild);
      toolTip.appendChild(document.createTextNode(texte));
    }

    function setHtmlTip(texte) {
      toolTip.style.display = "block";
      toolTip.innerHTML = texte;
    }

    function setDelayedTip(texte) {
      toolTipTimeout = setTimeout("toolTip.style.display = 'block';", 500);
      while (toolTip.firstChild != null) toolTip.removeChild(toolTip.firstChild);
      toolTip.appendChild(document.createTextNode(texte));
    }

    function init() {
      toolTip = document.getElementById("Tooltip");
      document.onmousemove = captureMousePosition;
    }
//============================
//verifcation mode de paiement
//============================
function verif_paiement_synthese(){
    if ((document.forms[0].elements[0].checked==false) && (document.forms[0].elements[1].checked==false)&& (document.forms[0].elements[2].checked==false))
    {
      alert("Veuillez choisir un mode de paiement!");
      return false;
    }
return true;
}
function verif_paiement_dossier(){
    if ((document.forms[1].elements[0].checked==false) && (document.forms[1].elements[1].checked==false)&& (document.forms[1].elements[2].checked==false))
    {
      alert("Veuillez choisir un mode de paiement!");
      return false;
    }
return true;
}
 
//========================== 
//Verification inscription
//==========================
function verif_inscription_cb(){
if(document.inscription.mail.value == "")  {
   alert("Veuillez entrer votre mail");
   document.inscription.mail.focus();
   return false;
  }
if(document.inscription.prenom.value == "")  {
   alert("Veuillez entrer votre prénom");
   document.inscription.prenom.focus();
   return false;
  }  
if(document.inscription.cp.value == "")  {
   alert("Veuillez entrer votre code postal");
   document.inscription.cp.focus();
   return false;
  }    
if(document.inscription.ville.value == "")  {
   alert("Veuillez entrer votre ville");
   document.inscription.ville.focus();
   return false;
  }      
}
//========================== 
//Verification facture
//==========================
function verif_inscription_facture(){
if(document.facture.mail.value == "")  {
   alert("Veuillez entrer votre mail");
   document.facture.mail.focus();
   return false;
  }
if(document.facture.prenom.value == "")  {
   alert("Veuillez entrer votre prénom");
   document.facture.prenom.focus();
   return false;
  }  
if(document.facture.cp.value == "")  {
   alert("Veuillez entrer votre code postal");
   document.facture.cp.focus();
   return false;
  }    
if(document.facture.ville.value == "")  {
   alert("Veuillez entrer votre ville");
   document.facture.ville.focus();
   return false;
  }   
if(document.facture.intitule_facture.value == "")  {
   alert("Veuillez entrer votre intitule facture");
   document.facture.intitule_facture.focus();
   return false;
  }  
if(document.facture.nom.value == "")  {
   alert("Veuillez entrer votre nom");
   document.facture.nom.focus();
   return false;
  }  
if(document.facture.adresse.value == "")  {
   alert("Veuillez entrer votre adresse");
   document.facture.adresse.focus();
   return false;
  }        
        
}
