// switch between widget tabs

jQuery(document).ready(function() {

	$('.widget-navi a .activity').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$(this).parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.activity').show();
	});
	$('.widget-navi a .nutrition').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$(this).parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.nutrition').show();
	});
	$('.widget-navi a .health').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$(this).parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.health').show();
	});
	$('.widget-navi a .care').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$(this).parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.care').show();
	});

	
	$('#content_right .ico_pen.activity').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$('.widget-navi a .activity').parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.activity').show();
	});
	$('#content_right .ico_pen.nutrition').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$('.widget-navi a .nutrition').parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.nutrition').show();
	});
	$('#content_right .ico_pen.health').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$('.widget-navi a .health').parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.health').show();
	});
	$('#content_right .ico_pen.care').click(function() {
		event.preventDefault();
		$('.widget-navi a').removeClass('widget-active');
		$('.widget-navi a .care').parent().addClass('widget-active');
		$('.widget-content').hide();
		$('.widget-content.care').show();
	});	
	
});


// widget select dogs

jQuery(document).ready(function() {
	$('.widget-thumbs a').click(function() {
		event.preventDefault();
		if ($(this).parent().hasClass('widget-thumbs-selected')) {
//			alert('a');
			$(this).parent().removeClass('widget-thumbs-selected');
		} else {	
//			alert('b');
			$(this).parent().addClass('widget-thumbs-selected');
		};
	});
});

/*jQuery(document).ready(function(){
	jQuery('#selectimage').selectImage();
});*/


// clear input or textarea value on onfocus

jQuery(document).ready(function() {
	$('input.default-value').each(function() {
		var default_value = this.value;
	    $(this).css('color', '#999'); // this could be in the style sheet instead
		$(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
	            $(this).css('color', '#fff');
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
	            $(this).css('color', '#999');
				this.value = default_value;
			}
		});
	});
	$('textarea.default-value').each(function() {
		var default_value_textarea = $(this).val();
	    $(this).css('color', '#999'); // this could be in the style sheet instead
		$(this).focus(function(){
			if(this.value == default_value_textarea) {
				this.value = '';
	            $(this).css('color', '#000');
			}
		});
		$(this).blur(function(){
			if(this.value == '') {
	            $(this).css('color', '#999');
				this.value = default_value_textarea;
			}
		});
	});
});

