// JavaScript Document
$(document).ready(function(){
	$(".petit").click(function(){
							   
		thesrc=$(this).attr("src")
		iddef=("#def"+$(this).attr("id").substr(3))
		descr=$(iddef).html()
		fileName="upload/"+thesrc.substr(thesrc.lastIndexOf("/")+1)
							   
		$("#grande").attr("src",fileName)
		$("#descgrande").html(descr)
		});

	$('img[@src$=.png]').pngfix(); 
	$('#logo').pngfix(); 
	$('#text').pngfix(); 
	$('#textG').pngfix();

	$('.form').pngfix(); 
	$('.tarifs').pngfix(); 
	$('.colonne_droite').pngfix();  
	

});

 function getElementsByClass(maClass) {
       var tabRetour = new Array();
      var tabTmp = new Array();
      tabTmp = document.getElementsByTagName("*");
      j=0;
       for (i=0; i<tabTmp.length; i++) {
           if (tabTmp[i].className==maClass) {
             tabRetour[j]=tabTmp[i];
         j++;
           }
       }
       return tabRetour;
    }
	




function lay(obj){
	liste=getElementsByClass("cach");
	 
	for(i in liste){
		liste[i].style.visibility="hidden";
		
	}
	
	
	if(obj==0)return;
	reference = document.getElementById(obj)	
	cible = document.getElementById(obj.toString())	
	if(cible==undefined)return;
	
	
	
	
	
	cible.style.visibility="visible";
	cible.style.top=yMousePos+30+"px";
	cible.style.left="60%";
	cible.style.zIndex="10";
	
	
}

function nav(obj){
	liste=getElementsByClass("sousmenu");
	 
	for(i in liste){
		liste[i].style.visibility="hidden";
		
	}
	
	
	if(obj==0)return;
	reference = document.getElementById(obj)	
	cible = document.getElementById("s"+obj.toString())	
	if(cible==undefined)return;
	cible.style.visibility="visible";
	
	
}


/*

if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}

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

function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else 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;
    }
}*/