// JavaScript Document
// all the jQuery code goes into document.ready()!!!!!!!!!!!!!!!!!!!!!!!! 
$(document).ready(function(){
	//
	/*
	$('#demotable').dataTable({
						
						"aaSorting": [[ 0, "asc" ]],
						"bJQueryUI": true,
						"bStateSave": false,
						"sPaginationType": "full_numbers"
									  });
	*/
	//

	$('#header').hover(
		function(){
			$(this).addClass('zindex');
		},
		function(){
			$(this).removeClass('zindex');
		}
	);


$('td a img').hover(
		function(){
			$(this).animate({opacity: 0.3});
		},
		function(){
			$(this).animate({opacity: 1});
		}
	);
//
//
$('#pastContests').accordion({
    header:'h2',
	active: false,
	//event: 'mouseover',
	autoHeight: false
  });
//
$('#pastContests h2').hover(
	function(){
		$(this).animate({opacity: 0.3});
	},
	function(){
		$(this).animate({opacity: 1});
	}
);
//




	//contact form validation
	/*
	$('#contactForm').validate({
		rules:{
			name: 'required',
			address: 'required',
			phone: 'required',
			email: 
				{
					required: true,
					email: true
					},
			subject: {required: true},
			message: 'required'		
		}, //end of rules
		 messages: {
			 name: "<br/>Please enter your name",
			 subject: "<br/>Please select the subject of the message",
			 address: "<br/>Please enter your address",
			 phone: '<br/>Please enter your phone number',
			 email: {
				 required: "<br/>Please supply an e-mail address",
				 email: "<br/>This is not a valid email address"
			   },
			 message: "<br/>Please enter your message" 
		 }, //end of messages
		errorPlacement: function(error, element) { 
          error.insertAfter(element);
        }
	}); //end of validate
	//$('#contactForm input').addClass('required');
	$('#contactForm #email').addClass('email');
	//
	*/
	
	
	
	$('.ageWarning').click(function(evt){
		var href = $(this).attr('href');
		var answer = confirm("Page you are about to view contains explicit content. By clicking 'OK' button you hereby certify that you are at least 18 years old.")
		if (answer){
			//
		}
		else{
			evt.preventDefault();
			window.location = 'http://www.revfmradio.com/';
		}

	});
	
$('table').tablesorter({widgets: ['zebra']});
	
	
}); // end of document.ready - jQuery