$(document).ready(function(){
	$('.mform input').mouseover(function() {
		$(this).parent().addClass('hover')
		$(this).parent().parent().children('.end').addClass('hover-e')
	})
	$('.mform input').mouseout(function() {
		$(this).parent().removeClass('hover')
		$(this).parent().parent().children('.end').removeClass('hover-e')
	})
	$('.mform input').focus(function() {
		$(this).parent().addClass('focus')
		$(this).parent().parent().children('.end').addClass('focus-e')
		$(this).parent().children('label').hide()
	})
	$('.mform input').blur(function() {
		$(this).parent().removeClass('focus')
		$(this).parent().parent().children('.end').removeClass('focus-e')
		var val = $(this).val()
		if ((val == undefined) || (!val) || (val == '')) {
			$(this).parent().children('label').show()
		}
	})
	$('.mform label').click(function() {
		$(this).hide()
		$(this).parent().children('input').focus()
	})
	
	$('.mform label').mouseover(function() {
		$(this).parent().addClass('hover')
		$(this).parent().parent().children('.end').addClass('hover-e')
	})
	
	$('.mform input').each(function() {
		var val = $(this).val()
		if (val) {
			$(this).parent().children('label').hide()
		}
	})
})
