
jQuery.fn.bdo_isvalid = function() {
	var isvalid = true;
	
  	$(this).find(".required.default-value").each(function(){
 		 if ($.trim(this.value) == this.defaultValue ){
                $(this).css('border-color','red');
                isvalid = false;
            }else{
                $(this).css('border-color','#7F7F7F');
                isvalid = isvalid * true;
            }
  	});
  	
   	$(this).find(".email.default-value").each(function(){
   		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
 		if (!filter.test(this.value)){
        	$(this).css('border-color','red');
        	isvalid = false;
         }else{
         	$(this).css('border-color','#7F7F7F');
            isvalid = isvalid * true;
         }
  	});

     return Boolean(isvalid);
};

$(document).ready(function() {
	
	$('.default-value').each(function() {
		var default_value = this.value;
		$(this).css('color', '#666'); // this could be in the style sheet
										// instead
			$(this).focus(function() {
				if (this.value == default_value) {
					this.value = '';
					$(this).css('color', '#333');
				}
			});
			$(this).blur(function() {
				if (this.value == '') {
					$(this).css('color', '#666');
					this.value = default_value;
				}
			});
		});
	
	$('#footer .left_float table td').hover(function() {
		$(this).siblings().stop().fadeTo(200,0.7);
	}, function() {
		$(this).siblings().stop().fadeTo(200,1);
	});
	/*
	$('#nd_menu a').click(function(event){
		event.preventDefault();
		$('#html').load($(this).attr('href')+' #html');
		alert($(this).attr('href')+' #html');
	});
	*/
});

