jQuery(document).ready(function($){
						   
	/* client login */
	$("#nav-login").click(function(){
		$(this).toggleClass("on");
		$("#login-wrapper").toggle();
	});
	$('.cl_form, .form').focus(function(){
		if($(this).val()==$(this).attr('title')){
			$(this).val('');
		}
	}).blur(function(){
		if($(this).val()==''){
			$(this).val($(this).attr('title'));
		}
	});	
	
	$("#featured").innerfade({
		speed: "slow",
		timeout: 8000,
		type: "random",
		containerheight: "250px"
	});
	
	
	/* form checks and submit */
	var first_number = Math.floor(Math.random()*9)+1;
	var second_number = Math.floor(Math.random()*9)+1;
	$("#volt_first").val(first_number);
	$("#volt_second").val(second_number);
	$("#form_check").val(first_number+" + "+second_number+" = ").attr('title', first_number+" + "+second_number+" = ");
	
	$("#submit_button").click(function(){
		var err = false;
		$("#form_with_submit input,#form_with_submit textarea").each(function(){
			if($(this).attr('id').substr(0, 2)=="r_" || $(this).attr('id')=="form_check"){
				if($(this).val() == "" || $(this).val() == $(this).attr('title')){
					$(this).css('border-color', '#ff0000');
					err = true;
				}else{
					$(this).css('border-color', '#ededed');
				}
			}
		});
		if(err==false){
			return true;
		}else{
			return false;
		}
	});
	
});