if (Drupal.jsEnabled) {

	//-- On Document Ready
	$(document).ready( function() {

		$("#mySkip").click(function(){
			$("#win_draw_draw").attr("checked","checked");
			$("#score_a").text("0");
			$("#score_b").text("0");
			tb_remove();
		});

	}); // document ready

  // Popup function
  function mypop(id){
    if (id!=null){
      // Fetch the prediction propertys for this popup link and assign it to the modal box fields
      pred_props = $(id).attr("pred_props");
      var pred_props_array = pred_props.split(":");
      $("#game_id").val(pred_props_array[0]);
      $("#teamA").text(pred_props_array[1]);
      $("#teamB").text(pred_props_array[2]);
      $("#win_draw_a").val(pred_props_array[3]);
      $("#win_draw_b").val(pred_props_array[4]);
      $("#score_a").val(pred_props_array[5]);
      $("#score_b").val(pred_props_array[6]);
      // Tick the correct radio options
      scoreA = $("#score_a").val();
      scoreB = $("#score_b").val();
      if (scoreA>scoreB){
        $("#win_draw_a").attr("checked","checked");
      }
      else if (scoreA<scoreB){
        $("#win_draw_b").attr("checked","checked");
      }
      else {
        $("#win_draw_draw").attr("checked","checked");
      }
    }
    // Show the modal box
    tb_show(null, "#TB_inline?height=305&width=310&modal=true&inlineId=myOnPageContent", false);
    // Ignore the link click on the page
    return false;
  };

}
