function livescoring( strSite, dtYear, strDivisionCode, strEventClassificationCode, strZoneCode, intDrawsheetRoundNumber, intTieId ) {

    // strSite will be "fedcup" for English site or "es" for spanish

    var iWin_height = 650;
    var iWin_width = 590;
    var sTop = (screen.height-iWin_height)/2;
    var sLeft = (screen.width-iWin_width)/2;
    var sRound = "Final";

    if (strDivisionCode == "PO") {
        sRound = "Play-offs";
    } else if (strDivisionCode == "WG") {
        sRound = "World Group";
    } else if (strDivisionCode == "WG2") {
        sRound = "World Group II";
    }

    var sURL = "http://ls.daviscup.com/live.asp?tid=" + intTieId + "&desc=" +sRound;
    var oWin = open(sURL, "FedCupLS" + strEventClassificationCode, "top=" + sTop + ",left=" + sLeft + ",toolbar=no,scrollbars=no,directories=no,menubar=no,width=" + iWin_width + ",height=" + iWin_height);

    // Detect is window opened ok not longer works with IE8 - f**king microsoft!!!!
    //if (oWin) {
    //    oWin.focus();
    //} else {
    //    alert('The Live Scoreboard window could not be opened.\n\nPlease set any pop-up blockers to allow pop-ups from the following sites:\n\nhttp://www.daviscup.com/\nhttp://ls.daviscup.com/');
    //}

}

function showpopup (imagepage)
{
    var imagewindow1 = window.open(imagepage,'imagewindow1','width=440,height=540');
    
    if (imagewindow1.opener == null)
        imagewindow1.opener = self;

    imagewindow1.focus (); 
}

function showpopup2 (statspage)
{
    var statwindow1 = window.open(statspage,'statwindow1','width=500,height=396');
    
    if (statwindow1.opener == null)
        statwindow1.opener = self;

    statwindow1.focus (); 
}

function popupDrawsheet(page)
{
    var page = window.open(page,'drawsheet','width=690,height=600,left=10,top=10,resizeable=yes,scrollbars=yes');
    
    if (page.opener == null)
        page.opener = self;

    page.focus();
    page.print();
}

function popupChoiceofGround(page)
{
    var page = window.open(page,'choiceofground','width=780,height=570,left=10,top=10,resizeable=no,scrollbars=no');
    
    if (page.opener == null)
        page.opener = self;

    page.focus();
}

// function to check that one of the options on a poll has been checked
function fnCheckOptions(id) {

	for (var i=0;i < document.getElementsByName('radPollChoice').length; i++) {
	    if (document.getElementsByName('radPollChoice')[i].checked == true) {
	        eval("document.frmVoting" + id).submit();
	    } 
	}
}

// this returns the filename portion of the URL, without any of the directory structure or the filetype e.g. "podda" for /a/b/c/podda.asp
function fnGetFileName() { 
  var url = document.URL; 
  var DocName =(url.substring(url.lastIndexOf("\\")+1,url.lastIndexOf("\."))) // for windows
  var DocName = (url.substring(url.lastIndexOf("\/") + 1, url.lastIndexOf("\."))) // for *nix
  return DocName;
	this.fnGetFileName=fnGetFileName;
}

// this launches the radio/video popup ENGLISH VERSION
// the two parameters are the IRIS mediaid and the media name and will only be set when user has selected a specific file from the list on the website
function launchradioplayer(mediaid,medianame)
{
    var winURL = '/news/radiopopup.asp';
    var winName = 'radioplayer';
    var winFeatures = 'height=510,width=350,toolbar=no,scrollbars=no,directories=no,menubar=no';
    if (mediaid > 0 ) 
	{
        winURL += '?mediaid='+mediaid+'&medianame='+medianame; 
                }
    var newwindow = window.open(winURL, winName, winFeatures); 
    if (window.focus) 
    {
        if (newwindow) 
        {
            newwindow.focus();
			} 
        else 
        {
            alert('<%=IAP_GetTranslationForJavascript("Radio popup could not be opened","shortstring")%>');
        }
    } 
}

// this launches the radio/video popup SPANISH VERSION
// the two parameters are the IRIS mediaid and the media name and will only be set when user has selected a specific file from the list on the website
function launchradioplayer_esp(mediaid, medianame) {
    var winURL = '/es/news/radiopopup.asp';
    var winName = 'radioplayer';
    var winFeatures = 'height=375,width=350,toolbar=no,scrollbars=no,directories=no,menubar=no'; 
    if (mediaid > 0) {
        winURL += '?mediaid=' + mediaid + '&medianame=' + medianame;
    }
    var newwindow = window.open(winURL, winName, winFeatures);
    if (window.focus) {
        if (newwindow) {
            newwindow.focus();
        }
        else {
            alert('<%=IAP_GetTranslationForJavascript("Radio popup could not be opened","shortstring")%>');
		}
            }
}
