//°ü·Ã°æ±â 
function getMatchCollection(venueId, dateId, round){
	var venueId = venueId;
	var dateId = dateId;
	var round = round;
	
	new Ajax.Updater('matchCollection', '/pieces/matchCollection.jsp',
						 { asynchronous:true,
						   evalScripts:true,
						   parameters: { venueId: venueId, dateId:dateId, round:round },
						   onComplete: function (response){
	       									$("matchCollection").stopWaiting();
	       									//alert('ring');
	       								}
						 }
					 );
}

function moveTopTab(targetTab, vanueId, dateId, roundId) {
	alert(targetTab + " " + vanueId+ " " + dateId+ " " + roundId);
    $('topTap1','topTap2').invoke('hide');
	if ($('matchCollection').empty()){
		$("matchCollection").startWaiting('bigWaiting');
		getMatchCollection(vanueId, dateId, roundId);

	}
	
	$(targetTab).show();

}



//°æ±â Àå¼Ò 
function getPlaceInfo(venueId){
	var venueId = venueId;
	
	new Ajax.Updater('placeInfo', '/pieces/placeInfomation.jsp',
						 { asynchronous:true,
						   parameters: { venueId: venueId },
						   onComplete: function (response){
	       									$("placeInfo").stopWaiting();
	       									//alert('ring');
	       								}
						 }
					 );
}

//Æ¼ÄÏÆÃ Á¤º¸ 
function getTicketInfo(venueId,dateId, round){
	var venueId = venueId;
	var dateId = dateId;
	var round = round;
	
	new Ajax.Updater('ticketInfo', '/pieces/ticketInfomation.jsp',
						 { asynchronous:true,
						   parameters: { venueId: venueId, dateId:dateId, round:round },
						   onComplete: function (response){
	       									$("ticketInfo").stopWaiting();
	       								}
						 }
					 );
}



function moveMidTab(targetTab, venueId, dateId, round) {
	//alert(targetTab +" : "+ venueId +" : "+ dateId +" : "+ round);
    $('midTab1','midTab2','midTab3').invoke('hide');

	
	if (targetTab == 'midTab2' &&  $('placeInfo').empty()){
		$("placeInfo").startWaiting('bigWaiting');
		getPlaceInfo(venueId);

	}
	else if (targetTab == 'midTab3' &&  $('ticketInfo').empty()){
			$("ticketInfo").startWaiting('bigWaiting');
			getTicketInfo(venueId, dateId, round);
	}
	$(targetTab).show();

}



//»ó¼¼ º¸±â 
function fncDetail(matchId){
      document.frm.proCd.value = matchId;
      document.frm.command.value = "showMatchTicket";
      document.frm.action = "/reserve/reserveControler.jsp";
      document.frm.submit();
} 