var league_detail = new Array(100);
var table_detail = "";
var xwep_name,xcat_id,xlea_id,xleay_id,xleag_id,xteam_id,xteam_idex;
var slipno = "0";
function setvalue(ywep_name,ycat_id,ylea_id,yleay_id,yleag_id,yteam_id,yteam_idex){
  xwep_name  = ywep_name;
  xcat_id    = ycat_id;
  xlea_id    = ylea_id;
  xleay_id   = yleay_id;
  xleag_id   = yleag_id;
  xteam_id   = yteam_id;
  xteam_idex = yteam_idex;
}
              
function getX(obj)
{
 return( obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft+getX(obj.offsetParent) );
}

function getY(obj)
{
 return( obj.offsetParent==null ? obj.offsetTop : obj.offsetTop+getY(obj.offsetParent) );
}

function getTOP(xwep_name,xcat_id,xlea_id,xleay_id,xleag_id,xteam_id,xteam_idex)
{
var obj;
var xTop = 'istatistik'+xleay_id+''+xteam_id+''+xteam_idex;
var layerObj=document.getElementById('dot3');

 if (document.images[xTop] != null) { obj = document.images[xTop].offsetTop} else { obj = 25; } ;
 
  //obj = getY(document.images[xTop]) - 8; 
  //obj = getY(document.images[xTop]) +15; 
  //if (winList['dot3']) winList['dot3'].open();
  //parent.Reload_Statistic('small_statistics.jsp',xwep_name,xcat_id,xlea_id,xleay_id,xleag_id,xteam_id,xteam_idex,obj);
  //document.all['ifristatis'].src='tab_deneme.html';
   Reload('ifristatis','small_statistics.jsp?wep_name='+xwep_name+'&cat_id='+xcat_id+'&lea_id='+xlea_id+'&leay_id='+xleay_id+'&leag_id='+xleag_id+'&team_id='+xteam_id+'&team_idex='+xteam_idex+'&xTop='+obj); 
   layerObj.style.top=getY(document.images[xTop])-1;
   layerObj.style.left=getX(document.images[xTop])+14;
   if (winList['dot3']) winList['dot3'].open();   
}

function simageI(xdeger) {

if (xdeger == '1') {
   return '<img id="istatistik'+xleay_id+''+xteam_id+''+xteam_idex+'" name="istatistik'+xleay_id+''+xteam_id+''+xteam_idex+'" onclick="getTOP(\''+xwep_name+'\',\''+xcat_id+'\',\''+xlea_id+'\',\''+xleay_id+'\',\''+xleag_id+'\',\''+xteam_id+'\',\''+xteam_idex+'\');"   style="cursor:hand;cursor:pointer;" src="images/istatistik.gif" width="12" height="12" border="0" align="absmiddle">';
 } else {
   return '';
 } 
}	

function simageR(rate) {
var xx;
 if ( parseInt(rate) == "0" || rate == "0.00" || rate == "    0.00" || rate == "" ||
				rate == "1" || rate == "1.00" || rate == "    1.00"  )
 {
    xx = '<img src="images/spacer.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';     
 } else {
    //xx = rate +'<img src="images/bet.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';    
    xx = rate +'<img src="images/spacer.gif" width="1" height="7" border="0" align="absmiddle" hspace="2">';    
 }	
 return xx;
}	

function simageNamedR(rate,name) {
var xx;
 if ( parseInt(rate) == "0" || rate == "0.00" || rate == "    0.00" || rate == "" ||
				rate == "1" || rate == "1.00" || rate == "    1.00"  )
 {
    xx = '<img src="images/spacer.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';     
 } else {
    //xx = rate +'<img src="images/bet.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';    
    xx = '<div style="float:left;padding-left:50px;">'+name+'</div> <div style="float:right;padding-right:50px;">'+rate +'</div><img src="images/spacer.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';    
 }	
 return xx;
}	

function simageNR(rate) {
var xx;
 if ( parseInt(rate) == "0" || rate == "0.00" || rate == "    0.00" || rate == "" ||
				rate == "1" || rate == "1.00" || rate == "    1.00"  )
 {
//    xx = '<img src="images/spacer.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';     
//    xx = '<img src="images/spacer.gif" width="1" height="7" border="0" align="absmiddle" hspace="2">';    
    xx = '<img src="images/bet.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';    
 } else {
//    xx = rate +'<img src="images/bet.gif" width="12" height="7" border="0" align="absmiddle" hspace="2">';    
    xx = rate +'<img src="images/spacer.gif" width="1" height="7" border="0" align="absmiddle" hspace="2">';    
 }	
 return xx;
}	

function karsi(kod,d1,v1,d2,v2,v3) {
var xx = "";
if (kod == d1) return v1;
if (kod == d2) return v2;
return v3;
}	

function league_group_sub_title(xsubtitle,orderby,p0,p1,p2,p3,p4,p5,p6,p7,p8){
var xx = "";
if( p3 != "" ) xx=p3;
if( p4 != "" ){
    if ( xx != "" ) xx=xx+'/'+p4;
    else xx=p4;
}
if( p5 != "" ){
    if ( xx != "" ) xx=xx+'/'+p5;
    else xx=p5;
}
document.write('<table border="0" cellpadding="0" cellspacing="1" width="100%" align="center">');
document.write('<tr> ');
document.write('<td><img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>');
document.write('</tr>');
document.write('</table>');
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
document.write('<tr class="eachtitle">');
document.write('<td width="5%"><b>'+p0+'</b></td>'); //Date
document.write('<td width="5%"><b>'+p1+'</b></td>'); //Time
document.write('<td width="30%"><b>'+xsubtitle+'</b></td>'); //Title
document.write('<td width="30%"><b>'+p2+'</b></td>'); //Win Group
document.write('<td width="10%"><b>'+xx+'</b></td>'); //Price Type
document.write('<td align="center" width="10%"><input type="submit" value="Special" class="buton1"></td>');
document.write('<td width="10%" align="right"><img onclick="league_click('+orderby+',0)" hspace="2" src="images/up.gif" width="11" height="11" style="cursor:hand;cursor:pointer;" alt="" border="0"><img style="cursor:hand;cursor:pointer;" hspace="3" onclick="league_click('+orderby+',1)" hspace="2" src="images/down.gif" width="11" height="11" alt="" border="0"></td>');
document.write('</tr>');
document.write('</table>');
}

function league_title(xtitle,orderby,xstyle){
slipno = "0";
if ( xstyle != "GROUP" )
{
document.write('<table border="0" cellpadding="0" cellspacing="1" width="100%" align="center">');
document.write('<tr> ');
document.write('<td><img src="images/spacer.gif" width="1" height="5" alt="" border="0"></td>');
document.write('</tr>');
document.write('</table>');
document.write('<table border="0" cellspacing="0" cellpadding="0" align="rigth" width="100%">');
document.write('<tr>');
document.write('<td class="kupontitle" width="100%">'+simageI(1)+'<b>'+xtitle+'</b></td>');
document.write('<td align="right" class="kupontitle"><img onclick="league_click('+orderby+',0)" hspace="2" src="images/up.gif" width="11" height="11" style="cursor:hand;cursor:pointer;" alt="" border="0"><img style="cursor:hand;cursor:pointer;" hspace="3" onclick="league_click('+orderby+',1)" hspace="2" src="images/down.gif" width="11" height="11" alt="" border="0"></td>');
document.write('</tr>');
document.write('</table>');
}
else
{
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">');
document.write('<tr> ');
document.write('<td><img src="images/spacer.gif" width="1" height="5" alt="" border="0"></td>');
document.write('</tr>');
document.write('</table>');
document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%">');
document.write('<tr>');
document.write('<td class="grouptitle" width="100%">'+simageI(1)+'<b>'+xtitle+'</b></td>');
document.write('</tr>');
document.write('</table>');
}
}

function t_w(orderby) {
  league_detail[orderby] = '<font id=winleague'+orderby+' >'+table_detail+'</font>';
  document.write(league_detail[orderby]); 
  table_detail = "";
} 

function league_click(orderby,open_close) {
var xx;

if ( open_close == '1') {
   if (league_detail[orderby] != "")document.getElementById("winleague"+orderby).innerHTML = league_detail[orderby];
 } else {
 xx = document.getElementById("winleague"+orderby).innerHTML + '';
 if (xx.length > 9 ) {
   league_detail[orderby] = document.getElementById("winleague"+orderby).innerHTML;
 }
 document.getElementById("winleague"+orderby).innerHTML = ''; 
 }
}
 
function l_u(xno,p01,p02,p03,p04,p05,p06) {
ttitle = "";
var xx = "";
var tt = "";
 if (xno == '0') { 
 xx = xx +'<table border="0" cellspacing="1" cellpadding="1" width="100%">';
 xx = xx +'<tr class="kuponalttitle">';
  xx = xx +'<td width="65">'+title10+'</td>';//code
 xx = xx +'<td width="14" align="center"></td>';
 xx = xx +'<td width="5%">'+title1+'</td>';
 xx = xx +'<td width="5%">'+title2+'</td>';
 xx = xx +'<td width="27%">'+title3+'</td>';
 xx = xx +'<td width="27%">'+title4+'</td>';
 xx = xx +'<td align="right" width="7%">'+title5+'</td>';
 xx = xx +'<td align="right" width="7%">'+title6+'</td>';
 xx = xx +'<td align="right" width="7%">'+title7+'</td>';
 xx = xx +'<td width="5%"></td>'; 
 xx = xx +'<td width="10%" align="center"></td>';
 xx = xx +'</tr>';
 table_detail = table_detail + xx;
 }
 else if (xno == '1') {  
 xx = xx +'<table border="0" cellspacing="1" cellpadding="0" width="100%">';
 xx = xx +'<tr class="kuponalttitle">';
 //xx = xx +'<td class="kuponalttitle" width="50"><b>'+title10+'</b></td>';
// xx = xx +'<td class="kuponalttitle" width="50"><b>'+title11+'</b></td>';
 xx = xx +'<td width="49%"><b>'+title12+'</b></td>';
 tt = "";
 if (p01 != ''){
   if (p01 == 'Fixed')tt=title14;
   else if (p01 == 'SP')tt=title16;
   else if (p01 == 'PM')tt=title18;
   else if (p01 == 'ToteUK')tt=title17;
   else if (p01 == 'ToteD')tt=title20;
   else if (p01 == 'BPG')tt=title19;        
   xx = xx +'<td width="10%" align="center"><b>'+tt+'</b></td>'     
   if (p04 == '1')xx = xx +'<td align="center" width="7%"><b>'+title15+'('+tt+')</b></td>';
 }
 tt = "";
 if (p02 != ''){
   if (p02 == 'Fixed')tt=title14;
   else if (p02 == 'SP')tt=title16;
   else if (p02 == 'PM')tt=title18;
   else if (p02 == 'ToteUK')tt=title17;
   else if (p02 == 'ToteD')tt=title20;
   else if (p02 == 'BPG')tt=title19;     
   xx = xx +'<td align="center" width="10%"><b>'+tt+'</b></td>'     
   if (p05 == '1')xx = xx +'<td align="center" width="7%"><b>'+title15+'('+tt+')</b></td>';
 }
 tt = "";
 if (p03 != ''){
   if (p03 == 'Fixed')tt=title14; 
   else if (p03 == 'SP')tt=title16;
   else if (p03 == 'PM')tt=title18;
   else if (p03 == 'ToteUK')tt=title17;
   else if (p03 == 'ToteD')tt=title20;
   else if (p03 == 'BPG')tt=title19;     
   xx = xx +'<td align="center" width="10%"><b>'+tt+'</b></td>'     
   if (p06 == '1')xx = xx +'<td align="center" width="7%"><b>'+title15+'('+tt+')</b></td>';
 }
 xx = xx +'</tr>';
 table_detail = table_detail + xx;
  }
} 

function l_logo(pminutes,pperiod,pteam_home,pteam_away,pteam_logohome,pteam_logoaway,pteam_homescore,pteam_awayscore,ptvc_banner) {
	var xx = "";	
	xx = xx +'<tr>';
	xx = xx +'<td colspan="12" >';
	xx = xx +'<table border="0" cellpadding="0" cellspacing="1" width="100%" align="center">';
	xx = xx +'<tr>';
	xx = xx +'<td width="100" rowspan="2" bgcolor="#EFEFEF" align="center">';
	xx = xx +'<img src="upload/'+pteam_logohome+'" width="80" height="80" alt="" border="1"></td>';
	xx = xx +'<td bgcolor="#CC0000" align="center" width="33%"><b>';
	xx = xx +'<font face="Tahoma" size="4" color="#FFFFFF">'+pteam_home+'</font></b></td>';
	xx = xx +'<td bgcolor="#CC0000" align="center"><b>';
//	xx = xx +'<font face="Tahoma" size="4" color="#FFFFFF">Vs</font></b></td>';
	xx = xx +'<img src="upload/'+ptvc_banner+'" border="0" />';
	xx = xx +'<td bgcolor="#CC0000" align="center" width="33%"><b>';
	xx = xx +'<font face="Tahoma" size="4" color="#FFFFFF">'+pteam_away+'</font></b></td>';
	xx = xx +'<td rowspan="2" width="100" bgcolor="#EFEFEF" align="center">';
	xx = xx +'<img src="upload/'+pteam_logoaway+'" width="80" height="80" alt="" border="1"></td>';
	xx = xx +'</tr>';
	xx = xx +'<tr>';
	xx = xx +'<td bgcolor="#EFEFEF" align="center" width="33%" height="31"><b>';
	xx = xx +'<font face="Tahoma" size="4">'+pteam_homescore+'</font></b></td>';
	xx = xx +'<td bgcolor="#333333" align="center" height="31"><b>';
	xx = xx +'<font face="Tahoma" size="4" color="#FFFFFF">'+pminutes+'</font></b></td>';
	xx = xx +'<td bgcolor="#EFEFEF" align="center" width="33%" height="31"><b>';
	xx = xx +'<font face="Tahoma" size="4">'+pteam_awayscore+'</font></b></td>';
	xx = xx +'</td>';
	xx = xx +'</tr>';
	xx = xx +'</table>';	
	xx = xx +'</td>';
	xx = xx +'</tr>';
	table_detail = table_detail + xx;
}

function l_live(pminutes,pperiod,pteam_home,pteam_away,pteam_logohome,pteam_logoaway,pteam_homescore,pteam_awayscore,pteam_homecorner,pteam_awaycorner,pteam_homeycard,pteam_awayycard,pteam_homercard,pteam_awayrcard,ptvc_banner,teg_id,tgr_id,cat_id,cgt_id,lea_id,tgr_raten1,tgr_raten2,tgr_raten3,show_cards,show_corners) {
	var xx = "";	
	xx = xx +'<tr>';
	xx = xx +'<td colspan="12" bgcolor="#DEDEDE">';
	
	xx = xx +'<table width="100%" border="0" cellspacing="1" cellpadding="0">\n';
	xx = xx +'<tr>\n';
	xx = xx +'<td width="82" rowspan="2" align="center" valign="top">';
	xx = xx +'<img src="upload/'+pteam_logohome+'" width="80" height="80" alt="" border="1"></td>\n';
	xx = xx +'<td width="38%" align="center" bgcolor="#CC0000"><b><font face="Tahoma" size="4" color="#FFFFFF">'+pteam_home+'</font></b></td>\n';
	xx = xx +'<td align="center" bgcolor="#CC0000" height="40">';
	xx = xx +'<img src="upload/'+ptvc_banner+'" width="55" height="30" alt="" border="0" /></td>\n';
	xx = xx +'<td width="38%" align="center" bgcolor="#CC0000"><b><font face="Tahoma" size="4" color="#FFFFFF">'+pteam_away+'</font></b></td>\n';
	xx = xx +'<td width="82" rowspan="2" align="center" valign="top">';
	xx = xx +'<img src="upload/'+pteam_logoaway+'" width="80" height="80" alt="" border="1"></td>\n';
	xx = xx +'</tr>\n';
	xx = xx +'<tr>\n';
	xx = xx +'<td valign="top">\n';
	xx = xx +'<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#EFEFEF">\n';
	xx = xx +'<tr>\n';
	xx = xx +'<td align="center" height="40"><b><font face="Impact" size="5" color="#000000">'+pteam_homescore+'</font></b></td>\n';
	xx = xx +'<td width="40" align="right">\n';
	xx = xx +'<table width="40" border="0" cellspacing="0" cellpadding="0">\n';
	xx = xx +'<tr>\n';
	if (parseInt(show_corners)==1){
		xx = xx +'<td align="right" style="color:#000000;font-size:10;font-weight:bold;">'+pteam_homecorner+'</td>\n';
		xx = xx +'<td align="center"><img border="0" src="images/cornerflag.GIF" width="10" height="10" /></td>\n';
	}else{
		xx = xx +'<td align="right" style="color:#000000;font-size:10;font-weight:bold;"></td>\n';
		xx = xx +'<td align="center"><img border="0" src="images/spacer.gif" width="10" height="10" /></td>\n';
	}
	xx = xx +'</tr>\n';
	xx = xx +'<tr>\n';
	if (parseInt(show_cards)==1){
		xx = xx +'<td align="right" style="color:#000000;font-size:10;font-weight:bold;">'+pteam_homeycard+'</td>\n';
		xx = xx +'<td align="center"><img border="0" src="images/yellowcard.GIF" width="10" height="10" /></td>\n';
	}else{
		xx = xx +'<td align="right" style="color:#000000;font-size:10;font-weight:bold;"></td>\n';
		xx = xx +'<td align="center"><img border="0" src="images/spacer.gif" width="10" height="10" /></td>\n';
	}
	xx = xx +'</tr>\n';
	xx = xx +'<tr>\n';
	if (parseInt(show_cards)==1){
		xx = xx +'<td align="right" style="color:#000000;font-size:10;font-weight:bold;">'+pteam_homercard+'</td>\n';
		xx = xx +'<td align="center"><img border="0" src="images/redcard.GIF" width="10" height="10" /></td>\n';
	}else{
		xx = xx +'<td align="right" style="color:#000000;font-size:10;font-weight:bold;"></td>\n';
		xx = xx +'<td align="center"><img border="0" src="images/spacer.gif" width="10" height="10" /></td>\n';
	}
	xx = xx +'</tr>\n';
	xx = xx +'</table>		</td>\n';
	xx = xx +'</tr>\n';
	xx = xx +'</table>\n';
	xx = xx +'</td>\n';
	xx = xx +'<td align="center" bgcolor="#000000"><b><font face="Tahoma" size="3" color="#FFFFFF">'+pminutes+'</font></b></td>\n';
	xx = xx +'<td valign="top">\n';
	xx = xx +'<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#EFEFEF">\n';
	xx = xx +'<tr>\n';
	xx = xx +'<td width="40" align="left">\n';
	xx = xx +'<table width="40" border="0" cellspacing="0" cellpadding="0">\n';
	xx = xx +'<tr>\n';
	if (parseInt(show_corners)==1){
		xx = xx +'<td align="center"><img border="0" src="images/cornerflag.GIF" width="10" height="10" /></td>\n';
		xx = xx +'<td align="left" style="color:#000000;font-size:10;font-weight:bold;">'+pteam_awaycorner+'</td>\n';
	}else{
		xx = xx +'<td align="center"><img border="0" src="images/spacer.gif" width="10" height="10" /></td>\n';
		xx = xx +'<td align="left" style="color:#000000;font-size:10;font-weight:bold;"></td>\n';
	}
	xx = xx +'</tr>\n';
	xx = xx +'<tr>\n';
	if (parseInt(show_cards)==1){
		xx = xx +'<td align="center"><img border="0" src="images/yellowcard.GIF" width="10" height="10" /></td>\n';
		xx = xx +'<td align="left" style="color:#000000;font-size:10;font-weight:bold;">'+pteam_awayycard+'</td>\n';
	}else{
		xx = xx +'<td align="center"><img border="0" src="images/spacer.gif" width="10" height="10" /></td>\n';
		xx = xx +'<td align="left" style="color:#000000;font-size:10;font-weight:bold;"></td>\n';
	}
	xx = xx +'</tr>\n';
	xx = xx +'<tr>\n';
	if (parseInt(show_cards)==1){
		xx = xx +'<td align="center"><img border="0" src="images/redcard.GIF" width="10" height="10" /></td>\n';
		xx = xx +'<td align="left" style="color:#000000;font-size:10;font-weight:bold;">'+pteam_awayrcard+'</td>\n';
	}else{
		xx = xx +'<td align="center"><img border="0" src="images/spacer.gif" width="10" height="10" /></td>\n';
		xx = xx +'<td align="left" style="color:#000000;font-size:10;font-weight:bold;"></td>\n';
	}
	xx = xx +'</tr>\n';
	xx = xx +'</table></td>\n';
	xx = xx +'<td align="center" height="40"><b><font face="Impact" size="5" color="#000000">'+pteam_awayscore+'</font></b></div>\n';
	xx = xx +'</td>\n';
	xx = xx +'</tr>\n';
	xx = xx +'</table>\n';
	xx = xx +'</td>\n';
	xx = xx +'</tr>\n';
	
	xx = xx +'<table border="0" cellpadding="0" cellspacing="1" width="100%" align="center" bgcolor="#DEDEDE">\n';
	xx = xx +'<tr>\n';
	xx = xx +'<td align="center" bgcolor="#EFEFEF" height="35" width="82">';
	xx = xx +'<input type="button" onclick="special_click('+teg_id+');" value="'+butonO+'" class="buton1"></td>\n';
	xx = xx +'<td width="38%" bgcolor="#EFEFEF" align="center" style="cursor:hand;cursor:pointer;" id="rate1_'+tgr_id+'"';
	if (tgr_raten1 > 1)
		xx = xx +' onclick="bet_click(this,rate1_'+tgr_id+','+teg_id+','+tgr_id+','+cgt_id+',1,'+tgr_raten1+',1,0);"';
	xx = xx +'>';
	xx = xx +'<b><font face="Tahoma" size="3" color="#000000">'+simageR(tgr_raten1)+'</font></b></td>\n';
	xx = xx +'<td width="150" colspan="3" bgcolor="#EFEFEF" align="center" style="cursor:hand;cursor:pointer;" id="rate2_'+tgr_id+'"';
	if (tgr_raten2 > 1)
		xx = xx +' onclick="bet_click(this,rate2_'+tgr_id+','+teg_id+','+tgr_id+','+cgt_id+',2,'+tgr_raten2+',1,0);"';
	xx = xx +'>';
	xx = xx +'<b><font face="Tahoma" size="3" color="#000000">'+simageR(tgr_raten2)+'</font></b></td>\n';
	xx = xx +'<td width="38%" bgcolor="#EFEFEF" align="center" style="cursor:hand;cursor:pointer;" id="rate3_'+tgr_id+'"';
	if (tgr_raten3 > 1)
		xx = xx +' onclick="bet_click(this,rate3_'+tgr_id+','+teg_id+','+tgr_id+','+cgt_id+',3,'+tgr_raten3+',1,0);"';
	xx = xx +'>';
	xx = xx +'<b><font face="Tahoma" size="3" color="#000000">'+simageR(tgr_raten3)+'</font></b></td>\n';
	xx = xx +'<td align="center" bgcolor="#EFEFEF" width="82">';
	xx = xx +'<input type="button" onclick="window.location=\'coupon_detail.jsp?teg_id='+teg_id+'&cat_id='+cat_id+'&lea_id='+lea_id+'&wme_id=\';" value="'+buton1+'" class="buton1"></td>\n';
	xx = xx +'</tr>\n';
	//5. satir bitti
	xx = xx +'</table>';	
	
	xx = xx +'</td>\n';
	xx = xx +'</tr>\n';
	


	table_detail = table_detail + xx;
}

function l_tennis(pminutes,pperiod,pteam_home,pteam_away,pteam_logohome,pteam_logoaway,ptvc_banner,teg_id,tgr_id,cat_id,cgt_id,lea_id,tgr_raten1,tgr_raten2,tgr_raten3,p1_game,p2_game,p1_set1,p1_set2,p1_set3,p1_set4,p1_set5,p2_set1,p2_set2,p2_set3,p2_set4,p2_set5,five_sets,pkickoff) {
	var P1_Sets = 0;
	var P2_Sets = 0;

	if ( parseInt(p1_set1) > parseInt(p2_set1) ){
		P1_Sets = P1_Sets + 1;
	}else if ( parseInt(p1_set1) < parseInt(p2_set1) ){
		P2_Sets = P2_Sets + 1;
	}
	if ( parseInt(p1_set2) > parseInt(p2_set2) ){
		P1_Sets = P1_Sets + 1;
	}else if ( parseInt(p1_set2) < parseInt(p2_set2) ){
		P2_Sets = P2_Sets + 1;
	}
	if ( parseInt(p1_set3) > parseInt(p2_set3) ){
		P1_Sets = P1_Sets + 1;
	}else if ( parseInt(p1_set3) < parseInt(p2_set3) ){
		P2_Sets = P2_Sets + 1;
	}
	if ( parseInt(p1_set4) > parseInt(p2_set4) ){
		P1_Sets = P1_Sets + 1;
	}else if ( parseInt(p1_set4) < parseInt(p2_set4) ){
		P2_Sets = P2_Sets + 1;
	}
	if ( parseInt(p1_set5) > parseInt(p2_set5) ){
		P1_Sets = P1_Sets + 1;
	}else if ( parseInt(p1_set5) < parseInt(p2_set5) ){
		P2_Sets = P2_Sets + 1;
	}

	if (P1_Sets == 0)P1_Sets='-';
	if (P2_Sets == 0)P2_Sets='-';

	var xx = "";	
	xx = xx +'<tr>';
	xx = xx +'<td colspan="12" bgcolor="#DEDEDE">';
	
	xx = xx +'<table border="0" width="100%" id="table2" bgcolor="#003300">\n';
	xx = xx +'	<tr>\n';
	xx = xx +'		<td>\n';
	xx = xx +'		<table border="0" width="100%" id="table3" bordercolor="#003300" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'			<tr>\n';
	if (parseInt(five_sets)==1)
		xx = xx +'				<td colspan="4" align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300">\n';
	else
		xx = xx +'				<td colspan="3" align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<p align="center"><b><font color="#FFFF66" face="Tahoma" size="2">'+((parseInt(five_sets)==1)?title33:title36)+'</font></b></td>\n';
	xx = xx +'				<td width="25%" align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<p align="center"><b><font face="Tahoma" color="#FFFF66" size="2">'+title34+': '+pkickoff+'</font></b></td>\n';
	xx = xx +'				<td width="10%" align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300" height="20">\n';
	xx = xx +'				<img border="0" src="upload/'+ptvc_banner+'" width="40" height="20"></td>\n';
	xx = xx +'				<td width="25%" align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font face="Tahoma" color="#FFFF66" size="2">'+title35+': '+pminutes+'</font></b></td>\n';
	xx = xx +'				<td align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="2">'+title36+'</font></b></td>\n';
	xx = xx +'				<td align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="2">'+title37+'</font></b></td>\n';
	xx = xx +'			</tr>\n';
	xx = xx +'			<tr>\n';
	xx = xx +'				<td width="5%" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p1_set1+'</font></b></td>\n';
	xx = xx +'				<td width="5%" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p1_set2+'</font></b></td>\n';
	xx = xx +'				<td width="5%" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p1_set3+'</font></b></td>\n';
	if (parseInt(five_sets)==1) {
		xx = xx +'				<td width="5%" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
		xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p1_set4+'</font></b></td>\n';
	}
	xx = xx +'				<td width="60%" height="31" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300" colspan="3">\n';
	xx = xx +'				<p align="center"><b><font color="#FFFF66" face="Tahoma" size="4">'+pteam_home+'</font></b></td>\n';
	xx = xx +'				<td width="10%" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+P1_Sets+'</font></b></td>\n';
	xx = xx +'				<td width="10%" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p1_game+'</font></b></td>\n';
	xx = xx +'			</tr>\n';
	xx = xx +'			<tr>\n';
	xx = xx +'				<td rowspan="2" align="center" bgcolor="#003300" bordercolorlight="#003300" bordercolordark="#003300" colspan="3">\n';
	xx = xx +'				<p align="center"><b><font color="#FFFF66" face="Tahoma">V</font></b></td>\n';
	xx = xx +'			</tr>\n';
	xx = xx +'			<tr>\n';
	xx = xx +'				<td rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p2_set1+'</font></b></td>\n';
	xx = xx +'				<td rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p2_set2+'</font></b></td>\n';
	xx = xx +'				<td rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p2_set3+'</font></b></td>\n';
	if (parseInt(five_sets)==1) {
		xx = xx +'				<td rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
		xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p2_set4+'</font></b></td>\n';
	}
	xx = xx +'				<td height="46" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+P2_Sets+'</font></b></td>\n';
	xx = xx +'				<td height="46" rowspan="2" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300">\n';
	xx = xx +'				<b><font color="#FFFF66" face="Tahoma" size="5">'+p2_game+'</font></b></td>\n';
	xx = xx +'			</tr>\n';
	xx = xx +'			<tr>\n';
	xx = xx +'				<td height="23" align="center" bgcolor="#000000" bordercolorlight="#003300" bordercolordark="#003300" colspan="3">\n';
	xx = xx +'				<p align="center"><b><font color="#FFFF66" face="Tahoma" size="4">'+pteam_away+'</font></b></td>\n';
	xx = xx +'			</tr>\n';
	xx = xx +'		</table>\n';
	xx = xx +'		</td>\n';
	xx = xx +'	</tr>\n';
	xx = xx +'</table>\n';

	xx = xx +'<table border="0" cellpadding="0" cellspacing="1" width="100%" align="center" bgcolor="#DEDEDE">\n';
	xx = xx +'<tr>\n';
	xx = xx +'<td align="center" bgcolor="#EFEFEF" height="35" width="82">';
	xx = xx +'<input type="button" onclick="special_click('+teg_id+');" value="'+butonO+'" class="buton1"></td>\n';
	xx = xx +'<td width="40%" bgcolor="#EFEFEF" align="center" style="cursor:hand;cursor:pointer;" id="rate1_'+tgr_id+'"';
	if (tgr_raten1 > 1)
		xx = xx +' onclick="bet_click(this,rate1_'+tgr_id+','+teg_id+','+tgr_id+','+cgt_id+',1,'+tgr_raten1+',1,0);"';
	xx = xx +'>';
	xx = xx +'<b><font face="Tahoma" size="3" color="#000000">'+simageNamedR(tgr_raten1,pteam_home)+'</font></b></td>\n';
	//xx = xx +'<td width="150" colspan="3" bgcolor="#EFEFEF" align="center" style="cursor:hand;cursor:pointer;" id="rate2_'+tgr_id+'"';
	//if (tgr_raten2 > 1)
	//	xx = xx +' onclick="bet_click(this,rate2_'+tgr_id+','+teg_id+','+tgr_id+','+cgt_id+',2,'+tgr_raten2+',1,0);"';
	//xx = xx +'>';
	//xx = xx +'<b><font face="Tahoma" size="3" color="#000000">'+simageR(tgr_raten2)+'</font></b></td>\n';
	xx = xx +'<td width="40%" bgcolor="#EFEFEF" align="center" style="cursor:hand;cursor:pointer;" id="rate3_'+tgr_id+'"';
	if (tgr_raten3 > 1)
		xx = xx +' onclick="bet_click(this,rate3_'+tgr_id+','+teg_id+','+tgr_id+','+cgt_id+',3,'+tgr_raten3+',1,0);"';
	xx = xx +'>';
	xx = xx +'<b><font face="Tahoma" size="3" color="#000000">'+simageNamedR(tgr_raten3,pteam_away)+'</font></b></td>\n';
	xx = xx +'<td align="center" bgcolor="#EFEFEF" width="82">';
	xx = xx +'<input type="button" onclick="window.location=\'coupon_detailt.jsp?teg_id='+teg_id+'&cat_id='+cat_id+'&lea_id='+lea_id+'&x_sets='+five_sets+'&wme_id=\';" value="'+buton1+'" class="buton1"></td>\n';
	xx = xx +'</tr>\n';
	xx = xx +'</table>';	

	xx = xx +'</td>\n';
	xx = xx +'</tr>\n';
	


	table_detail = table_detail + xx;
}

var ttitle = "";
function l_o(xno,pmaster,pminimum,pteam_idhome,pteam_idaway,ptitle,pcode,
             p01,p02,p03,p04,p05,p06,p07,
			 p08,p09,p10,p11,p12,p13,p14,p15,p16,//Betsystem
			 p17,p18,p19) {
var xx = "";
if ( xno == '1' )
{
   xteam_id   = pteam_idhome;
   if (slipno == '0') { 
   xslip = "slip2";   
   slipno = "1";
   } else {
   xslip = "slip3";   
   slipno = "0";
   }
   xx = xx +'<tr class="'+xslip+'" onMouseover="this.className=\'kuponicerik1\'" onMouseout="this.className=\''+xslip+'\'">';    
   xx = xx +'<td>'+ptitle+'</td>'; 
   if (p11 != ''){
     xx = xx +'<td align="right" style="cursor:hand;cursor:pointer;" id="rate1_'+p18+'" onclick="bet_click(this,rate2_'+p18+','+p17+','+p18+','+p19+',1,'+p05+','+p08+',0);">'+simageNR(p05)+'</td>';
	 if(p14 == '1')
	 {
       xx = xx +'<td align="center"><input style="cursor:hand;cursor:pointer;" id="rate2_'+p18+'" type="Checkbox"';
	   if (pmaster == '1' ) xx = xx + ' disabled ';
	   xx = xx + '></td>';	
	 } 
   }
   if (p12 != ''){
     xx = xx +'<td align="right" style="cursor:hand;cursor:pointer;" id="rate3_'+p18+'" onclick="bet_click(this,rate4_'+p18+','  +p17+','+p18+','+p19+',3,'+p05+','+p09+',0);">'+simageNR("0")+'</td>';
	 if(p15 == '1')
	 {
       xx = xx +'<td align="center"><input style="cursor:hand;cursor:pointer;" id="rate4_'+p18+'" type="Checkbox"';
	   if (pmaster == '1' ) xx = xx + ' disabled ';
	   xx = xx + '></td>';	
	 } 
   }
   if (p13 != ''){
     xx = xx +'<td align="right" style="cursor:hand;cursor:pointer;" id="rate5_'+p18+'" onclick="bet_click(this,rate6_'+p18+','  +p17+','+p18+','+p19+',5,'+p05+','+p10+',0);">'+simageNR("0")+'</td>';
	 if(p16 == '1')
	 {
       xx = xx +'<td align="center"><input style="cursor:hand;cursor:pointer;" id="rate6_'+p18+'" type="Checkbox"';
	   if (pmaster == '1' ) xx = xx + ' disabled ';
	   xx = xx + '></td>';	
	 } 
   }
   xx = xx +'</tr>';
   table_detail = table_detail + xx; 
}
else
{
 if (pmaster == '1') { 
   xteam_id   = pteam_idhome;
   xteam_idex = pteam_idaway; 
   if (slipno == '0') { 
   xslip = "slip2";
   slipno = "1";
   } else {
   xslip = "slip3";   
   slipno = "0";
   }
   if (ptitle != ttitle){
	   xx = xx +'<tr>';    
	   xx = xx +'<td class="istatistik_baslik" colspan="11">'+ptitle+'</td>'; 
	   xx = xx +'</tr>';
	   ttitle = ptitle;
   }
   xx = xx +'<tr class="'+xslip+'" onMouseover="this.className=\'kuponicerik1\'" onMouseout="this.className=\''+xslip+'\'">';
   xx = xx +'<td><b>'+pcode+'</b></td>';
   xx = xx +'<td align="center">'+simageI(pmaster)+'</td>';
   xx = xx +'<td><b>'+p01+'</b></td>';
   xx = xx +'<td><b>'+p02+'</b></td>';
  } else {
   xx = xx +'<tr class="'+xslip+'" onMouseover="this.className=\'kuponicerik1\'" onMouseout="this.className=\''+xslip+'\'">';   
   xx = xx +'<td colspan="4" align="right">'+ptitle+'&nbsp;</td>';  
 }   
 if (p04 == "") {
   xx = xx +'<td colspan="2" align="center">'+
   //simageI(pmaster)+
   p03+'</td>';
 } else {
 if (pmaster == '1') {
   xx = xx +'<td><b>'+p03+'</b></td>'; 
   xx = xx +'<td><b>'+p04+'</b></td>'; }
   else {
   xx = xx +'<td>'+p03+'</td>'; 
   xx = xx +'<td>'+p04+'</td>';
   }
 }

 xx = xx +'<td align="right" style="cursor:hand;cursor:pointer;" id="rate1_'+p18+'" onclick="bet_click(this,rate1_'+p18+','+p17+','+p18+','+p19+',1,'+p05+',1,0);"><b>'+simageR(p05)+'</b></td>';
 xx = xx +'<td align="right" style="cursor:hand;cursor:pointer;" id="rate2_'+p18+'" onclick="bet_click(this,rate2_'+p18+','+p17+','+p18+','+p19+',2,'+p06+',1,0);"><b>'+simageR(p06)+'</b></td>';
 xx = xx +'<td align="right" style="cursor:hand;cursor:pointer;" id="rate3_'+p18+'" onclick="bet_click(this,rate3_'+p18+','+p17+','+p18+','+p19+',3,'+p07+',1,0);"><b>'+simageR(p07)+'</b></td>';
 if (pmaster == '1') { 
  xx = xx +'<td align="center"><b>'+pminimum+'</b></td>'; 
  } else {
  xx = xx +'<td>&nbsp;</td>'; 
 }      
 xx = xx +'<td align="center">';
 if (pmaster == '1') { 
 xx = xx +'<input type="button" onclick="special_click('+p17+');"  value="'+butonO+'" class="buton1">';
 }
 xx = xx +'</td>';
 xx = xx +'</tr>';
 table_detail = table_detail + xx;
 }
} 
 
function popUpbet(url) 
{
	var str  = "toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=516,height=232,top=xxx,left=yyy";
    str = str.split('yyy').join(screen.width/2 - 520/2);
    str = str.split('xxx').join(screen.height/2 - 230/2);		
	var xsealWin = window.open(url,'popupbet',str);
} 
 
function l_s(xno) {
var xx = "";
 xx = xx +'</table>';
 table_detail = table_detail + xx;
} 

function bet_click(xobj, xobj2, teg_id, tgr_id, cgt_id, rateno, rate, betsys_id, betsys_ew) {
if (rate != "0" && rate != "0.00" && rate != "1" && rate != "1.00"  &&  xobj.className != 'prices') {
   xobj.className = 'prices'; // 'kuponicerik';
   if ( xobj2.checked ){ 
     Reload('ifrkupon','bahis_kuponu.jsp?teg_id='+teg_id+'&tgr_id='+tgr_id+'&cgt_id='+cgt_id+'&bcde_rateno='+rateno+'&betsys_id='+betsys_id+'&betsys_ew=1');   
     xobj2.className = 'prices';
   }
   else
      Reload('ifrkupon','bahis_kuponu.jsp?teg_id='+teg_id+'&tgr_id='+tgr_id+'&cgt_id='+cgt_id+'&bcde_rateno='+rateno+'&betsys_id='+betsys_id+'&betsys_ew=0');  
   setTimeout("calkala()", 500);    	  
 }
}  

function calkala() {
var xtop;
  xtop = parseInt(document.getElementById("dot1").style.top);
  document.getElementById("dot1").style.top = xtop + 10;
} 

function special_click( teg_id) { 
 movecall(2,2);
 Reload('ifrozel','special_bets.jsp?teg_id='+teg_id);
 }
 
function Reload(xFrame,xLink) {
  if  (document.getElementById(xFrame) != null)
	  if (document.getElementById(xFrame).src != xLink)  	  
	  {
		  document.getElementById(xFrame).src= xLink;  	  
		  setTimeout("ReloadTimeOut()", 1000);	 
      }
}  
function ReloadTimeOut() 
{
 //null;  
}		  

function asagiyukari() {
var fark;

if ( document.body.clientHeight < (top.window.document.body.scrollTop + 325)){
  fark = document.body.clientHeight - 325;
} else {
  fark = top.window.document.body.scrollTop;
}
    
    document.getElementById("dot1").style.top = lTop[1]  + fark ;
    document.getElementById("dot2").style.top = lTop[2]  + fark ;
    setTimeout("asagiyukari()", 100);	
} 
 
setTimeout("asagiyukari()", 500); 
