function GetWindowWidth() {
	  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
return myWidth;
}


function GetWindowHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
return myHeight;
}


function InitWindow() {
  	var minHeight = 420; //hauteur minimum à afficher pour le contenu
	var minWidth = 952; //768
	var headerH = 150+24;//avec footer_c
	var wndHeight=GetWindowHeight();
	var wndWidth=GetWindowWidth();
	if(wndHeight != 0 && wndHeight>(minHeight + headerH) )
		if (document.getElementById) {
			var contenu = document.getElementById("contenu");
			contenu.style.overflow = "auto";
			contenu.style.height = (wndHeight - headerH) + "px";
			
			var photos = document.getElementById("bande_photos");
			photos.style.height = (wndHeight-10) +'px';
			photos.style.overflow = "hidden";
		}
		
	var divbase = document.getElementById("base");
	var creator = document.getElementById("creator");
	creator.style.position = "absolute";
	creator.style.left = "-2000px";
	if(wndWidth != 0 && wndWidth<minWidth ){
		if (document.getElementById) {
			divbase.style.width = (minWidth) +'px';
		}
	}else{
		if (document.getElementById) {
			divbase.style.width = '100%';
		}
	}
}


function chImg(docroot, idBiens, imgName, w, h){
		var img = docroot + 'images/bien'+idBiens+'/m_zoom/' + imgName;
		PopupPic(img, w, h);
	}

function PopupPic(img, w, h) {
	var left = ((screen.width-200)/2)
	var height = ((screen.height-200)/2)
	var wndH = (h+20).toString();
	var wndW = (w+20).toString();
	titre="Zoom";
	fenetre=open("",'Photo','width='+wndW+',height='+wndH+',top=" + height.toString() + ",left=" + left.toString() + ",toolbar=no,scrollbars=yes,resizable=no');
	fenetre.document.write("<html><head><title>"+titre+"</title></head>");
	fenetre.document.write("<body leftMargin='0' topMargin='0' marginwidth='0' marginheight='0'>");
	fenetre.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>");
	fenetre.document.write("<td valign='middle' align='center'><a href='javascript:self.close();'><img src='"+img+"' border=\"0\"></a>");
	fenetre.document.write("</td></tr></table>");
	fenetre.document.write("</body></html>");
	fenetre.document.close();
}

function mesure(_page)
{
scr_w = screen.width;
scr_h = screen.height;
color = screen.colorDepth;
ref = escape(window.document.referrer);

document.write("<IMG src='http://www.direct-stats.com/cgi-bin/pro/stats/i2g/marqueur.pl/"+ "?page="+ _page+ "&n="+ Math.round (Math.random () * 1000000000000000)+ "&reso_w="+ scr_w+ "&reso_h="+ scr_h+ "&color="+ color+ "&referer="+ ref+"' border=0>");
}