$(document).ready(function() {	
	stripe_tables();
});

function doGoogleDates(type) 
{
	// do nothing if blank
	if ($('.gdate').val() == '')
		return;
	// split the dates
	var data = $('.gdate').val().split(':');
	
	$('#from').val(data[0]);
	$('#to').val(data[1]);
	
	$('.filter').submit();
	
}



/**
*	This function creates the table striping effects
*	To change the look edit the alt and over class in the main css
*/
function stripe_tables() {

	// add CSS to EVEN tbody rows
	$('.stripeMe').find("tbody tr:even").addClass('rowEven');
	
	// add CSS to ODD tbody rows
	$('.stripeMe').find("tbody tr:odd").addClass('rowOdd');

	// bind mouseover function to create row hover effect 
	$('.stripeMe').find("tbody tr").mouseover(function(){
		$(this).addClass('rowOver');
	});

	// remove class on mouseout
	$('.stripeMe').find("tbody tr").mouseout(function(){
		$(this).removeClass('rowOver');
	});	
}

/**
*	Set global AJAX calls to be POSTed
*/
$.ajaxSetup( {
   global: true,
   type: "POST"
 } );

 function showDiv(showid,showid2,hideid) {
   	show = document.getElementById(showid);
	show.style.display='inline';
	show2 = document.getElementById(showid2);
	show2.style.display='inline';
	hide = document.getElementById(hideid);
	hide.style.display='none';
}

function hideDiv(hideid,hideid2,showid) {
   	show = document.getElementById(showid);
	show.style.display='inline';
	hide = document.getElementById(hideid);
	hide.style.display='none';
	hide2 = document.getElementById(hideid2);
	hide2.style.display='none';
}
