function openUrlInWindow(url, windowName, sizeName) {
    var newWindow = window.open(url, windowName, getSizeParameters(sizeName));
    newWindow.focus();
    return newWindow;
}

function getSizeParameters(sizeName) {
    var sizeParameters = '';
    var width,height;

    switch (sizeName) {
		// This size can be redefined because it is not used yet
        case 'xx-small':
			sizeParameters = 'width=300,height=150,location=0,resizable=yes,scrollbars=yes';
			width = 300;
			height = 150;
			break;

		// typical use : confirmation window
        case 'x-small':
			sizeParameters = 'width=300,height=150,location=0,resizable=yes,scrollbars=yes';
			width = 300;
			height = 150;
			break;

		case 'small':
			sizeParameters = 'width=400,height=200,location=0,resizable=yes,scrollbars=yes';
			width = 400;
			height = 200;
			break;
	
		// typical use : an association window (eg associate a media to a content)
		case 'medium':
			sizeParameters = 'width=600,height=400,location=0,resizable=yes,scrollbars=yes';
			width = 600;
			height = 400;
			break;
	
		// typical use : an association window (eg associate a media to a content)
		case 'mediumasso':
			sizeParameters = 'width=600,height=400,location=0,resizable=yes,scrollbars=yes';
			width = 600;
			height = 400;
			break;
	
		case 'large':
			sizeParameters = 'width=800,height=600,location=0,resizable=yes,scrollbars=yes';
			width = 800;
			height = 600;
			break;
	
		case 'geoloc':
			sizeParameters = 'width=970,height=700,location=0,resizable=yes,scrollbars=yes,status=yes';
			width = 870;
			height = 570;
			break;
	
		// a special window size asked by CG95
		case 'sendContent':
			sizeParameters = 'width=590,height=580,location=0,resizable=yes,scrollbars=no';
			width = 590;
			height = 430;
			break;
	
		case 'x-large':
			sizeParameters = 'width=860,height=700,location=0,resizable=yes,scrollbars=yes';
			width = 860;
			height = 780;
			break;
	
		// This size can be redefined because it is not used yet
		case 'xx-large':
			sizeParameters = 'width=860,height=740,location=0,resizable=yes,scrollbars=yes';
			width = 860;
			height = 780;
			break;
	
		case 'widescreen':
			sizeParameters = 'width=830,height=500,location=0,resizable=no,scrollbars=no';
			width = 830;
			height = 500;
			break;
	
		default:
			sizeParameters = 'width=400,height=200,location=0,resizable=yes,scrollbars=yes';
			width = 400;
			height = 200;
			break;
    }

    // center the popups onto the screen
    var screenX, screenY;
    if (navigator.appName == "Microsoft Internet Explorer") {
	screenY = document.body.offsetHeight
	screenX = window.screen.availWidth
    } else {
	screenY = screen.height;
	screenX = screen.width;
    }

    var leftvar, rightvar, leftprop, topprop;
    leftvar = (screenX - width) / 2
    rightvar = (screenY - height) / 2
    if (navigator.appName == "Microsoft Internet Explorer") {
	leftprop = leftvar
	topprop = rightvar
    } else { 
	// adjust Netscape coordinates for scrolling
	leftprop = (leftvar - pageXOffset)
	topprop = (rightvar - pageYOffset)
    }
    if(leftprop<0) leftprop=0;
    if(topprop<0) topprop=0;
    sizeParameters = sizeParameters + ",left=" + leftprop;
    sizeParameters = sizeParameters + ",top=" + topprop;

    return sizeParameters;
}

//--------------------------------------
//--------------------------------------

function showId(baliseId)
  {
  hideId('menuID0');
  hideId('menuID1');
  hideId('menuID2');
  if (document.getElementById && document.getElementById(baliseId) != null)
    {
    document.getElementById(baliseId).style.visibility='visible';
    document.getElementById(baliseId).style.display='block';
    }
  }

function hideId(baliseId)
  {
  if (document.getElementById && document.getElementById(baliseId) != null)
    {
    document.getElementById(baliseId).style.visibility='hidden';
    document.getElementById(baliseId).style.display='none';
    }
  } 

function hideAll()
  {
	hideId('menuID0');
  	hideId('menuID1');
  	hideId('menuID2');
  }  