//v1.0
//Copyright 2006 YZEO. Tous droits réservés.

/* ************************* PopupImage ************************* */

//PopupImage v1.0
/*
function PopupImage(img) {
	titre="Image taille reelle";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+40); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}
*/

//PopupImage v1.1 (ajout du clic sur image pour fermer le popup)
function PopupImage(img) {
	var largeur=((screen.width)-800)/2;
	var hauteur=((screen.height)-600)/2;
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes,status=no, top='+hauteur+', left='+largeur);	
	w.document.write("<HTML><HEAD><TITLE>Image taille reelle</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+15,document.images[0].height+40); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><a href='javascript:window.close()'><IMG src='"+img+"' border=0></a>");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

//PopupImageR (resizable pour les images trop grandes)
function PopupImageR(img) {
	w=open("",'image','width=400,height400,toolbar=no,scrollbars=yes,resizable=yes');	
	w.document.write("<HTML><HEAD><TITLE>Image taille reelle</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) { if (document.images[0].width >=760) { window.resizeTo(830,600); window.focus; } else {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} } else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0 bgcolor='#990000'><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

/* ************************* - Fin PopupImage - ************************* */

/* ************************* Popup  ************************* */

function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

// option peut etre "menubar=no,scrollbars=no,statusbar=no"
// appel : javascript:PopupCentrer('nompage.htm',520,220,'menubar=no,scrollbars=no,statusbar=no')


/* ************************* Bloquer clic droit ************************* */
/*
var message = "Vous n'etes pas autorisé a utiliser le bouton droit de la souris.";
var ns4 = (document.layers)? true:false;   					//NS 4 
var ie4 = (document.all)? true:false;   						//IE 4 
var dom = (document.getElementById)? true:false;		//DOM

if (dom)
	{
  if (document.addEventListener)
  	document.addEventListener("mouseup",RightMouseDisable,false);
  else
  	document.oncontextmenu = IsForbidden;
  }
else if (ie4)
	{
  document.onkeydown = CheckKey;
  document.onmousedown = RightMouseDisable;
  }
else if (ns4)
	{
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown = RightMouseDisable;
  }

function CheckKey()
	{
  var MyKey = event.keyCode;
	if (MyKey==93)
  	{
    var MyValue = IsForbidden;
    return false;
    }
	}
  
function RightMouseDisable(e)
	{
	var MyNumber=0;
	if (ie4)
		MyNumber = event.button;
  else
    MyNumber = e.which;
	if (MyNumber==2||MyNumber==3)
  	{
		var MyValue = IsForbidden();
    return false;
  	}
  else
  	return true; 
  }

function IsForbidden()
	{
  alert(message);
  return false;
	}
*/

/* ************************* - Fin Bloquer clic droit - ************************* */
