// JavaScript Document

//Ouverture d'une PopUp en JavaScript pour afficher les images
function popupZoomImg(url){
	var puWidth = 952;
	var puHeight = 600;
	var x = (screen.width - puWidth) / 2;
	var y = (screen.height - puHeight) / 2;
	
	window.open(
		url,
		'Image', 
		'width='+ puWidth +', height='+ puHeight +', left='+ x +', top='+ y +', menubar=no, status=no, scrollbars=yes'
	);
}

function popupMiniSite(page,largeur,hauteur,options) {
  var op=(screen.height-hauteur)/2;
  var eft=(screen.width-largeur)/2;
  window.open(page,"","top="+op+",left="+eft+",width="+largeur+",height="+hauteur+",scrollbars=no ,"+options);
}

//Appel à une methode de l'application flex à la fermeture du navigateur
function onBeforeUnloadHandler(){
  WyethHemo.flexAppClose();
} 

//Ouverture d'une PopUp Pro en JavaScript
function popupPro(url){
	window.open(url, 'pro', '');
}

//Fermeture d'une PopUp Pro en JavaScript
function closePopupPro(){
  var pro = window.open('about:blank', 'pro', '');
  
  pro.close();
}

//Ouverture d'une PopUp en JavaScript pour afficher les images
function popupPrint(url){
	var puWidth = 660;
	var puHeight = 600;
	var x = (screen.width - puWidth) / 2;
	var y = (screen.height - puHeight) / 2;
	
	window.open(
		url,
		'Image', 
		'width='+ puWidth +', height='+ puHeight +', left='+ x +', top='+ y +', menubar=yes, status=no, scrollbars=yes'
	);
}

//Récupération de l'url en cours
function getFullUrl(){
  return window.location.href;
}

//Récupération d'infos via le JS
function getJSInfos(){
  var obj = new Object();

  //Referrer
  if(document.referrer)
    obj.Referer = document.referrer;
  
  //Navigateur  
  if(navigator.appName)
    obj.Navigateur = navigator.appName;
  
  //Url en cours complète
  if(window.location.href)
    obj.FullUrl = window.location.href;
  
  return obj;
}