$(document).ready(function() {
	var hideandshow = $("input[type='text'], textarea");
	hideandshow.each(function(i){
		this.temp = $(this).val();
	});
	hideandshow.focus(function(){
		if (this.temp!='') $(this).val('');
	});
	hideandshow.blur(function(){
		if ($(this).val()=='') $(this).val(this.temp);
	});
	
	//babysitter shopping cart
	var carts = $(".add_to_cart img");
	carts.click(function(e){
		e.preventDefault();
		var inp_val = $('input', $(this).parent().parent());
		if (inp_val.attr('checked')==true) inp_val.attr('checked', false);
		else inp_val.attr('checked', true);
	});
	
	//alerts
	if (!jQuery.browser.msie || jQuery.browser.version.substr(0,1)>=7)
	{
		$('#warning').css('position', 'absolute').css('left', 120).css('top', -70).css('padding', '12px 18px 38px').width(700);
		$('#warning .close').css('display', 'block').click(function(e){e.preventDefault();$('#warning').remove()});
	}
	else 
	{
		$('#warning .close').remove();
	}
	
	$('input.date').each(function(){
		$(this).datepicker({dateFormat: 'yy-mm-dd', yearRange: '-0:+1'});
	});
	$('input.birthday').each(function(){
		$(this).datepicker({dateFormat: 'yy-mm-dd', yearRange: '-18:+0'});
	});
});