jQuery(document).ready(function() {
//jQuery('#textCorrections  tr:odd').css('background-color', '#dddddd');
jQuery('#textCorrections  td:even').css('font-weight', 'bold');
jQuery('#textCorrections  th').css({'color' : 'blue', 'cursor': 'pointer', 'text-decoration' : 'underline'});
jQuery('#textCorrections  th').attr('title','Click To Sort');
jQuery('#textCorrections  td').hover(function() {
$(this).addClass('zebraHover');
}, function() {
$(this).removeClass('zebraHover');
});


jQuery(function() {
		jQuery("#tabs").tabs();
	});

	jQuery('#sendCorrection').ajaxContactForm(
			'../../jQuery/ajaxContactForm-1.3.3/functions/send_ajaxcontactform.php', 
			{	/*	Configuratie goes here	*/	}
		);

		// add new widget called repeatHeaders
jQuery.tablesorter.addWidget({
	// give the widget a id
	id: "repeatHeaders",
	// format is called when the on init and when a sorting has finished
	format: function(table) {
		// cache and collect all TH headers
		if(!this.headers) {
			var h = this.headers = []; 
			$("thead th",table).each(function() {
				h.push(
					"" + $(this).text() + ""
				);
				
			});
		}
		
		// remove appended headers by classname.
		$("tr.repated-header",table).remove();
		
		// loop all tr elements and insert a copy of the "headers"	
		for(var i=0; i < table.tBodies[0].rows.length; i++) {
			// insert a copy of the table head every 10th row
			if((i%5) == 6) {
				$("tbody tr:eq(" + i + ")",table).before(
					$("").html(this.headers.join(""))
				
				);	
			}
		}
	}
});
		
	// call the tablesorter plugin     
	jQuery("#textCorrections").tablesorter
	(
	   {
	    // sort on the first column, order asc 
	         sortList: [[0,0]] ,
					 widgets: ['zebra', 'repeatHeaders']
			 }
  ); 
								
 // set sorting column and direction, this will sort on the first column the column index starts at zero      
	// jQuery("#textCorrections").trigger("sorton",[[0,0]]); 							
	
});
 //handle name and email reuse button
  
function showButton(storeHere, value, inputBox, btn)
 {
 if(document.getElementById(value).value != "")
  {
	document.getElementById(storeHere).innerHTML = document.getElementById(value).value;
  }
	
  if (document.getElementById(storeHere).innerHTML == "")
	 { 
	  btn.style.display = 'none';
	  }
	 else
	 {
	  btn.style.display = 'inline-block';
	  }	
 }


