


function rollon(_this){_this.src = "images/"+_this.id+"_on.jpg";}
function rolloff(_this){_this.src = "images/"+_this.id+"_off.jpg";}
function rollonpng(_this){_this.src = "images/"+_this.id+"_on.png";}
function rolloffpng(_this){_this.src = "images/"+_this.id+"_off.png";}
function rollongif(_this){_this.src = "images/"+_this.id+"_on.gif";}
function rolloffgif(_this){	_this.src = "images/"+_this.id+"_off.gif";}
function boutonrollon(_this){_this.src = "images/boutons/"+_this.id+"_on.png";}
function boutonrolloff(_this){_this.src = "images/boutons/"+_this.id+"_off.png";}
function rollimage(_this,image){_this.src = image;}

function startAnim() {
	var e = document.getElementById('newsbox');
	pos_initial = e.clientHeight + 10;
	pos = pos_initial;
	setInterval('anim()', 20);
}
function anim() {
	var e = document.getElementById('newslist');
	e.style.visibility = 'visible';
	e.style.top = Math.floor(pos) + 'px';
	pos = pos - speed;
	if(pos < -e.clientHeight) pos = pos_initial;
}

var xmlhttp;

function chargeville1(str)
{
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	{
	  alert ("Browser does not support HTTP Request");
	  return;
	}
	  
	document.getElementById("attente1").innerHTML="<img src='/images/loader.gif'>";

	pays=document.getElementById('f_enlpays');
	  
	var url="/ajax/chargeville.php";
	url=url+"?cp="+str;
	url=url+"&pays="+pays.value ; //+strpays;
	url=url+"&tc=enl" ; 
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChanged1;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);

}
function chargevilleclient(str)
{
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	{
	  alert ("Browser does not support HTTP Request");
	  return;
	}
	  
	//document.getElementById("attente1").innerHTML="<img src='/images/loader.gif'>";
  
	var url="/ajax/chargeville.php";
	url=url+"?cp="+str;
	url=url+"&pays=F" ; //+strpays;
	url=url+"&tc=cli" ; 
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChanged1;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);

}

function stateChanged1()
{
	if (xmlhttp.readyState==4)
	{
	document.getElementById("txtHint1").innerHTML=xmlhttp.responseText;

	document.getElementById("attente1").innerHTML="";
	}
}

function chargeville2(str,strpays)
{

	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	pays=document.getElementById('f_livpays');
	document.getElementById("attente2").innerHTML="<img src='/images/loader.gif'>";
	var url="/ajax/chargeville.php";
	url=url+"?cp="+str;
	url=url+"&pays="+pays.value;
	url=url+"&tc=liv" ; 
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChanged2;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function stateChanged2()
{
	if (xmlhttp.readyState==4)
	{
	document.getElementById("txtHint2").innerHTML=xmlhttp.responseText;
	document.getElementById("attente2").innerHTML="";
	}
}



function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if (window.ActiveXObject)
	{
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}


function modifiesaisieville(data,champ)
{
	sep=data.indexOf("|",0);				
	codepostal=data.substring(0,sep);		
	document.getElementById(champ).value=codepostal;
	
	
	
	
	
}

function validerformulaire_transport()
{
	
	//alert(document.getElementById('f_enlville').value);
	err=true;
	
	return err;
}



function chargecontact(data)
{
	alert(data);
}
function recopie1()
{
	document.monform.f_nom_expediteur.value=document.monform.f_nom_client.value;
	document.monform.f_enleve_adresse1.value=document.monform.f_adr1_client.value;
	document.monform.f_enleve_adresse2.value=document.monform.f_adr2_client.value;
	document.monform.f_enlcp.value=document.monform.f_cp_client.value;
	document.monform.f_enlville.value=document.monform.f_cp_client.value +"-" +document.monform.f_ville_client.value ;
	document.getElementById("txtHint1").innerHTML="<div class='resultat_unique'>"+ document.monform.f_ville_client.value+"</div><input type='hidden' name='f_enlville' value='"+document.monform.f_ville_client.value +"' />" ;
}
function recopie2()
{
	document.monform.f_nom_destinataire.value=document.monform.f_nom_client.value;
	document.monform.f_livraison_adresse1.value=document.monform.f_adr1_client.value;
	document.monform.f_livraison_adresse2.value=document.monform.f_adr2_client.value;
	document.monform.f_livcp.value=document.monform.f_cp_client.value;
	document.monform.f_livville.value=document.monform.f_cp_client.value +"-" +document.monform.f_ville_client.value ;
	document.getElementById("txtHint2").innerHTML="<div class='resultat_unique'>"+ document.monform.f_ville_client.value+"</div><input type='hidden' name='f_livville' value='"+document.monform.f_ville_client.value +"' />" ;
}
