// JavaScript Document


jQuery(document).ready(function() {

$('#hidemeunlesschecked').slideUp();
$('#fademeout').slideUp();

$("#attend").click(function () {
       
		if ($('#attend:checked').length>0){
			  $('#hidemeunlesschecked').slideDown();
				$('#option1').slideUp();
				$('#option2').slideUp();
			  } else {
				$('#hidemeunlesschecked').slideUp();
				$('#option1').slideDown();
				$('#option2').slideDown();

			  }
    });

$("#location").click(function () {
       
		if ($('#location:checked').length>0){
			  $('#fademeout').slideDown();
			  } else {
				$('#fademeout').slideUp();
			  }
    });





if ($('#attend:checked').length>0){

$('#hidemeunlesschecked').slideDown();
}

if ($('#location:checked').length>0){

$('#fademeout').slideDown();
}



$(".page-item-651 a:first").attr("href","#");
$(".page-item-657 a:first").attr("href","#");

								
	$("#activity").change(function(){ 
		 var message_index
		 message_index = $("#activity").val() ;
		 if (message_index == "Other"){
		 
	 	$(".hideme").slideDown();
	
	
		 }else{
			 $(".hideme").slideUp("fast");
		 }
		 });
								
								
					$(".panel").fadeOut("fast");
								
					
					
					$("#newsletterform").validate({
					    rules: {
						email: "required",
						confirmemail: {
						  equalTo: "#email"
						}
					  }
					});
					
					
					
					$("#commentForm").validate({
					    rules: {
						email: "required",
						confirmemail: {
						  equalTo: "#email"
						}
					  }
					});

					
  $(".doubleborderlink a").hover(
						   
	   function () {
      $(this).animate({paddingLeft: "40px"}, {queue:false, duration:300});
	  
						   },
		function () {
      $(this).animate({paddingLeft: "30px"}, {queue:false, duration:300});
						   }				   
						   
    );				
  
  
			
		$("#firstlink").hover(
			 function () {
				$("#drop1").fadeIn("slow");
				$(".topcenter").css({backgroundPosition:"0px 0px"});
			},
			
			 function () {
				 $("#drop1").fadeOut("slow");
				 
				 }
		);
		$("#secondlink").hover(
			 function () {
				$("#drop2").fadeIn("slow");
				$(".topcenter").css({backgroundPosition:"0px -316px"});
			},
			
			 function () {
				 $("#drop2").fadeOut("slow");
				 }
		);
		$("#thirdlink").hover(
			 function () {
				$("#drop3").fadeIn("slow"),
				$(".topcenter").css({backgroundPosition:"0px -632px"});
			},
			
			 function () {
				 $("#drop3").fadeOut("slow");
				 }
		);		
						
	 
			$("#fourthlink").hover(
			 function () {
				$("#drop4").fadeIn("slow"),
				$(".topcenter").css({backgroundPosition:"0px -948px"});
			},
			
			 function () {
				 $("#drop4").fadeOut("slow");
				 }
		);	 
	 
	 
	 $(".sidenav a").hover(
						   
	   function () {
      $(this).animate({paddingLeft: "45px", backgroundPosition:"21px 8px"}, {queue:false, duration:300});
						   },
		function () {
      $(this).animate({paddingLeft: "35px", backgroundPosition:"15px 12px"}, {queue:false, duration:300});
						   }				   
						   
    );		
	 
	 $(".sidenav li ul li a").hover(
						   
	   function () {
      $(this).animate({paddingLeft: "60px", backgroundPosition:"32px 8px"}, {queue:false, duration:300});
						   },
		function () {
      $(this).animate({paddingLeft: "50px", backgroundPosition:"25px 12px"}, {queue:false, duration:300});
						   }				   
						   
    );		 
	 
	 $(".sidenav .current_page_item a").hover(
						   
	   function () {
      $(this).animate({paddingLeft: "60px", backgroundPosition:"21px 8px"}, {queue:false, duration:300});
						   },
		function () {
      $(this).animate({paddingLeft: "50px", backgroundPosition:"21px 8px"}, {queue:false, duration:300});
						   }				   
						   
    );	
	 
	 
	 $(".sidenav li ul li:last-child").css({borderBottom:"0", paddingBottom:"0"});
	 
	$(".sidenav li ul li:first-child").css({borderTop:"1px solid #ffffff", paddingTop:"2px"});
	
	
	
	
	$(function mainmenu(){
$(" #navmenu-h a").removeAttr("title");
if(!$.browser.msie){
	$(" #navmenu-h ul ").css({opacity:"0.97"});
}// IE  - 2nd level Fix

$(" #navmenu-h ul ").css({display: "none"}); // Opera Fix
$(" #navmenu-h li").hover(function(){
		$(this).find('ul:first:hidden').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
})
	


	
	
	//Styling tables
	
		$(".wptable").attr({ 
          colspan: "4",
		  cellpadding:"0", cellspacing:"0"
        });
	$(".wptable th:first").css({borderRight: "1px solid #FFFFFF"});
	
	$(".alt td:nth-child(5), .alt td:nth-child(4), .alt td:nth-child(3)").remove();
	
	
	$(".alt td:nth-child(2)").attr({ 
          colspan: "4"
        });
	$(".alt td:nth-child(2)").each(function() { this.colSpan = 4; });
	
		$(".alt td:nth-child(2)").css({backgroundColor: "#f9f9f9", width: ""});

	
	$(".wptable").hide();
	$(".wptable").show();
	
	
	
	 $(".show").click(function () { 
      $(".hide").slideDown(); 
    });

	 $("#newsletterform").submit(function(){

	if ($("#marine").is(':checked') || $("#ict").is(':checked') || $("#marketing").is(':checked') || $("#buyamdsell").is(':checked') ) {
       

		
      }else{
		
		$("#forcehi").addClass("focused");
		$("#hideit").slideDown();
        return false;
	  };
			   


					   
	});

	});