﻿// JScript File
function alertSize() {

  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 
//  document.getElementById("centerfold").style.height = (myHeight - 240) + "px";
  if (document.getElementById("paneldisconnect") != null){document.getElementById("paneldisconnect").style.height = (myHeight - 240) + "px";}
  if (document.getElementById("panelconnect") != null){document.getElementById("panelconnect").style.height = (myHeight - 240) + "px";}
  if (document.getElementById("panelAccueil") != null){document.getElementById("panelAccueil").style.height = (myHeight - 240) + "px";}
  
}

var newwindow = '';

function ouvrirFenetre( aLiens) {
    var left = parseInt((screen.availWidth/2) - (815/2));
    var top = parseInt((screen.availHeight/2) - (600/2));
    var windowFeatures = "height=600,width=815,status=no,toolbar=no,menubar=no,location=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    
    var newwindow = window.open('popupWindow.aspx?w=' + aLiens,'name',windowFeatures);
	if (window.focus) {newwindow.focus()}
	return false;
}

function ouvrirLeurre() {
	if (!newwindow.closed && newwindow.location) {
		newwindow.location.href = 'leurrecourant.aspx';
	}
	else {
	
	 var left = parseInt((screen.availWidth/2) - (815/2));
    var top = parseInt((screen.availHeight/2) - (600/2));
    var windowFeatures = "height=600,width=815,status=no,toolbar=no,menubar=no,location=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
   
   
		newwindow=window.open('leurrecourant.aspx','name',windowFeatures);
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	return false;
}

function ouvrirCreerPecheur() {
	if (!newwindow.closed && newwindow.location) {
		newwindow.location.href = 'creerpecheur.aspx';
	}
	else {
	
	 var left = parseInt((screen.availWidth/2) - (815/2));
    var top = parseInt((screen.availHeight/2) - (600/2));
    var windowFeatures = "height=600,width=815,status=no,toolbar=no,menubar=no,location=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
   
   
		newwindow=window.open('creerpecheur.aspx','name',windowFeatures);
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	return false;
}

function ouvrirPossession() {
	if (!newwindow.closed && newwindow.location) {
		newwindow.location.href = 'possession.aspx';
	}
	else {
	
	 var left = parseInt((screen.availWidth/2) - (815/2));
     var top = parseInt((screen.availHeight/2) - (600/2));
     var windowFeatures = "height=600,width=815,status=no,toolbar=no,menubar=no,location=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
   
		newwindow=window.open('possession.aspx','name',windowFeatures);
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	return false;
}

function ouvrirVisionneuse(aFile) {
	if (!newwindow.closed && newwindow.location) {
		newwindow.location.href = 'visionneuse.aspx';
	}
	else {

     var left = parseInt((screen.availWidth/2) - (815/2));
     var top = parseInt((screen.availHeight/2) - (600/2));
     var windowFeatures = "height=600,width=815,status=no,toolbar=no,menubar=no,location=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
   
		newwindow=window.open('visionneuse.aspx?file=' + aFile ,'nouvelleFenetre',windowFeatures);
		if (!newwindow.opener) newwindow.opener = self;
	}
	if (window.focus) {newwindow.focus()}
	return false;
}

