function betChoicePopup(URLStr)
{
	scrollWindow(URLStr, 'betChoicePopup', 20, 20, 540, 460);
}

function betChoiceSpawn(URLStr)
{
	resizableScrollWindow(URLStr, 'betChoiceSpawn', 20, 20, 540, 460);
}

// Open a Window without Scrollbars
function noscrollWindow(URLStr, WinName, left, top, width, height)
{
	window.open(URLStr, WinName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top);
}

// Open a Window with Scrollbars
function resizableScrollWindow(URLStr, WinName, left, top, width, height)
{
	window.open(URLStr, WinName, 'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top);
}

// Open a Window with Scrollbars
function scrollWindow(URLStr, WinName, left, top, width, height)
{
	window.open(URLStr, WinName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top);
}

function matchletWindow(sp, cp, st, ev)
{
	
	if (sp == 'CKT')
		noscrollWindow('http://www.howzat.net.au/matchlet/betchoice_matchframe.asp?se=' + cp + '&ma=' + ev, 'betchoice_ckt_matchlet', '10', '10', '468', '322');
}

function scoreboardWindow(sp,dr,st,ev,cp,dr)
{
 var sbpath = '';
 
  if ((cp == '' && ev == '') || (cp == '0' && ev == '0'))
  {
    switch(sp)
    {
      case 'TNS':
        sbpath = 'http://betchoice.tennis.scoreboard.sportsflash.com.au/default.aspx'
        break;
    }
  }
  else
  {
    switch(sp)
    {
      case 'TNS':
        sbpath = 'http://betchoice.tennis.scoreboard.sportsflash.com.au/default.aspx?tournamentId='+cp+'&matchId='+ev+'&roundId='+st+'&drawId='+dr+'&tourId='+tr;
        break;
    }
  }
  myPopup1(sbpath,"score5",700,680,1);
}
function scoreboardWindow(sp, cp, st, ev)
{
	
	
    //alert('hello')
	var sbpath = '';

	if ((cp == '' && ev == '') || (cp == '0' && ev == '0'))
	{
		switch (sp)
		{
			case 'ARF':
				sbpath = 'http://betchoice.scoreboard.sportsflash.com.au/default.aspx?sportId=1';
				break;
			case 'BKB':
				sbpath = 'http://betchoice.basketball.scoreboard.sportsflash.com.au/default.aspx';
				break;
			case 'CKT':
				sbpath = 'http://betchoice.cricket.scoreboard.sportsflash.com.au/default.aspx?primaryChannel=Schedule&seriesId=0&matchId=0';
				break;
			case 'GLF':
				sbpath = 'http://betchoice.golf.scoreboard.sportsflash.com.au/default.aspx';
				break;
			case 'MOT':
				sbpath = 'http://scoreboard.betchoice.com.au/motorsport/MotorSportSB.asp';
				break;
			case 'RBL':
				sbpath = 'http://betchoice.scoreboard.sportsflash.com.au/default.aspx?sportId=7';
				break;
			case 'RBU':
				sbpath = 'http://betchoice.scoreboard.sportsflash.com.au/default.aspx?sportId=8';
				break;
			case 'SOC':
				sbpath = 'http://betchoice.soccer.scoreboard.sportsflash.com.au/default.aspx';
				break;
			case 'TNS':
				sbpath = 'http://betchoice.tennis.scoreboard.sportsflash.com.au/default.aspx';
				break;
		}
	}
	else
	{
		switch (sp)
		{
			case 'ARF':
				//sbpath = 'afl/AFLSB.asp?sbtype=1&series_id=' + cp + '&round_id=' + st + '&match_id=' + ev;
				sbpath = 'http://betchoice.scoreboard.sportsflash.com.au/default.aspx?sportId=1&seriesId='+cp+'&roundId='+st+'&matchId='+ev;
				break;
			case 'BKB':
				sbpath = 'http://betchoice.basketball.scoreboard.sportsflash.com.au/default.aspx?&seriesId=' + cp + '&matchId=' + ev;
				break;
			case 'CKT':
				//sbpath = 'cricket/CricketSB.asp?sbtype=1&series_id=' + cp + '&match_id=' + ev + '&match_type=' + st;
				sbpath = 'http://betchoice.cricket.scoreboard.sportsflash.com.au/default.aspx?primaryChannel=Schedule&seriesId='+cp+'&matchId='+ev;
				break;
			case 'GLF':
				//sbpath = 'golf/GolfSB.asp?sbtype=4&tourn_id=' + ev;
				sbpath = 'http://betchoice.golf.scoreboard.sportsflash.com.au/default.aspx?defaultPage=LeaderBoard&tournamentId='+ev;
				break;
			case 'MOT':
				sbpath = 'http://scoreboard.betchoice.com.au/motorsport/MotorSportSB.asp?sbtype=1&series_id=' + cp + '&meet_id=' + st + '&race_id=' + ev;
				break;
			case 'RBL':
				//sbpath = 'rugby_league/LeagueSB.asp?sbtype=4&series_id=' + cp + '&match_id=' + ev;
				sbpath = 'http://betchoice.scoreboard.sportsflash.com.au/default.aspx?sportId=7';
				break;
			case 'RBU':
				//sbpath = 'rugby_union/UnionSB.asp?sbtype=4&series_id=' + cp + '&match_id=' + ev;
				sbpath = 'http://betchoice.scoreboard.sportsflash.com.au/default.aspx?sportId=8';
				break;
			case 'SOC':
				//sbpath = 'soccer/SoccerSB.asp?sbtype=4&series_id=' + cp + '&match_id=' + ev;
				 sbpath = 'http://betchoice.soccer.scoreboard.sportsflash.com.au/default.aspx?seriesId='+cp+'&matchId='+ev+'&roundId='+st;
				break;
			case 'TNS':
				//sbpath = 'tennis/TennisSB.asp?sbtype=1&draw_id=' + cp;
				sbpath = 'http://betchoice.tennis.scoreboard.sportsflash.com.au/default.aspx?tournamentId='+cp+'&tourId='+st;
				break;
		}
	}

    if(sp!='MOT'){
        myPopup1(sbpath,"score5",700,680,1);
        }
    else{
	     noscrollWindow(sbpath,'betchoice_ssb','10','10','468','340');
	     }
}
function myPopup1(myurl, winname, height, width, scrbars) {
        var scrollbars = "1";
        /*var monitors = app.monitors.primary();
        var res = monitors[0].rect;*/
       if (screen.availHeight >= 800)
            scrollbars = "0";
       
       window.open( myurl, winname, "status = 0, height = "+height+", width = "+width+", scrollbars="+scrollbars+", resizable = 0, location = 0" )
    }
