/* <![CDATA[ */
$(document).ready( function(){



		//tabs for menu page
    	    $("div.tab-content").hide();
			//show the welcome page by default
			$("div.first-active").show();
    	    $("div.first-active").addClass("activetab");
			
        	$("ul.tabs a").click(function(){
    	        // hide anything that's open
				$("div.activetab").hide();
            	// remove class from others
                $("div.activetab").removeClass("activetab"); 
	            // show div
    	        $(this.href.substring(this.href.indexOf("#"), this.href.length)).show();
				// add class to just clicked
				$(this.href.substring(this.href.indexOf("#"), this.href.length)).addClass("activetab");
				   
            	// remove class from current selected
                $(".tabs li.selected").removeClass("selected"); 
				// add class to just clicked
				$(this).parent().addClass('selected');
				   
                return false;
			});		
			
			
		// when the form is submitted
		$('#f_comments').submit( function(){
		
			var reg_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/; 
			
			var inputcheck = $('#s_email');
			// if field has something in it, do submit actions, otherwise write out error
			if( inputcheck.val() == '' || !reg_email.test( inputcheck.val() ) ){
				// add class to change colour
				inputcheck.addClass("required").get(0).focus();
				return false;
			}else{
				inputcheck.removeClass("required");
			}
			
			var inputcheck = $('#s_comments');
			// if field has something in it, do submit actions, otherwise write out error
			if( inputcheck.val() == '' ){
				// add class to change colour
				inputcheck.addClass("required").get(0).focus();
				return false;
			}else{
				inputcheck.removeClass("required");
			}
			
		});
		
		// when the form is submitted
		$('#emailsub').submit( function(){
		
			var reg_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/; 
			
			var inputcheck = $('#mb-tjqj-tjqj');
			// if field has something in it, do submit actions, otherwise write out error
			if( inputcheck.val() == '' || !reg_email.test( inputcheck.val() ) ){
				// add class to change colour
				inputcheck.addClass("required").get(0).focus();
				return false;
			}else{
				inputcheck.removeClass("required");
			}

			
		});
		
		$("p.success").animate({opacity: 1.0}, 5000).fadeOut("slow");

		
			
});
/* ]]> */