//////////Lines And Odds (XSL)//////////
function setShowLines(usePopUp, isSportsbook) {
        $(".catTitle a").bind("click", function(evt) {
            ShowMenu($(this).parent().attr("id").replace("category", "") + "Menu", $(this).parent().attr("id").replace("category", "") + "Actuator");
            return noAction(evt);
        });
        if (usePopUp) {
            $(".leagueItem a").bind("click", function(evt) {
                window.open("/schedule.aspx?league=" + $(this).attr("id").replace("league", ""), "Schedule", "resizable=yes, scrollbars=yes, toolbar=no, resize=yes, height=500, width=740");
                return noAction(evt);
            });
        }
        else {
            if (isSportsbook) {
                $(".leagueItem a").bind("click", function(evt) {
                    SportsbookAsyncRequest($(this).parent().parent().parent().prev().attr("id").replace("category", "") + "|" + $(this).attr("id").replace("league", ""));
                    return noAction(evt);
                });
            }
            else {
                $(".leagueItem a").bind("click", function(evt) {
                    ShowLinesAsyncRequest($(this).parent().parent().parent().prev().attr("id").replace("category", "") + "|" + $(this).attr("id").replace("league", ""));
                    return noAction(evt);
                });
            }
        }
}


function setSeoShowLines(usePopUp, isSportsbook) {
        jQuery(".catTitle a").bind("click", function(evt) {
			var redirect = $(this).attr("href");
			
			if(redirect == "/live-lines")
			{
				ShowSeoPagesAsyncRequest($(this).parent().attr("id").replace("category", "") );	
				return noAction(evt);
			}
        });
       
	   	if (usePopUp) {
            $(".leagueItem a").bind("click", function(evt) {
                window.open("/schedule.aspx?league=" + $(this).attr("id").replace("league", ""), "Schedule", "resizable=yes, scrollbars=yes, toolbar=no, resize=yes, height=500, width=740");
                return noAction(evt);
            });
        }
        else {
            if (isSportsbook) {
                $(".leagueItem a").bind("click", function(evt) {
                    SportsbookAsyncRequest($(this).parent().parent().parent().prev().attr("id").replace("category", "") + "|" + $(this).attr("id").replace("league", ""));
                    return noAction(evt);
                });
            }
            else {
                jQuery(".leagueItem a").bind("click", function(evt) {
					
					var dirleague = $(this).attr("href");					
					if(dirleague == "/live-lines")
					{
						ShowSeoLeaguesRequest($(this).parent().parent().parent().prev().attr("id").replace("category", "") + "|" + $(this).attr("id").replace("league", ""));	
						return noAction(evt);
					}
                });
            }
        }
}



//////////Horse_upcoming (XSL)//////////
function setShowUpcoming(){
	$(".race_text_track a").bind("click", function(evt){
		show_next('track_tab2');
		upcomingRaceAsyncRequest($(this).parent().attr("id").replace("track","").replace("race","|").replace("virtual","|"));
		return noAction(evt);
	});
}

//////////Lines (XSL) and Upcoming Games (XSL)//////////
function setLinesUpcomingShowLines(classToFind){
//    $("a." + classToFind).bind("click", function(evt){
//        var arg = $(this).attr("id").split("sep");
//        //ShowSeoLeaguesRequest(arg[0] + "|" + arg[1]);
//        //return noAction(evt);
//    });
}

//////////External Lines (XSL)//////////
function initializeLines(){
    $("a.printLines").bind("click", function(evt){PrintLines(); return noAction(evt);});
    $("a.backLines").bind("click", function(evt){SportsbookAsyncRequest("Main"); return noAction(evt);});
}

//////////Rules (XSL)//////////
function setToggleRules(){
    $("dt.a-m-t").unbind("click").bind("click", function(){toggle_tab($(this))});
}

//////////ParlayCards list (XSL)//////////
function parlayCardsList(){
    $(".parlayCardLink").bind("click", function(evt){
        $("#Card_"+$(this).attr("id")).get(0).checked = true;
        $("#ctl00_mainContent_btnContinueTop").get(0).click();
        return noAction(evt);
    });
}

//////////Player history (XSL)//////////
function playerHistory(){
    for(var i=0; i<8; i++){
        $("#tablewagerHis"+i).bind("click", function(evt){
            show_next($(this).attr("id").replace("table",""));
            return noAction(evt);
        });
        $("#wagerHis"+i+" a").bind("click", function(evt){
            show_next($(this).parent().attr("id"));
            return noAction(evt);
        });
    }
}

//////////Poker Promotions (XSL)//////////
function pkrPromotions(){
    $(".pokerLink").bind("click", function(evt){
        subMenu($(this).attr("id").split("sep")[0], $(this).attr("id").split("sep")[1]);
        return noAction(evt);
    });
}

//////////Racebook wager (XSL)//////////
function rbkWager(){
    $("#amt").bind("keypress", function(evt){return SubmitWager_Event(evt);});
    $("#SubmitWager").bind("click", function(){DoTicketAsyncRequest("True");});
    $("a.rbkLink").bind("click", function(evt){
        ToggleHistory($(this).attr("id").replace("Link","")); 
        return noAction(evt);
    });
}

//////////Racebook wager confirm (XSL)//////////
function rbkWagerClear(){
    $(".rbkClear").bind("click", function(){ClearAsyncRequest("clear");});
}

//////////Racebook wager ticket (XSL)//////////
function rbkWagerTicket(){
    $("#btnConfirm").bind("click", function(){ConfirmAsyncRequest("confirmed");});
}

//////////Racebook wager types (XSL)//////////
function rbkWagerTypes(){
    $("a.rbkTypes").bind("click", function(evt){
        WagerTypeAsyncRequest($(this).attr("id").split("sep")[0].replace("rbkWager","")); 
        return noAction(evt);
    });
}

//////////Squares grid//////////
function sqrGrid(){
    $("a.item_table_left").bind("click", function(){return confirmlink();});
}

//////////Wager Amounts//////////
function sbkWagerAmounts(){
    $("a.wagerAmounts").bind("click", function(evt){
        document.forms[0].SelectedGame.value = $(this).attr("id").replace("rmv_","");
        document.forms[0].submit();
        return noAction(evt);
    });
    $(".syncAmounts").bind("change", function(evt){syncAmounts($(this).attr("value"));});
    $(".wagerAmountsToggle1").bind("click", function(){toggleFreeplayBox(1);});
    $(".wagerAmountsToggle0").bind("click", function(){toggleFreeplayBox(0);});
}

//////////Wager choose//////////
function sbkWagerChoose(){
    $("a.teaserType").bind("click", function(evt){
        $("#SelectedTeaser").attr("value", $(this).attr("id").replace("teaserType_",""));
        document.forms[0].submit(); 
        return noAction(evt);
    });
}

//////////Wager confirm//////////
function sbkWagerConfirm(){
    $("a.wagerConfirm").bind("click", function(evt){
        document.forms[0].SelectedGame.value = $(this).attr("id").replace("rmv_","");
        document.forms[0].removeclick.value='p';
        document.forms[0].submit(); 
        return noAction(evt);
    });
}

//////////Wager leagues//////////
function sbkWagerLeagues(){
    $("a.titleLink").bind("click", function(evt){
        document.forms[0].SelectedCategory.value = $(this).parent().attr("id"); 
        document.forms[0].submit(); 
        return noAction(evt);
    });
    $("a.btnShowBlock").bind("click", function(evt){
        switchVisible($(this).attr("id").replace("_button","") +  "_block", $(this).attr("id"));
        return noAction(evt);
    });
    $("a.eventLink").bind("click", function(evt){
        $("#chk"+$(this).attr("id").replace("eventLink","")).get(0).checked = true;
        $("#btnContinueTop").click();
        return noAction(evt);
    });
}

//////////Wager sched//////////
function sbkWagerSched(isMobile){
	if (isMobile == "true")
	{
		$("a.btnHideBlock").bind("click", function(evt){
			switchVisible($(this).attr("id").replace("_button","") +  "_block", $(this).attr("id"));
			return noAction(evt);
		});		
	}
	else
	{
		$("a.btnShowBlock").bind("click", function(evt){
			switchVisible($(this).attr("id").replace("_button","") +  "_block", $(this).attr("id"));
			return noAction(evt);
		});	
	}    
    
    $(".statsLink a").bind("click", function(evt){
        var longId = $(this).attr("id").split("_");
        callModal("#" + longId[0] + "_" + longId[1] + "_" + longId[2], longId[3], longId[4], longId[5]);
        return noAction(evt);
    });
    
    $("a.btnAddGame").bind("click", function(evt){
        document.forms[0].SelectedGame.value = $(this).attr("id").replace("add_","");
        document.forms[0].submit(); 
		return noAction(evt);
    });
}

//////////Wager ticket//////////
function sbkWagerTicket(){
    $(".newStraight").bind("click", function(evt){
        document.forms[0].SelectedWagerType.value = '0'; 
		document.forms[0].submit(); 
		return noAction(evt);
    }).bind("mouseenter", function(evt){
        $("#msg_StraightProp").show();
    }).bind("mouseout", function(evt){
        $("#msg_StraightProp").hide();
    });
    $(".newRound").bind("click", function(evt){
        document.forms[0].SelectedWagerType.value = '5'; 
		document.forms[0].submit(); 
		return noAction(evt);
    }).bind("mouseenter", function(evt){
        $("#msg_ParlayProp").show();
    }).bind("mouseout", function(evt){
        $("#msg_ParlayProp").hide();
    });
    $(".newParlay").bind("click", function(evt){
        document.forms[0].SelectedWagerType.value = '1'; 
		document.forms[0].submit(); 
		return noAction(evt);
    }).bind("mouseenter", function(evt){
        $("#msg_ParlayProp").show();
    }).bind("mouseout", function(evt){
        $("#msg_ParlayProp").hide();
    });
    $(".newBet").bind("mouseenter", function(evt){
        $("#msg_NewBet").show();
    }).bind("mouseout", function(evt){
        $("#msg_NewBet").hide();
    });
    $(".openBets").bind("mouseenter", function(evt){
        $("#msg_OpenBets").show();
    }).bind("mouseout", function(evt){
        $("#msg_OpenBets").hide();
    });
}
