function displayCGVwithConfirm() {
  return confirm('Vous vous apprêtez à récupérer des documents 2LR. La récupération des données est soumise au respect de la Charte d\'utilisation en particulier ses dispositions relatives à l\'utilisation du service 2LR, dont vous reconnaissez avoir pris connaissance et souscrire à ses dispositions.');
}

function popWindow(url,width,height) {
    if( width == -1 ) {
       width=screen.width-5;
       posx=0;
    }
    else {
       posx=screen.width/2 - (width/2);
    }

    if(height == -1 ) {
       height=screen.height-60;
       posy=0;
    }
    else {
       posy=screen.height/2 - (height/2);
    }
 	
 	 try {
			 top.POPUP = open(url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
   			 top.POPUP.moveTo(posx,posy);
  			 top.POPUP.focus();	
	} catch (e) {
			// une erreur javascript est lancée sur IE6... 
			open(url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
	}  
	
}

function popWindowPDF(url,width,height) {
    if (displayCGVwithConfirm()==true){
		if( width == -1 ) {
	       width=screen.width-5;
	       posx=0;
	    }
	    else {
	       posx=screen.width/2 - (width/2);
	    }
	
	    if(height == -1 ) {
	       height=screen.height-60;
	       posy=0;
	    }
	    else {
	       posy=screen.height/2 - (height/2);
	    }
	 	
	 	 try {
				 top.POPUP = open(url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
	   			 top.POPUP.moveTo(posx,posy);
	  			 top.POPUP.focus();	
		} catch (e) {
				// une erreur javascript est lancée sur IE6... 
				open(url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
		} 	
    }
}



function displayCGV() {
  alert('Vous devez reconnaître avoir pris connaissance des Conditions Générales de Vente 2LR et en accepter l\'ensemble de ses dispositions.');
}

function popWindowNoResizable(url,width,height) {
    if( width == -1 ) {
       width=screen.width-5;
       posx=0;
    }
    else {
       posx=screen.width/2 - (width/2);
    }

    if(height == -1 ) {
       height=screen.height-60;
       posy=0;
    }
    else {
       posy=screen.height/2 - (height/2);
    }
 	
 	 try {
			 top.POPUP = open(url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+width+",height="+height);
   			 top.POPUP.moveTo(posx,posy);
  			 top.POPUP.focus();	
	} catch (e) {
			// une erreur javascript est lancée sur IE6... 
			open(url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+width+",height="+height);
	}  
}

// Pour pouvoir modifier le repertoire spécifié dans les xsl (soit /modules/, /reflex/, soit /pragmalex/ )
function popWindowLinks(url,width,height) {
    if( width == -1 ) {
       width=screen.width-5;
       posx=0;
    }
    else {
       posx=screen.width/2 - (width/2);
    }

    if(height == -1 ) {
       height=screen.height-60;
       posy=0;
    }
    else {
       posy=screen.height/2 - (height/2);
    }
 	
 	 try {
			 top.POPUP = open('/reflexv2/modules'+url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
   			 top.POPUP.moveTo(posx,posy);
  			 top.POPUP.focus();	
	} catch (e) {
			// une erreur javascript est lancée sur IE6... 
			open('/reflexv2/modules'+url,'POPUP',"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
	}  
}

function popWindowBis(url,target,width,height) {
    if( width == -1 ) {
       width=screen.width-5;
       posx=0;
    }
    else {
       posx=screen.width/2 - (width/2);
    }

    if(height == -1 ) {
       height=screen.height-60;
       posy=0;
    }
    else {
       posy=screen.height/2 - (height/2);
    }
    try {
    	top.POPUPBIS = open(url,target,"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
    	top.POPUPBIS.moveTo(posx,posy);
    	top.POPUPBIS.focus();	
    } catch (e) {
			// une erreur javascript est lancée sur IE6... 
			open(url,target,"toolbar=0,location=0,top=0,left=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+width+",height="+height);
	}  
}
