function cd_position(p){
	position_x = (navigator.appName.indexOf("Netscape")!=-1 )? p.pageX : event.clientX+document.documentElement.scrollLeft;
	position_y = (navigator.appName.indexOf("Netscape")!=-1) ? p.pageY : document.documentElement.scrollTop+event.clientY;
}

function cd_Om()
{
  var menu = document.getElementById("menuClicDroit");
    menu.style.position = 'absolute';
    menu.style.left = position_x+"px";
    menu.style.top = position_y+"px";
	  menu.style.visibility = "visible";
  //console.log(menu.innerLeft);
	return(false);
}

function cd_Fm()
{
	document.getElementById("menuClicDroit").style.visibility = "hidden";
}

function cd_addFav()
{
	if (document.all){
		window.external.AddFavorite(location.href, document.title);
	}else{
		alert("");
	}
}

function cd_recommander(){
	window.open("recommander.php","recommander","width=800,height=600,scrollbars=yes,status=no,resizable=yes");
}

function cd_Om2(btn)
{
	if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2)
	{
		cd_Om();
		return false;
	}
	else if ( (navigator.appName.indexOf("Netscape")!=-1 ) && btn.which == 3)
	{
		cd_Om();
		return false;
	}
}

//if(navigator.appName.indexOf("Netscape")!= -1) document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = cd_position;
document.onmousedown = cd_Om2;
document.oncontextmenu = cd_Om;
document.onclick = cd_Fm;
var num=0, num2=0, num3=0, num4=0, num5=0, num6=0, num7=0, num8=0, num9=0, num10=0, num11=0, num12=0, bim=0;
function changer() {
switch(nbim){
case 1 :
if (num == 0) {
num = 1;
document.image.src = "coffre_fort/coffre_fort1.jpg";// grande image
document.image.width = 587;
document.image.height = 242;
}
else {
num = 0;
document.image.src = "coffre_fort/coffre_fort1.jpg";// petite image
document.image.width = 150;
document.image.height = 62;
}
break;
case 2 :
if (num2 == 0) {
num2 = 1;
document.image2.src = "coffre_fort/coffre_fort2.jpg";// grande image
document.image2.width = 562;
document.image2.height = 238;
}
else {
num2 = 0;
document.image2.src = "coffre_fort/coffre_fort2.jpg";// petite image
document.image2.width = 150;
document.image2.height = 64;
}
break;
case 3 :
if (num3 == 0) {
num3 = 1;
document.image3.src = "coffre_fort/coffre_fort3.jpg";// grande image
document.image3.width = 593;
document.image3.height = 177;
}
else {
num3 = 0;
document.image3.src = "coffre_fort/coffre_fort3.jpg";// petite image
document.image3.width = 150;
document.image3.height = 45;
}
break;
case 4 :
if (num4 == 0) {
num4 = 1;
document.image4.src = "coffre_fort/coffre_fort4.jpg";// grande image
document.image4.width = 610;
document.image4.height = 313;
}
else {
num4 = 0;
document.image4.src = "coffre_fort/coffre_fort4.jpg";// petite image
document.image4.width = 150;
document.image4.height = 77;
}
break;
case 5 :
if (num5 == 0) {
num5 = 1;
document.image5.src = "coffre_fort/coffre_fort5.jpg";// grande image
document.image5.width = 620;
document.image5.height = 104;
}
else {
num5 = 0;
document.image5.src = "coffre_fort/coffre_fort5.jpg";// petite image
document.image5.width = 150;
document.image5.height = 25;
}
break;
case 6 :
if (num6 == 0) {
num6 = 1;
document.image6.src = "images/rang1.jpg";// grande image
document.image6.width = 372;
document.image6.height = 302;
}
else {
num6 = 0;
document.image6.src = "images/rang1.jpg";// petite image
document.image6.width = 100;
document.image6.height = 81;
}
break;
case 7:
if (num7== 0) {
num7= 1;
document.image7.src = "lampe_magique/lampe_magique1_a.jpg";// grande image
document.image7.width = 609;
document.image7.height = 393;
}
else {
num7= 0;
document.image7.src = "lampe_magique/lampe_magique1_a.jpg";// petite image
document.image7.width = 150;
document.image7.height = 97;
}
break;
case 8:
if (num8== 0) {
num8= 1;
document.image8.src = "lampe_magique/lampe_magique2_a.jpg";// grande image
document.image8.width = 611;
document.image8.height = 445;
}
else {
num8= 0;
document.image8.src = "lampe_magique/lampe_magique2_a.jpg";// petite image
document.image8.width = 150;
document.image8.height = 109;
}
break;
case 9:
if (num9== 0) {
num9= 1;
document.image9.src = "lampe_magique/lampe_magique3_a.jpg";// grande image
document.image9.width = 609;
document.image9.height = 493;
}
else {
num9= 0;
document.image9.src = "lampe_magique/lampe_magique3_a.jpg";// petite image
document.image9.width = 150;
document.image9.height = 121;
}
break;
case 10:
if (num10== 0) {
num10= 1;
document.image10.src = "images/le_rectangle.jpg";// grande image
document.image10.width = 400;
document.image10.height = 331;
}
else {
num10= 0;
document.image10.src = "images/le_rectangle.jpg";// petite image
document.image10.width = 100;
document.image10.height = 83;
}
break;
case 11:
if (num11== 0) {
num11= 1;
document.image11.src = "images/200pz1.jpg";// grande image
document.image11.width = 400;
document.image11.height = 470;
}
else {
num11= 0;
document.image11.src = "images/200pz1.jpg";// petite image
document.image11.width = 100;
document.image11.height = 118;
}
break;
case 12:
if (num12== 0) {
num12= 1;
document.image12.src = "images/1000pz1.jpg";// grande image
document.image12.width = 400;
document.image12.height = 460;
}
else {
num12= 0;
document.image12.src = "images/1000pz1.jpg";// petite image
document.image12.width = 100;
document.image12.height = 115;
}
break;
}
}
