function OpenPopUp(sUrl,sName,bCenter,bScale,iWidth,iHeight,iMinWidth,iMinHeight,sOptions)
{
	//bCenter - true/false - Sets whether the pop up is centered on the screen
	//bScale - true/false - if true iWidth and iHeight are treated as percentages otherwise as absolute values
	//iMinWidth and iMinHeight - the smallest (absolute) size the new pop up is allowed to be
	//sOptions - Additional options 
	
	var iScreenWidth;
	var iScreenHeight;
	var iWindowWidth;
	var iWindowHeight;
	var iTop;
	var iLeft;
	var sAddOptions = '';
	
	sAddOptions += sOptions + ',';

	if(screen.width)
	{
		iScreenWidth = screen.width
		iScreenHeight = screen.height;
	}
	else if(document.layers)
	{
		iScreenWidth = window.outerWidth
        iScreenHeight = window.outerHeight;
	}
	else
	{
		iScreenWidth = 640
        iScreenHeight = 480;
	}

	
	if(bScale)
	{
		iWindowWidth = (iScreenWidth * iWidth) / 100;
		iWindowHeight = (iScreenHeight * iHeight) / 100;
	}
	else
	{
		iWindowWidth = iWidth;
		iWindowHeight = iHeight;
	}

	if(iWindowWidth < iMinWidth ) iWindowWidth = iMinWidth;
	if(iWindowHeight < iMinHeight ) iWindowHeight = iMinHeight;
	
	sAddOptions += 'width=' + iWindowWidth + ',';
	sAddOptions += 'height=' + iWindowHeight + ',';
	
	if( bCenter )
	{
		iTop = ((iScreenHeight - iWindowHeight) / 2) - (iWindowHeight / 4);
		if(iTop < 0) iTop = 0;
		iLeft = (iScreenWidth - iWindowWidth) / 2;
		sAddOptions += 'screenX=' + iLeft + ',screenY=' + iTop + ',top=' + iTop + ',left=' + iLeft + ',';
	}
	
    window.open(sUrl,sName,sAddOptions);
}

function OpenPopUpTelephone(sUrl)
{
	OpenPopUp(sUrl,'',true,true,46,60,200,200,'scrollbars=yes,resizable=yes');
}
