// Fonctions pour admin

function modalDialogShow_IE(url,width,height) //IE
{
	return window.showModalDialog(url,window,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;edge:Raised;center:Yes;help:No;Resizable:Yes;Maximize:Yes");
}

function modalDialogShow_Moz(url,width,height) //Moz
{
	var left = screen.availWidth/2 - width/2;
	var top = screen.availHeight/2 - height/2;
	activeModalWin = window.open(url, "", "width="+width+"px,height="+height+",left="+left+",top="+top);
	window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
}

var sActiveAssetInput;

function setAssetValue(v) //required by the asset manager
{
	document.getElementById(sActiveAssetInput).value = v;
}

function openAsset(s)
{
	sActiveAssetInput = s
	if(navigator.appName.indexOf('Microsoft')!=-1)
		document.getElementById(sActiveAssetInput).value=modalDialogShow_IE("../scripts/assetmanager/assetmanager.php",700,500); //IE
	else
		modalDialogShow_Moz("../scripts/assetmanager/assetmanager.php",700,500); //Moz
}


// Fonctions pour le site

function popup_centree(url,largeur,hauteur) {
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	w=open("","","top="+top+",left="+left+",width="+largeur+",height="+hauteur+",scrollbars=0,menubar=1,directories=0,status=0,resizable=0");
	w.document.write("<html>\n<head>\n<title>Zoom</title>\n</head>\n");
	w.document.write("<body leftMargin='0' topMargin='0' marginwidth='0' marginheight='0'>\n");
	w.document.write("<a href='javascript:window.close();' title='Close'><img src='"+url+"' border='0' alt='Image'></a>\n");
	w.document.write("</body>\n</html>");
	w.document.close();
}
