function resizeDiv(div,width,height,hide,center) {
	c_width=document.getElementById(div).style.width;
	c_height=document.getElementById(div).style.height;
	//c_left=document.getElementById(div).style.left;
	//c_top=document.getElementById(div).style.top;

	difwidth=Math.round((width-parseInt(c_width))/2);
	difheight=Math.round((height-parseInt(c_height))/2);
	//difleft=Math.round((left-parseInt(c_left))/2);
	//diftop=Math.round((top-parseInt(c_top))/2);

	new_width = parseInt(c_width)+difwidth;
	new_height = parseInt(c_height)+difheight;
	//new_left = parseInt(c_left)+difleft;
	//new_top = parseInt(c_top)+diftop;

	document.getElementById(div).style.height=(new_height)+"px";
	document.getElementById(div).style.width=(new_width)+"px";
	//document.getElementById(div).style.left=(new_left)+"px";
	//document.getElementById(div).style.top=(new_top)+"px";
	if(center==true) {
		document.getElementById(div).style.marginLeft=-(new_width/2)+"px";
		document.getElementById(div).style.marginTop=-(new_height/2)+"px";
	}

	if(difwidth!=0 || difheight!=0) {
		timer = setTimeout('resizeDiv(\''+div+'\','+width+','+height+','+hide+','+center+')',50);
	} else {
		document.getElementById(div).style.height=(height)+"px";
		document.getElementById(div).style.width=(width)+"px";
		//document.getElementById(div).style.left=(left)+"px";
		//document.getElementById(div).style.top=(top)+"px";
		if(hide==true) {
			document.getElementById(div).style.visibility='hidden';
			document.getElementById(div).innerHTML = "";
		}
		window.clearTimeout(timer);
	}

	function moveDiv(div) {

	}
	function stopMovingDiv(div) {

	}
}


var clicEnCours = false;
var position_x = 0;
var position_y = 0;
var origineDiv_x = 0;
var iExplorer = false;
var deplacable = "";
if (document.all){
  iExplorer = true;
} 

function moveDiv(pDiv){
	chaineX = document.getElementById(pDiv).style.left;
	chaineY = document.getElementById(pDiv).style.top;
	origineDiv_x = x - chaineX.substr(0,chaineX.length-2);
	origineDiv_y = y - chaineY.substr(0,chaineY.length-2);
	clicEnCours = true;
	deplacable = pDiv;
	document.getElementById(deplacable).style.cursor = 'move';
	document.getElementById(deplacable).style.zIndex = 100;
	document.getElementById(deplacable).style.border = '1px #000000 dotted';
}



function stopMovingDiv(pDiv){
	clicEnCours = false;
	document.getElementById(deplacable).style.cursor = 'default';
	document.getElementById(deplacable).style.zIndex = 1;
	document.getElementById(deplacable).style.border = '1px #000000 solid';
	deplacable = "";
}



function deplacementSouris(e){
	x = (iExplorer) ? event.x + document.body.scrollLeft : e.pageX;
	y = (iExplorer) ? event.y + document.body.scrollTop :  e.pageY;
	if (clicEnCours && document.getElementById){
		position_x = x;
		position_y = y + (parseInt(document.getElementById(deplacable).style.height)/2) - 5;
		document.getElementById(deplacable).style.left = position_x;
		document.getElementById(deplacable).style.top = position_y;
	}
}



if(!iExplorer){
  document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = deplacementSouris;