function goville(id){
	var path = new String();
		path = 'include/getville.php?ville='+id;
		path += '&action=send&rand='+Math.random();
		http.open('get', path );
		http.onreadystatechange = handleResponse;
		http.send(null);
}


function getHTTPObject() {
    if (typeof XMLHttpRequest != 'undefined') {
        return new XMLHttpRequest();
    }
    try {
        return new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            return new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
    }
    return false;
}

var http = getHTTPObject();

function searchby(txt){
	//
	if(txt!="Recherche par")
	{
		var path = new String();
		path = 'include/getsearch.php?searchby='+txt;
		path += '&action=send&rand='+Math.random();
		//
		http.open('get', path );
		http.onreadystatechange = handleResponse;
		http.send(null);
	}
}

function search1(txt, by){
	var path = new String();
	//alert('include/getsearch.php?search1='+by+'&'+by+'='+txt);
	path = 'include/getsearch.php?search1='+by+'&'+by+'='+txt;
	path += '&action=send&rand='+Math.random();
	http.open('get', path );
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function search2(by1, txt1, by2, txt2){
	var path = new String();
	//alert('include/getsearch.php?search2=1 &'+by1+'='+txt1+'&'+by2+'='+txt2);
	path = 'include/getsearch.php?search2=1 &'+by1+'='+txt1+'&'+by2+'='+txt2;
	path += '&action=send&rand='+Math.random();
	http.open('get', path );
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function search3(by1, txt1, by2, txt2, by3, txt3){
	var path = new String();
	//alert('include/getsearch.php?search3=1 &'+by1+'='+txt1+'&'+by2+'='+txt2+'&'+by3+'='+txt3);
	path = 'include/getsearch.php?search3=1 &'+by1+'='+txt1+'&'+by2+'='+txt2+'&'+by3+'='+txt3;
	path += '&action=send&rand='+Math.random();
	http.open('get', path );
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function finalsearch(by, txt){
	var path = new String();
	if(txt=='hotel')
	{
	}
	else
	{
	path = 'include/getsearch.php?finalsearch='+by+'&arg='+txt;
	path += '&action=send&rand='+Math.random();
	http.open('get', path );
	http.onreadystatechange = handleResponse;
	http.send(null);
	}
}

function handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        var update = new Array();
		
        if(response.indexOf('|' != -1)) {
		//alert(response);
        update = response.split('|');
	document.getElementById(update[0]).innerHTML = update[1];
	document.getElementById(update[2]).innerHTML = update[3];
	document.getElementById(update[4]).innerHTML = update[5];
	document.getElementById(update[6]).innerHTML = update[7];
	document.getElementById(update[8]).innerHTML = update[9];
        }
    }	
}

//button roll over
if (document.images) {
    newsearchup       = new Image();
    newsearchup.src   = "img/newsearchbtnout.jpg" ;
    newsearchdown     = new Image() ;
    newsearchdown.src = "img/newsearchbtnover.jpg" ;
}

if (document.images) {
    searchbtnup       = new Image();
    searchbtnup.src   = "img/searchbtnout.jpg" ;
    searchbtndown     = new Image() ;
    searchbtndown.src = "img/searchbtnover.jpg" ;
}

if (document.images) {
    btn1up       = new Image();
    btn1up.src   = "img/btn1out.jpg" ;
    btn1down     = new Image() ;
    btn1down.src = "img/btn1over.jpg" ;
}

if (document.images) {
    btn2up       = new Image();
    btn2up.src   = "img/btn2out.jpg" ;
    btn2down     = new Image() ;
    btn2down.src = "img/btn2over.jpg" ;
}


if (document.images) {
    btn3up       = new Image();
    btn3up.src   = "img/btn3out.jpg" ;
    btn3down     = new Image() ;
    btn3down.src = "img/btn3over.jpg" ;
}


if (document.images) {
    btn4up       = new Image();
    btn4up.src   = "img/btn4out.jpg" ;
    btn4down     = new Image() ;
    btn4down.src = "img/btn4over.jpg" ;
}


if (document.images) {
    btn5up       = new Image();
    btn5up.src   = "img/btn5out.jpg" ;
    btn5down     = new Image() ;
    btn5down.src = "img/btn5over.jpg" ;
}


if (document.images) {
    fermerbtnup       = new Image();
    fermerbtnup.src   = "img/fermerbtnout.jpg" ;
    fermerbtndown     = new Image() ;
    fermerbtndown.src = "img/fermerbtnover.jpg" ;
}

if (document.images) {
    quisommenousbtnup       = new Image();
    quisommenousbtnup.src   = "img/quisommenousbtnout.jpg" ;
    quisommenousbtndown     = new Image() ;
    quisommenousbtndown.src = "img/quisommenousbtnover.jpg" ;
}
if (document.images) {
    selectionbtnup       = new Image();
    selectionbtnup.src   = "img/selectionbtnout.jpg" ;
    selectionbtndown     = new Image() ;
    selectionbtndown.src = "img/selectionbtnover.jpg" ;
}
if (document.images) {
    servicesbtnup       = new Image();
    servicesbtnup.src   = "img/servicesbtnout.jpg" ;
    servicesbtndown     = new Image() ;
    servicesbtndown.src = "img/servicesbtnover.jpg" ;
}

if (document.images) {
    contactezbtnup       = new Image();
    contactezbtnup.src   = "img/contactezbtnout.jpg" ;
    contactezbtndown     = new Image() ;
    contactezbtndown.src = "img/contactezbtnover.jpg" ;
}
if (document.images) {
    backbtnup       = new Image();
    backbtnup.src   = "img/backbtnout.jpg" ;
    backbtndown     = new Image() ;
    backbtndown.src = "img/backbtnover.jpg" ;
}

function buttondown( buttonname )
{
    if (document.images) {
      document[ buttonname ].src = eval( buttonname + "down.src" );
    }
}
function buttonup ( buttonname )
{
    if (document.images) {
      document[ buttonname ].src = eval( buttonname + "up.src" );
    }
}
