
//--------------------------------------------
//
//	Utility functions
//
//--------------------------------------------

// Open a window of the desired size in the centre of the screen.
function openWindow(target_file, width, height, hasScrollBars) {
	var theWidth = width;
	var theHeight = height;
	var scrollBars = "scrollbars";
	if (hasScrollBars == false) scrollBars = "scrollbars=0";
	if ((theWidth == "")||(theWidth == null)) theWidth = 740;
	if ((theHeight == "")||(theHeight == null)) theHeight = 550;
	var theLeft = (screen.availWidth - theWidth)/2;
	var theTop = (screen.availHeight - theHeight)/2; 
	var popupWin = window.open(target_file, '_' + Math.round(Math.random() * 1000000), 'top='+theTop+',left='+theLeft+',menubar=0,toolbar=0,location=0,directories=0,status=0,'+scrollBars+',resizable,width='+theWidth+',height='+theHeight);
}

//Open mediaplayer window (InsideBritishTennis.com
function mediaWindow(url){ 
    window.open(url,
    'LTAmediaplayer',
    'width=710,height=560,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,status=yes,directories'); 
} 

function daviscup() {
	var hauteur = 600;
	var largeur = 470;
        var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
        var lien = "http://ls.daviscup.com/dc/2007/wg/po/launch-efrm.asp?tie=100008930";
	nFen = open(lien,"DavisCupE","top="+top+",left="+left+",toolbar=no,scrollbars=no,directories=no,menubar=no,width="+largeur+",height="+hauteur);
}
