    $(function() {  
      $('.error').hide();  
  $(".suggestion").click(function() { 
        // validate and process form here  
          

        $('.error').hide();  
		 $('#thankyou').hide();  //hide thank you message
        
           var message = $("textarea#limitedtextarea").val();  
           if (message == "") {  
			$("label#message_error").show();  
			$("textarea#limitedtextarea").focus();  
			return false;  
		   }  
			
			$('.loading').show(); //show the loader
	/*		var spam = $("input#spam").val();  
           if (spam != "blue") {  
			$("label#spam_error").show();  
			$("input#spam").focus();  
			return false;  
		   }  */
	

 
    // var dataString = '&message=' + message; 
	var dataString = '&message=' + message; 

 // var dataString = $("#contact_form form").serialize();
    //alert (dataString);return false;  
    $.ajax({  
      type: "POST",  
 //     url: "http://www.meantimeviola.com/cgi-bin/FormMail.pl",  
	  url: "prosuggestion.php", 
      data: dataString,  
      success: function(data) {  
	
$('#thankyou').empty();  //empty div so thank you only shows once if user makes 2 comments in a row
$('#thankyou').append(data); //add stuff from prosuggestion.php
$('#thankyou').show(500); //show it
$('.loading').hide(); //hide loader

			//$('#suggestionform').html("<div id='message1'></div>");  //replaces contact_form with div      
		//	$('#message1').html("<h3><font style='color:#3e3e3e;'>Thank you for your comments,</font></h3>")  
			//.append("<p>They will be considered by the committee.</p>")  
			// .hide()  
		//	.fadeIn(1500, function() {  
		//	$('#message1').append("<img id='checkmark' src='images/check.png' />");  
		//	});  


     } //success 
   });  //ajax
   return false;  
     });  //click
});  //doc ready







 $(function() {  //-------------------------------------------------------------for voting
//limit to three
$.fn.limit = function(n) {
 var self = this;
 this.click(function(){ return (self.filter(":checked").length<=n); });
}
$("input:checkbox").limit(3);
//end limit to three

$('.loading').hide();//hide the loader
$('#vote6results').hide(); //hide the results div



//check for ip address when the page loads, this is in fact when any page loads as it is in a doc ready
$.get('checkip.php', function(data) {
	if (data=="noip"){// do not use an underscore in the data returned - ie does not like
	//see the vote button
	//nothing to come back from php
	}else{
	$('#vote6results').append(data); //append the div with the results from checkip.php
	$('#vote6results').show(); //show them as they are hidden
	//	$('#vote6results').addClass('curvedborder');//add the border to #vote6results

	$('#vote6').hide(); //hide the vote button
	}//else
});
//end check for ip


 $("#vote6").click(function() { 
$('#vote6').hide(500); //hide the vote button
//$(this).attr('disabled', 'disabled');
$('.loading').show(); //show the loader

var mydata = new Array();
$('#formvote6 :checkbox:checked').each(function(index, item) {
   mydata.push($(this).val()); //push all the values of the checkboxes into the array 'mydata'
});

var dataString = '&mydata=' +mydata;
//var vote = $('input:radio[name=vote]:checked').val(); 
//var vote = $("input#vote").val();  //this only gets the first value of the set of radio buttons!!

//var dataString = '&vote=' + vote; 
 //show loader 
//$(this).attr('disabled', 'disabled'); //disable button?

$.ajax({  
      type: "POST",  
	  url: "processvote6.php", 
      data: dataString,
      success: function(data) {
		 // alert(html);
//			$('#formvote6').html("<div id='message1'></div>");  //replaces contact_form with div      
					//	$('#formvote6').html(data);  //replaces contact_form with div   
					$('#vote6results').empty();
	$('#vote6results').append(data);
	$('#vote6results').show();

//	$('#vote6results').addClass('curvedborder');//add the border to #vote6results
		$('.loading').hide(); //hide loader


		//	$('#message1').html("<h3><font style='color:#3e3e3e;'>Thank you for your comments,</font></h3>")  
		//	.append("<p>They will be considered by the committee.</p>")  
		//	 .hide()  
		//	.fadeIn(1500, function() {  
		//	$('#message1').append("<img id='checkmark' src='images/check.png' />");  
		//	});  
     } //success 
   });  //ajax
   return false;  
     });  //click
 });  //doc ready




//for tabs - this is how it was
/*
$(document).ready(function(){
	$("ul#navigation li a").click(function() {
		$("ul#navigation li").removeClass("selected");
		$(this).parents().addClass("selected");
		return false;
	});//click
});//doc ready
*/

$(document).ready(function(){

$(".hidethis").hide();
//$('#tab3').show();
$('#tab1').show();

	//var classList =$('ul#navigation li').attr('class').split(/\s+/);

	$("ul#navigation li a").click(function() {
		$("ul#navigation li").removeClass("selected");
		$(this).parents().addClass("selected"); //adds 'selected  
		var myClass= $(this).parent().attr('class');
		//alert(myClass);
		if (myClass==="one selected"){
//			$('#tabbedcontent').html("<p> asdasdaddasasdass</p>");
				$(".hidethis").hide();
				$('#tab1').show();
		//		$('#tabbedcontent').replaceWith($('#tab1'));
	//	$('#tabbedcontent').empty();
//		$('#tab1').show();
		}else if (myClass==="two selected"){
		$(".hidethis").hide();
		$('#tab2').show();
		//}else if (myClass==="three selected"){
		//$(".hidethis").hide();
		//$('#tab3').show();
		}else if (myClass==="four selected"){
		$(".hidethis").hide();
		$('#tab4').show();
		}else if (myClass==="five selected"){
		$(".hidethis").hide();
		$('#tab5').show();
		}

		//var myClass = $("ul#navigation li").attr("class");
		//var myClass = $(this).attr("class");


//$.each(classList, function(index, item){
	// 
  //  alert(index + ': ' + item);
 // });

	


return false;
	});//click
});//doc ready

//for (i = 0; i < classList.length; i++) {
   //if (list[i] === 'someClass') {
     //do something
   //}
//}


//		var classList =$('ul#navigation li').attr('class').split(/\s+/);
//$.each( classList, function(index, item){
    //if (item==='someClass') {
       //do something
//	   alert(index, item);
//    });
		//alert(myClass);
//		return false;
//	});//click
//});//doc ready

/*
var classList =$('ul#navigation li').attr('class').split(/\s+/);

$.each( classList, function(index, item){
    if (item==='one') {
       alert("its one");
	}else{
		alert("another");
	}
});//each
});//doc ready
*/

/*
var classList =$('#divId').attr('class').split(/\s+/);
$.each( classList, function(index, item){
    if (item==='someClass') {
       //do something
    }
});
*/


   
