$(document).ready(function()
{
  //hide the all of the element
  $(".ptwbody").hide();
  //toggle the component
  $(".ptwimg").click(function()
  {
    $(this).next(".ptwbody").slideToggle(600);
  });
	$(".ptwhide").click(function()
	  {
		$(this).closest(".ptwbody").slideToggle(600);
	  });  
});

function SubmitPTW(s, t, so_id, ptw, at, ht, e){
	var ptwDiv = document.getElementById(ptw);
	var eSpan  = document.getElementById(e);
	var side = $("input[name='" + s + "']:checked").val();
	var total = $("input[name='" + t + "']:checked").val();
	if ( (typeof(side)=="undefined") && (typeof(total)=="undefined") ){
		eSpan.innerHTML = 'Please select a team or total!';
	}else{
		var url = "/inc/ptw.asp?s=" + side + '&t=' + total + '&so_id=' + so_id + '&at=' + at + '&ht=' + ht;
		ptwDiv.innerHTML = '<p>Loading...</p>';
		$.post(url, function(data){
		  ptwDiv.innerHTML = data;
		});	
	}//end if

}//end SubmitPTW

function hideResults(ptw){
	$(ptw).slideToggle(600);
}

function showResults(ptw, gt, at, ht){
	var ptwDiv = document.getElementById("div" + ptw);
	$.post("/inc/ptwshow.asp?so_id=" + ptw + "&gt=" + gt + "&at=" + at + "&ht=" + ht, function(data){
	  ptwDiv.innerHTML = data;
	});
}