

function getMousePosition(event)
{
    var e = event || window.event;
    var scroll = new Array((document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft,(document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop);;
    return new Array(e.clientX + scroll[0] - document.body.clientLeft,e.clientY + scroll[1] - document.body.clientTop);
}


/**
 *
 * @access public
 * @return void
 **/
function mouseOn(departement,event){
	$('map_'+departement+"_area").style.cursor = "pointer";
	changeImage(departement,true);
	displayBulle(event,departement);
}

function mouseOut(departement,event){
	changeImage(departement,false);
	hideBulle();
}


/**
 *
 * @access public
 * @return void
 **/
function clicka(){
        $('questionnaire1').style.display="none";
        $('questionnaire2').style.display="block";
}


/**
 *
 * @access public
 * @return void
 **/
function changeImage(departement,active){
if(active)
	$('map_'+departement).src = '../images/map/'+departement+'-R.png';
else
	$('map_'+departement).src = '../images/map/'+departement+'.png';
}

/**
 *
 * @access public
 * @return void
 **/
function displayBulle(event,numDepartement){
	position = getMousePosition(event);
	$('bulle').style.marginTop= (position[1]-306)+"px";
	$('bulle').style.marginLeft= (position[0]-404)+"px";
	$('bulle').innerHTML = "<span class='brownBoldText'>"+departement[numDepartement]['name']+"</span><br/><br/><span class='pinkText'>"+departement[numDepartement]['number']+" Boutique(s)</span>";
	$('bulle').style.display="block";
}


/**
 *
 * @access public
 * @return void
 **/
function hideBulle(){
	$('bulle').style.display="none";
}

/**
 *
 * @access public
 * @return void
 **/
function generateUrl(base,selectId){
    if($(selectId).options[$(selectId).selectedIndex].value != "00")
	return new Ajax.Updater('listBoutique', base+'/pays_id/1/departement/'+$(selectId).options[$(selectId).selectedIndex].value, {asynchronous:true, evalScripts:false});
}

/**
 *
 * @access public
 * @return void
 **/
function mouseOnPorteCle(){
        $('infoBulle').style.display="block";
}

function mouseOutPorteCle(){
	$('infoBulle').style.display="none";
}


