$(document).ready(function() { 
	oTable1 = $('#incoming_table').dataTable({
	 	"iDisplayLength": parseInt($.cookie('row_qty')),
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "aLengthMenu": [[10, 25, 50 ,100 , -1], [10, 25, 50, 100, "All"]]
    });
	oTable2 = $('#outgoing_table').dataTable({
	 	"iDisplayLength": parseInt($.cookie('row_qty')),
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "aLengthMenu": [[10, 25, 50 ,100 , -1], [10, 25, 50, 100, "All"]]
    });
	oTable3 = $('#extra_table').dataTable({
	 	"iDisplayLength": parseInt($.cookie('row_qty')),
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "aLengthMenu": [[10, 25, 50 ,100 , -1], [10, 25, 50, 100, "All"]]
    });
	oTable4 = $('#current_table').dataTable({
	 	"iDisplayLength": parseInt($.cookie('row_qty')),
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "aLengthMenu": [[10, 25, 50 ,100 , -1], [10, 25, 50, 100, "All"]]
    });
	
	hoverTabs("#inout_tabs");
	
    $(".questionable,.sure").click(function(){
    	var iid = $(this).parent().attr('id');
    	var pid = $(this).parent().parent().parent().attr('id');
    	var row =  $(this).parent().parent().parent();
    	
    	$.post("/administration/matchmaker.php", { iid: iid, pid: pid })
    	.done(function(data) {
    	  row.remove();
    	});
    	
    });
    $('#incoming-tab').css("visibility", "visible");
    $('#outgoing-tab').css("visibility", "visible");
    $('#extra-tab').css("visibility", "visible");
    $('#current-tab').css("visibility", "visible");
    $('#inout_tabs').css("visibility", "visible");
	 $("[name*='incoming_table']").change(function(){
		 $.cookie('row_qty',$(this).val());
	 });
	 $("[name*='outgoing_table']").change(function(){
		 $.cookie('row_qty',$(this).val());
	 });
	 $("[name*='extra_table']").change(function(){
		 $.cookie('row_qty',$(this).val());
	 });
	 $("[name*='current_table']").change(function(){
		 $.cookie('row_qty',$(this).val());
	 });
	 zoomerInit();
}); 