/*
Différents outils pour cadres et fenêtres
*/

function chargeUrl(framea,urla,frameb,urlb){
 if (framea!="" && urla!="") {top.frames[framea].location.href=urla}
 if (frameb!="" && urlb!="") {top.frames[frameb].location.href=urlb}
}

function openWindowFixe(file,largeur,hauteur)
{
  var posx=(screen.width-largeur)/2;
  var posy=(screen.height-50-hauteur)/2;
  myWindow=window.open(file, "newWindow", "top="+posy+",left="+posx+",width="+largeur+",height="+hauteur+",menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,status=no");
}

function openWindowVariable(file,largeur,hauteur)
{
  var posx=(screen.width-largeur)/2;
  var posy=(screen.height-hauteur)/2;
  myWindow=window.open(file, "newWindow", "top="+posy+",left="+posx+",width="+largeur+",height="+hauteur+",menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,status=no");
}

function CloseWindow()
{
  window.close()
}

function MaximizeWindowLow()
{
  var posx=(screen.width-1024)/2;
  var posy=(screen.height-768)/2;
  self.moveTo(posx,posy);
  self.resizeTo(width=1024,height=768);
  self.moveTo(posx,posy);
}

function MaximizeWindowNormal()
{
  var posx=(screen.width-1280)/2;
  var posy=(screen.height-1024)/2;
  self.moveTo(posx,posy);
  self.resizeTo(width=1280,height=1024);
  self.moveTo(posx,posy);
}

function MaximizeWindowHigh()
{
  self.moveTo(0,0);
  self.resizeTo(screen.availWidth,screen.availHeight);
  self.moveTo(0,0);
}

function AfficherSWF(titre,color,path_swf,w,h)
{
win360=window.open(titre,'virt','width='+w+',height='+h+',left='+(Math.round((screen.width-w)/2))+',top='+(Math.round((screen.height-h)/2)-50)+ ',menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,status=no');
win360.document.open();
win360.document.write('<html><head><title>'+titre+'</title></head><body bgcolor="'+color+'" marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>');
win360.document.write('<STYLE TYPE="text/css"><!-- #cache { position:absolute; top:'+(Math.round(h/2)-50)+'; z-index:10; visibility:hidden; } --></STYLE><DIV ID="cache"><TABLE WIDTH=500 BGCOLOR=#FFFFFF BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><TABLE WIDTH=500 BGCOLOR=#0000FF BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><FONT FACE="Verdana" SIZE=3 COLOR=#FFFFFF><BR>Veuillez patienter pendant le chargement de la page...<BR><BR></FONT></TD></TR></TABLE></TD></TR></TABLE></DIV><SCRIPT LANGUAGE="JavaScript"> var nava = (document.layers); var dom = (document.getElementById); var iex = (document.all); if (nava) { cach = document.cache } else if (dom) { cach = document.getElementById("cache").style } else if (iex) { cach = cache.style } largeur = screen.width; cach.left = Math.round((largeur/2)-550); cach.visibility = "visible"; function cacheOff() { cach.visibility = "hidden"; } window.onload = cacheOff</SCRIPT>');
win360.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'"><param name="movie" value="'+path_swf+'"><param name="BGColor" value="'+color+'"><param name="quality" value="high"><embed src="'+path_swf+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed></object>');
win360.document.write('</body></html>');
win360.document.close();
}	

function AfficherIMG(titre,color,path_img,w,h)
{
win360=window.open(titre,'virt','width='+w+',height='+h+',left='+(Math.round((screen.width-w)/2))+',top='+(Math.round((screen.height-h)/2)-50)+ ',menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,status=no');
win360.document.open();
win360.document.write('<html><head><title>'+titre+'</title></head><body bgcolor="'+color+'" marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>');
win360.document.write('<STYLE TYPE="text/css"><!-- #cache { position:absolute; top:'+(Math.round(h/2)-50)+'; z-index:10; visibility:hidden; } --></STYLE><DIV ID="cache"><TABLE WIDTH=500 BGCOLOR=#FFFFFF BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><TABLE WIDTH=500 BGCOLOR=#0000FF BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><FONT FACE="Verdana" SIZE=3 COLOR=#FFFFFF><BR>Veuillez patienter pendant le chargement de la page...<BR><BR></FONT></TD></TR></TABLE></TD></TR></TABLE></DIV><SCRIPT LANGUAGE="JavaScript"> var nava = (document.layers); var dom = (document.getElementById); var iex = (document.all); if (nava) { cach = document.cache } else if (dom) { cach = document.getElementById("cache").style } else if (iex) { cach = cache.style } largeur = screen.width; cach.left = Math.round((largeur/2)-550); cach.visibility = "visible"; function cacheOff() { cach.visibility = "hidden"; } window.onload = cacheOff</SCRIPT>');
win360.document.write('<a href="javascript:window.close()"><img border="0" src="'+path_img+'" width="'+w+'" height="'+h+'" title="Fermer cette fenêtre..."></a>');
win360.document.write('</body></html>');
win360.document.close();
}	

