//function to get random number upto m

function randomXToY(minVal,maxVal,floatVal)
{
  
	var randVal = minVal+(Math.random()*(maxVal-minVal));
  
	return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);

}

function newimg(){

var listepop_corpo = new Array("corpo1.jpg","corpo2.jpg","corpo3.jpg","corpo4.jpg","corpo5.jpg");
var listepop_corpoWidth = new Array(509,377,393,318,402);var listepop_corpoHeight = new Array(310,345,477,385,308);

var listepop_ebout = new Array("eboutique1.jpg","eboutique2.jpg","eboutique3.jpg","eboutique4.jpg");
var listepop_eboutWidth = new Array(567,474,329,326);var listepop_eboutHeight = new Array(372,265,297,365);
var numImgCorpo = Math.floor(Math.random()*(listepop_corpo.length-1)); 
var widthImgCorpo = listepop_corpoWidth[numImgCorpo]; var heightImgCorpo = listepop_corpoHeight[numImgCorpo]; 
var topImgCorpo = randomXToY(0,80);var leftImgCorpo = randomXToY(0,50);
var numImgEbout = Math.floor(Math.random()*(listepop_ebout.length-1)); 
var widthImgEbouti = listepop_eboutWidth[numImgEbout]; var heightImgEbouti = listepop_eboutHeight[numImgEbout]; var topImgEbout = randomXToY(70,300);
var leftImgEbout = randomXToY(400,440);
var hasarimgCorpo = listepop_corpo[numImgCorpo];  var imgCorpo = document.getElementById("img_pop_corpo");
imgCorpo.src="images/dispatch/"+hasarimgCorpo;
var divCorpo = document.getElementById("pop_corporate");divCorpo.style.width=widthImgCorpo+ "px";divCorpo.style.height=heightImgCorpo+ "px";
divCorpo.style.top=topImgCorpo + "px";
divCorpo.style.left=leftImgCorpo + "px" ;


var hasarimgEbouti = listepop_ebout[numImgEbout];var imgEbouti = document.getElementById("img_pop_eboutique");  
imgEbouti.src="images/dispatch/"+hasarimgEbouti;var divEBouti = document.getElementById("pop_eboutique");divEBouti.style.width=widthImgEbouti+ "px";divEBouti.style.height=heightImgEbouti + "px";divEBouti.style.top=topImgEbout + "px";divEBouti.style.left=leftImgEbout + "px";}
function align(){	var lmt = document.getElementById('centrage');	var container = document.documentElement;	if(lmt && container)	{	    var containerHeight;	    if (container.innerWidth)	    {            containerHeight = container.innerHeight;		}		else		{            containerHeight = container.clientHeight;		}	    var lmtHeight;	    if (lmt.innerWidth)	    {            lmtHeight = lmt.innerHeight;		}		else		{            lmtHeight = lmt.offsetHeight;		}		var y = Math.ceil((containerHeight - lmtHeight) / 2);		if(y < 0)		{			y = 0;		}		lmt.style.position = "relative";		lmt.style.top = y + "px";	}	if (document.getElementById)	{		document.body.style.visibility = 'visible';	}}function addevent(obj,evt,fn,capt){	if(obj.addEventListener)	{		obj.addEventListener(evt, fn, capt);		return true;	}	else if(obj.attachEvent)	{		obj.attachEvent('on'+evt, fn);		return true;	}	else return false;}if (document.getElementById && document.getElementsByTagName){	addevent(window, 'load', align, false);	addevent(window, 'resize', align, false);}


