//---------------------------------------------------------------------------------------------------------------------------------------
// utilité générale
//---------------------------------------------------------------------------------------------------------------------------------------

	pop=false;
	
	function zoom(i) {
	
		if (i.indexOf("blank.jpg")==-1) {
		
			if (pop) pop.close();
			
			pop=window.open("http://www.ma-immobilier.com/detail.php?"+i,"","top=50, left=50, width=400, height=400, resizable=yes");
		}
	
	}

//---------------------------------------------------------------------------------------------------------------------------------------
// menu gauche
//---------------------------------------------------------------------------------------------------------------------------------------

	smenugsrc=false;

	function MenugItem(code,lib,parent,url,smen) {
			this.code=code;
			this.lib=lib;
			this.url=url;
			this.parent=parent;
			this.smen=smen;
	}


	menugitems=new Array(10);

	menugitems[0]=new MenugItem(0,"Accueil","","http://www.ma-immobilier.com/ma-immobilier-achat-vente-appartement-villa-marseille.html",0);
	menugitems[1]=new MenugItem(1,"Vendre","","javascript:;",0);
	menugitems[2]=new MenugItem(2,"Acheter","","javascript:;",2);
	menugitems[3]=new MenugItem(3,"Louer","","javascript:;",2);
	menugitems[4]=new MenugItem(4,"Nous contacter","","http://www.ma-immobilier.com/contact.php",0);

	menugitems[5]=new MenugItem(5,"Appartements",2,"http://www.ma-immobilier.com/acheter-appartement-marseille.html ",0);
	menugitems[6]=new MenugItem(6,"Maisons et villas",2,"http://www.ma-immobilier.com/acheter-villa-maison-marseille-bouches-du-rhone.html",0);
	menugitems[7]=new MenugItem(7,"Viager",2,"http://www.ma-immobilier.com/viager-marseille-bouches-du-rhone.html",0);

	menugitems[8]=new MenugItem(8,"Appartements",3,"http://www.ma-immobilier.com/location-appartement-marseille.html",0);
	menugitems[9]=new MenugItem(9,"Maisons et villas",3,"http://www.ma-immobilier.com/location-maison-villa-marseille-bouches-du-rhone.html",0);
	//menugitems[10]=new MenugItem(10,"Bureaux",3,"http://www.ma-immobilier.com/liste.php?typg=2&typb=3",0);


	function rollsg(e) {

		o=(e.srcElement)?e.srcElement.parentElement:e.target.parentNode;

		if (e.type.indexOf("over")!=-1)
			o.style.backgroundColor="#48BBFF";

		if (e.type.indexOf("out")!=-1)
			o.style.backgroundColor="#006AAA";

	}



	function hSousmenug() {
		document.getElementById("Smenug").style.visibility="hidden";
		document.getElementById("Smenug").innerHTML="";

		if (smenugsrc) {
			if (smenugsrc.parentElement)
				smenugsrc.parentElement.style.backgroundImage="url(images/design/bgmenugout.gif)";
			else
				smenugsrc.parentNode.style.backgroundImage="url(images/design/bgmenugout.gif)";
			
			smenugsrc=false;
		}
	}


	function wSousmenug(e,n) {

		X=(document.body.offsetWidth-document.getElementById("Page").offsetWidth)/2;
		
		Y=document.getElementById("Page").offsetTop;

		var isMac = navigator.userAgent.indexOf("Mac") != -1


		// recherche des sous-items

		content="<TABLE class='smenug' cellpadding='0' cellspacing='0' border='1'>";

		first=0;
		
		for (i=0; i<menugitems.length; i++) {
			if (menugitems[i].parent==n) {
				content+="<TR>";
				if (first==0) {
					content+="<TD class='smenugcsup'>&nbsp;&nbsp;&nbsp;</TD>";
					content+="<TD class='smenugit' nowrap style='border-width:1 1 1 1'>";					
					first=1;
				}
				else {
					content+="<TD></TD>";				
					content+="<TD class='smenugit' nowrap>";
				}	
				content+="<A class='liensmenug' onmouseover='rollsg(event)' onmouseout='rollsg(event)' href='"+menugitems[i].url+"'>";
				content+=menugitems[i].lib;
				content+="</A>";
				content+="</TD>";
				content+="</TR>";
			}
		}

		content+="</TABLE>";

		if (e.srcElement) {

			x=X+
				e.srcElement.parentElement.offsetWidth+
				e.srcElement.parentElement.offsetLeft+
				e.srcElement.parentElement.parentElement.offsetLeft;

			y=Y+
				e.srcElement.parentElement.offsetHeight/2+
				e.srcElement.parentElement.parentElement.offsetTop+
				e.srcElement.parentElement.parentElement.parentElement.parentElement.offsetTop;


			smenugsrc=e.srcElement;

		}
		else {	
			X=-10+(document.body.offsetWidth-800)/2;
		
			x=X+
				e.target.parentNode.offsetWidth+
				e.target.parentNode.offsetLeft+
				e.target.parentNode.parentNode.offsetLeft;

			y=Y+
				e.target.parentNode.offsetHeight/2+
				e.target.parentNode.parentNode.offsetTop+
				e.target.parentNode.parentNode.parentNode.parentNode.offsetTop;

			smenugsrc=e.target;
			
			//alert(" Page "+document.getElementById("Page").offsetWidth);
			
		}
		
		if (document.getElementById("Ttrhaut"))
			y+=document.getElementById("Ttrhaut").offsetHeight;

		
		document.getElementById("Smenug").innerHTML=content;
		document.getElementById("Smenug").style.left=x;
		document.getElementById("Smenug").style.top=y;
		document.getElementById("Smenug").style.visibility="visible";


		setTimeout("hSousmenug()",12000);

	}


	function rollg(e,n) {
		o=(e.srcElement)?e.srcElement.parentElement:e.target.parentNode;

		if (e.type.indexOf("over")!=-1) {

			hSousmenug();

			// o.style.backgroundColor="#48BBFF";

			o.style.backgroundImage="url(http://www.ma-immobilier.com/images/design/bgmenugover.gif)";

			if (menugitems[n].smen!=0) {
				wSousmenug(e,n);
			}
		}


		if (e.type.indexOf("out")!=-1)
			if (menugitems[n].smen==0) {
				// o.style.backgroundColor="#0066AA";
				o.style.backgroundImage="url(http://www.ma-immobilier.com/images/design/bgmenugout.gif)";

			}	

	}
