/*ssmenu*/
var cParent;
var cMenu;
function Pos(thisitem)
{
	if(typeof(thisitem) != 'object') {thisitem = document.getElementById(thisitem);}
	var ww = thisitem.offsetWidth, hh = thisitem.offsetHeight;
	for (var xx = 0,yy = 0; thisitem != null; xx += thisitem.offsetLeft,yy += thisitem.offsetTop,thisitem = thisitem.offsetParent);
	return {Left:xx, Top:yy, Right:xx + ww, Bottom:yy + hh}
}

function ShowMenu(currentParent, currentMenu)
{
	cMenu = currentMenu;
	
	currentMenu = document.getElementById(currentMenu);
	currentMenu.style.left = Pos(currentParent).Left + 'px';
	currentMenu.style.top = Pos(currentParent).Bottom - 20 + 'px';
	currentMenu.style.visibility = 'visible';

	cParent = currentParent;
}
		
function HoldMenu()
{
	ShowMenu(cParent, cMenu);
}
		
function HideMenu(hideMenu)
{
	hideMenu = document.getElementById(hideMenu);
	hideMenu.style.visibility = 'hidden';
}
/**/
function update(data) { 
	var xhr_object = null; 
	if(window.XMLHttpRequest) 
		xhr_object = new XMLHttpRequest();// Firefox 
	else if(window.ActiveXObject) 
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");// Internet Explorer 
	else 
	{ // XMLHttpRequest non supporté par le navigateur 
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		return; 
	} 
	xhr_object.open("POST", "ajax.php", true); 
	xhr_object.onreadystatechange = function() 
	{ 
		$('div_loading').style.display = 'block';
		if( xhr_object.readyState == 4 ) {
			$('div_loading').style.display = 'none';
			eval( xhr_object.responseText );
		}
	} 
	
	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
	xhr_object.send( data + '&myRand=' + (Math.random()*999999) );
}

function resizePopUp(monImage, monTitre) {
	w = window.open('','chargement','width=10,height=10,top=100,left=100');
	w.document.write( "<html><head><title>"+  monTitre+"</title>\n" ); 
	w.document.write( "<script language='JavaScript'>\n"); 
	w.document.write( "IE5=NN4=NN6=false;\n"); 
	w.document.write( "if(document.all)IE5=true;\n"); 
	w.document.write( "else if(document.getElementById)NN6=true;\n"); 
	w.document.write( "else if(document.layers)NN4=true;\n"); 
	w.document.write( "function autoSize() {\n"); 
	w.document.write( "if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31)\n"); 
	w.document.write( "else if(NN6) self.sizeToContent();\n");
	w.document.write( "else window.resizeTo(document.images[0].width,document.images[0].height+20)\n"); 
	w.document.write( "self.focus();\n"); 
	w.document.write( "}\n</script>\n");
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
	w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='"+monTitre+"'></a>\n" ); 
	w.document.write( "<script language='JavaScript'>setTimeout('print()', 4000);</script>\n" );
	w.document.write( "</body></html>" );
	w.document.close(); 
}
function telecharger(id) {
	if( !id ) {
		chaine = document.images['med_zoom'].src;
		chaine.search(/([0-9]+)/);
		id = RegExp.$1;
	}
	window.location.href='./telecharger.php?id=' + id;
}
