 Nom = navigator.appName;
 Version = navigator.appVersion;
 ns4 = (Nom == 'Netscape' && Version >= 4 ) ? 1:0;
 op5 = (Nom == 'Opera' && Version >= 5 ) ? 1:0;
 chrome = (navigator.userAgent.toLowerCase().indexOf('chrome') >=0) ? 1:0;
 ffox = (navigator.userAgent.toLowerCase().indexOf('firefox') >=0) ? 1:0;
 safari = (navigator.userAgent.toLowerCase().indexOf('safari') >=0) ? 1:0;
 popupWidth = 344;
 
 function ouvre_popup(page,name) {

		var top=Math.round((screen.height-435)/2);
		var left=Math.round((screen.width-popupWidth)/2);
		window.open(page,"popup","menubar=no, status=no, resizable=yes, scrollbars=yes, menubar=no, width="+popupWidth+", height=475, left="+left+", top="+top+"").focus();
		
 }
  function ouvre_popup2(page,name) {
		var top=Math.round((screen.height-665)/2);
		var left=Math.round((screen.width-popupWidth)/2);
       window.open(page,"popup","menubar=no, status=no, resizable=yes, scrollbars=yes, menubar=no, width="+popupWidth+", height=645, left="+left+", top="+top+"").focus();
       window.open(page,"popup","menubar=no, status=no, resizable=yes, scrollbars=yes, menubar=no, width="+popupWidth+", height=745, left="+left+", top="+top+"").focus();
 }
 
   function ouvre_popup3(page,name) {
		var top=Math.round((screen.height-665)/2);
		var left=Math.round((screen.width-popupWidth)/2);
       window.open(page,"popup","menubar=no, status=no, resizable=yes, scrollbars=yes, menubar=no, width="+popupWidth+", height=525, left="+left+", top="+top+"").focus();
 }
 
     function ouvre_aide(page,name) {
		var top=Math.round((screen.height-665)/2);
		var left=Math.round((screen.width-popupWidth)/2);
       window.open(page,"aide","menubar=no, status=no, resizable=yes, scrollbars=yes, menubar=no, width="+popupWidth+", height=280, left="+left+", top="+top+"").focus();
       window.open(page,"popup","menubar=no, status=no, resizable=yes, scrollbars=yes, menubar=no, width="+popupWidth+", height=525, left="+left+", top="+top+"").focus();
 }
 
    function ouvre_aide(page,name) {
		var top=Math.round((screen.height-665)/2);
		var left=Math.round((screen.width-popupWidth)/2);
       window.open(page,"aide","menubar=no, status=no, resizable=yes, scrollbars=yes, menubar=no, width="+popupWidth+", height=240, left="+left+", top="+top+"").focus();
 }
    
    function resizeH_popup(){		
    	var popupH = getElementHeight("popup");	
    	//var updateH = getElementHeight("update-date");
    	//if(Nom == 'Microsoft Internet Explorer')updateH = updateH + 35;
		//if(chrome)updateH = updateH + 60;
		var margeH = 1;
		if(Nom == 'Microsoft Internet Explorer'){
			if(Version >= 7 || Version.toLowerCase().indexOf('msie 7') >= 0  || Version.toLowerCase().indexOf('msie 8') >= 0) margeH = 40;
			else margeH = 61;
		}
		if(chrome)margeH = 58;
		else if(safari)margeH = 35;
    	//var footerpopupH = getElementHeight("footerpopup");
		
		var scrollH = 0;
		if(isScrollbar('h') == true){			
			scrollH = 13;
		}
		
    	//setWinHeight(eval(popupH + footerpopupH + margeH + scrollH));
		setWinHeight(eval(popupH + margeH + scrollH));
    }
    
   function getElementHeight(Elem) {    	
    	if (ns4) {
    		var elem = getObjNN4(document, Elem);
			if(elem) return elem.clip.height;
			else return 0;
    	} else {
    		if(document.getElementById) {
    			var elem = document.getElementById(Elem);
    		} else if (document.all){
    			var elem = document.all[Elem];
    		}
			if(elem){
				if (op5) { 
					xPos = elem.style.pixelHeight;
				} else {
					xPos = elem.offsetHeight;
				}
			}
			else {
				xPos = 0;
			}
    		return xPos;
    	} 
    }
    
    function setWinHeight(myHeight) {
		var w = popupWidth;
		if(Nom == 'Microsoft Internet Explorer'){			
			if(Version >= 7 || Version.toLowerCase().indexOf('msie 7') >= 0  || Version.toLowerCase().indexOf('msie 8') >= 0)w=356;
			else w=373;
		}
		if(chrome || safari)w = 354;
		
		if(ffox){
			window.innerHeight = myHeight;
		}
		else{
			window.resizeTo(w , myHeight);
		}    	 
    }
	
	function isScrollbar(type){
		var root = document.body ? document.body : document.documentElement;
		var w = popupWidth;
		
		if(type == 'v'){
			var isVerticalScrollbar = root.scrollHeight > root.clientHeight;
			return isVerticalScrollbar;
		}
		else if(type == 'h'){
			var isHorizontalScrollbar = w > root.scrollWidth;
			return isHorizontalScrollbar;
		}
		return false;
	}
